{
  "openapi": "3.1.0",
  "info": {
    "title": "Reddit Ads MCP Server",
    "description": "Reddit Ads API for community-driven advertising campaigns",
    "version": "1.0.0",
    "contact": {
      "name": "Hopkin",
      "url": "https://hopkin.ai"
    }
  },
  "servers": [
    {
      "url": "https://reddit.mcp.hopkin.ai",
      "description": "Production MCP endpoint"
    }
  ],
  "paths": {
    "/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "List available tools",
        "description": "Returns all tools registered on this server with their names, descriptions, and input schemas.",
        "tags": [
          "discovery"
        ],
        "responses": {
          "200": {
            "description": "Tool list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolList"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_get_account_summary": {
      "post": {
        "operationId": "reddit_ads_get_account_summary",
        "summary": "Get Reddit Ads Account Summary",
        "description": "Get a high-level performance summary for a Reddit ad account over a date range.",
        "tags": [
          "account-summary"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reddit ad account ID."
                  },
                  "date_start": {
                    "type": "string",
                    "description": "Start date in YYYY-MM-DD format."
                  },
                  "date_end": {
                    "type": "string",
                    "description": "End date in YYYY-MM-DD format."
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "account_id",
                  "date_start",
                  "date_end",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_list_ad_accounts": {
      "post": {
        "operationId": "reddit_ads_list_ad_accounts",
        "summary": "List Reddit Ad Accounts",
        "description": "List Reddit ad accounts accessible to the authenticated user.",
        "tags": [
          "ad-accounts"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "description": "Fetch a single ad account by ID."
                  },
                  "account_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 50,
                    "description": "Fetch specific accounts by IDs."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 20
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Opaque pagination cursor."
                  },
                  "refresh": {
                    "type": "boolean",
                    "default": false
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_list_ad_groups": {
      "post": {
        "operationId": "reddit_ads_list_ad_groups",
        "summary": "List Reddit Ad Groups",
        "description": "List Reddit ad groups for an ad account. Shows targeting, bid strategy, and campaign association.",
        "tags": [
          "ad-groups"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reddit ad account ID."
                  },
                  "ad_group_id": {
                    "type": "string",
                    "description": "Fetch a single ad group by ID."
                  },
                  "ad_group_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 50,
                    "description": "Fetch specific ad groups by IDs."
                  },
                  "campaign_id": {
                    "type": "string",
                    "description": "Filter by parent campaign ID."
                  },
                  "status": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "PAUSED",
                        "ARCHIVED"
                      ]
                    },
                    "description": "Filter by status."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 20
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Opaque pagination cursor."
                  },
                  "refresh": {
                    "type": "boolean",
                    "default": false
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "account_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_list_ads": {
      "post": {
        "operationId": "reddit_ads_list_ads",
        "summary": "List Reddit Ads",
        "description": "List Reddit ads for an ad account. Shows creative type, headline, click URL, and status.",
        "tags": [
          "ads"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reddit ad account ID."
                  },
                  "ad_id": {
                    "type": "string",
                    "description": "Fetch a single ad by ID."
                  },
                  "ad_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 50,
                    "description": "Fetch specific ads by IDs."
                  },
                  "ad_group_id": {
                    "type": "string",
                    "description": "Filter by parent ad group ID."
                  },
                  "status": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "PAUSED",
                        "ARCHIVED"
                      ]
                    },
                    "description": "Filter by status."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 20
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Opaque pagination cursor."
                  },
                  "refresh": {
                    "type": "boolean",
                    "default": false
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "account_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_check_auth_status": {
      "post": {
        "operationId": "reddit_ads_check_auth_status",
        "summary": "Check Reddit Ads Authentication Status",
        "description": "Troubleshoot authentication issues and get user profile info. Only use when another tool fails with a permission or authentication error — do NOT call proactively.",
        "tags": [
          "auth"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_list_campaigns": {
      "post": {
        "operationId": "reddit_ads_list_campaigns",
        "summary": "List Reddit Campaigns",
        "description": "List Reddit ad campaigns for an ad account. Shows name, status, objective, and budget information.",
        "tags": [
          "campaigns"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reddit ad account ID."
                  },
                  "campaign_id": {
                    "type": "string",
                    "description": "Fetch a single campaign by ID."
                  },
                  "campaign_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 50,
                    "description": "Fetch specific campaigns by IDs."
                  },
                  "status": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "ACTIVE",
                        "PAUSED",
                        "ARCHIVED"
                      ]
                    },
                    "description": "Filter by status."
                  },
                  "search": {
                    "type": "string",
                    "description": "Search by campaign name (case-insensitive)."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 20
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Opaque pagination cursor."
                  },
                  "refresh": {
                    "type": "boolean",
                    "default": false
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "account_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_render_chart": {
      "post": {
        "operationId": "reddit_ads_render_chart",
        "summary": "Render Chart",
        "description": "Interactive UI for rendering data visualization charts",
        "tags": [
          "chart"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Brief explanation of why you are rendering this chart"
                  },
                  "chart": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "bar"
                          },
                          "data": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "values": {
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "label",
                                "values"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "metric": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "field": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "format": {
                                    "type": "string"
                                  },
                                  "tickFormat": {
                                    "type": "string"
                                  },
                                  "labelFields": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "field": {
                                          "type": "string"
                                        },
                                        "format": {
                                          "type": "string"
                                        },
                                        "suffix": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "field"
                                      ],
                                      "additionalProperties": false
                                    }
                                  }
                                },
                                "required": [
                                  "field",
                                  "label"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "format": {
                                      "type": "string"
                                    },
                                    "tickFormat": {
                                      "type": "string"
                                    },
                                    "labelFields": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "field": {
                                            "type": "string"
                                          },
                                          "format": {
                                            "type": "string"
                                          },
                                          "suffix": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "field"
                                        ],
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            ]
                          },
                          "orientation": {
                            "type": "string",
                            "enum": [
                              "horizontal",
                              "vertical"
                            ],
                            "default": "horizontal"
                          },
                          "sort": {
                            "type": "string",
                            "enum": [
                              "asc",
                              "desc",
                              "none"
                            ],
                            "default": "desc"
                          },
                          "colorBy": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "fixed"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "threshold"
                                  },
                                  "field": {
                                    "type": "string"
                                  },
                                  "threshold": {
                                    "type": "number"
                                  },
                                  "sentiment": {
                                    "type": "string",
                                    "enum": [
                                      "above-positive",
                                      "above-negative"
                                    ],
                                    "default": "above-positive"
                                  }
                                },
                                "required": [
                                  "type",
                                  "field",
                                  "threshold"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "continuous"
                                  },
                                  "field": {
                                    "type": "string"
                                  },
                                  "scheme": {
                                    "type": "string"
                                  },
                                  "reverse": {
                                    "type": "boolean",
                                    "default": false
                                  },
                                  "muteZero": {
                                    "type": "boolean",
                                    "default": false
                                  },
                                  "label": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "field",
                                  "scheme"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "categorical"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "referenceLines": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "type": "number"
                                },
                                "label": {
                                  "type": "string"
                                },
                                "dash": {
                                  "type": "string",
                                  "enum": [
                                    "solid",
                                    "dashed"
                                  ],
                                  "default": "dashed"
                                }
                              },
                              "required": [
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "table": {
                            "type": "object",
                            "properties": {
                              "columns": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "format": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "columns"
                            ],
                            "additionalProperties": false
                          },
                          "panelWidth": {
                            "type": "number"
                          },
                          "width": {
                            "type": "number",
                            "default": 700
                          },
                          "height": {
                            "type": "number",
                            "default": 400
                          }
                        },
                        "required": [
                          "type",
                          "data",
                          "metric"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "scatter"
                          },
                          "data": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "values": {
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": "number"
                                  }
                                }
                              },
                              "required": [
                                "label",
                                "values"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "x": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "scale": {
                                "type": "string",
                                "enum": [
                                  "linear",
                                  "log"
                                ],
                                "default": "linear"
                              },
                              "format": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "field",
                              "label"
                            ],
                            "additionalProperties": false
                          },
                          "y": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "scale": {
                                "type": "string",
                                "enum": [
                                  "linear",
                                  "log"
                                ],
                                "default": "linear"
                              },
                              "format": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "field",
                              "label"
                            ],
                            "additionalProperties": false
                          },
                          "size": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "range": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                },
                                "minItems": 2,
                                "maxItems": 2,
                                "default": [
                                  3,
                                  20
                                ]
                              }
                            },
                            "required": [
                              "field"
                            ],
                            "additionalProperties": false
                          },
                          "color": {
                            "anyOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "fixed"
                                  }
                                },
                                "required": [
                                  "type"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "continuous"
                                  },
                                  "field": {
                                    "type": "string"
                                  },
                                  "scheme": {
                                    "type": "string"
                                  },
                                  "reverse": {
                                    "type": "boolean",
                                    "default": false
                                  }
                                },
                                "required": [
                                  "type",
                                  "field",
                                  "scheme"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "threshold"
                                  },
                                  "field": {
                                    "type": "string"
                                  },
                                  "threshold": {
                                    "type": "number"
                                  },
                                  "sentiment": {
                                    "type": "string",
                                    "enum": [
                                      "above-positive",
                                      "above-negative"
                                    ],
                                    "default": "above-positive"
                                  }
                                },
                                "required": [
                                  "type",
                                  "field",
                                  "threshold"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          },
                          "referenceLines": {
                            "type": "object",
                            "properties": {
                              "medianX": {
                                "type": "boolean",
                                "default": false
                              },
                              "medianY": {
                                "type": "boolean",
                                "default": false
                              },
                              "targets": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "slope": {
                                      "type": "number"
                                    },
                                    "label": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "slope",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "regression": {
                                "type": "boolean",
                                "default": false
                              }
                            },
                            "additionalProperties": false
                          },
                          "table": {
                            "type": "object",
                            "properties": {
                              "columns": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "format": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "columns"
                            ],
                            "additionalProperties": false
                          },
                          "width": {
                            "type": "number",
                            "default": 700
                          },
                          "height": {
                            "type": "number",
                            "default": 450
                          }
                        },
                        "required": [
                          "type",
                          "data",
                          "x",
                          "y"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "timeseries"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "current": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "date": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "object",
                                      "additionalProperties": {
                                        "type": "number"
                                      }
                                    }
                                  },
                                  "required": [
                                    "date",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "previous": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "date": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "object",
                                      "additionalProperties": {
                                        "type": "number"
                                      }
                                    }
                                  },
                                  "required": [
                                    "date",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                }
                              },
                              "projection": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "date": {
                                      "type": "string"
                                    },
                                    "values": {
                                      "type": "object",
                                      "additionalProperties": {
                                        "type": "number"
                                      }
                                    }
                                  },
                                  "required": [
                                    "date",
                                    "values"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "current"
                            ],
                            "additionalProperties": false
                          },
                          "primaryAxis": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "mark": {
                                "type": "string",
                                "enum": [
                                  "bar",
                                  "area",
                                  "line"
                                ]
                              },
                              "groupBars": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "field",
                              "label",
                              "mark"
                            ],
                            "additionalProperties": false
                          },
                          "secondaryAxis": {
                            "type": "object",
                            "properties": {
                              "field": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "dash": {
                                "type": "string",
                                "enum": [
                                  "solid",
                                  "dashed"
                                ],
                                "default": "solid"
                              }
                            },
                            "required": [
                              "field",
                              "label"
                            ],
                            "additionalProperties": false
                          },
                          "width": {
                            "type": "number",
                            "default": 700
                          },
                          "height": {
                            "type": "number",
                            "default": 400
                          }
                        },
                        "required": [
                          "type",
                          "data",
                          "primaryAxis"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "funnel"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "stages": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "volume": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                }
                              },
                              "costPer": {
                                "type": "array",
                                "items": {
                                  "type": "number"
                                }
                              }
                            },
                            "required": [
                              "stages",
                              "volume"
                            ],
                            "additionalProperties": false
                          },
                          "showConversionRates": {
                            "type": "boolean",
                            "default": true
                          },
                          "showCostPer": {
                            "type": "boolean",
                            "default": true
                          },
                          "colorScheme": {
                            "type": "string",
                            "default": "Blues"
                          },
                          "width": {
                            "type": "number",
                            "default": 700
                          },
                          "height": {
                            "type": "number",
                            "default": 350
                          }
                        },
                        "required": [
                          "type",
                          "data"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "waterfall"
                          },
                          "data": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "label": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "number"
                                },
                                "colorValue": {
                                  "type": "number"
                                }
                              },
                              "required": [
                                "label",
                                "value",
                                "colorValue"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "colorScheme": {
                            "type": "string",
                            "default": "RdYlGn"
                          },
                          "colorLabel": {
                            "type": "string",
                            "default": "CPA ($)"
                          },
                          "valueLabel": {
                            "type": "string",
                            "default": "Cumulative Spend ($)"
                          },
                          "width": {
                            "type": "number",
                            "default": 700
                          },
                          "height": {
                            "type": "number"
                          }
                        },
                        "required": [
                          "type",
                          "data"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "const": "choropleth"
                          },
                          "data": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "state": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "number"
                                },
                                "meta": {
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": [
                                      "string",
                                      "number",
                                      "null"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "state",
                                "value"
                              ],
                              "additionalProperties": false
                            }
                          },
                          "valueLabel": {
                            "type": "string"
                          },
                          "colorScheme": {
                            "type": "string",
                            "default": "YlOrRd"
                          },
                          "colorType": {
                            "type": "string",
                            "enum": [
                              "quantize",
                              "linear",
                              "threshold"
                            ],
                            "default": "quantize"
                          },
                          "reverse": {
                            "type": "boolean",
                            "default": false
                          },
                          "tip": {
                            "type": "object",
                            "properties": {
                              "fields": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "type": "string"
                                    },
                                    "label": {
                                      "type": "string"
                                    },
                                    "format": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "label"
                                  ],
                                  "additionalProperties": false
                                }
                              }
                            },
                            "required": [
                              "fields"
                            ],
                            "additionalProperties": false
                          },
                          "width": {
                            "type": "number",
                            "default": 700
                          },
                          "height": {
                            "type": "number",
                            "default": 450
                          }
                        },
                        "required": [
                          "type",
                          "data",
                          "valueLabel"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "reason",
                  "chart"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        },
        "x-mcp-tool-type": "app",
        "x-mcp-chart-types": [
          "bar",
          "scatter",
          "timeseries",
          "funnel",
          "waterfall",
          "choropleth"
        ]
      }
    },
    "/tools/reddit_ads_list_custom_audiences": {
      "post": {
        "operationId": "reddit_ads_list_custom_audiences",
        "summary": "List Reddit Custom Audiences",
        "description": "List Reddit custom audiences for an ad account. Shows name, type, size, and status.",
        "tags": [
          "custom-audiences"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reddit ad account ID."
                  },
                  "audience_id": {
                    "type": "string",
                    "description": "Fetch a single custom audience by ID."
                  },
                  "audience_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 50,
                    "description": "Fetch specific audiences by IDs."
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100,
                    "default": 20
                  },
                  "cursor": {
                    "type": "string",
                    "description": "Opaque pagination cursor."
                  },
                  "refresh": {
                    "type": "boolean",
                    "default": false
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "account_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_developer_feedback": {
      "post": {
        "operationId": "reddit_ads_developer_feedback",
        "summary": "Submit Developer Feedback",
        "description": "Submit feedback about missing tools, improvements, bugs, or workflow gaps in the Reddit Ads MCP toolset. Not for user-facing issues like auth or API errors.",
        "tags": [
          "feedback"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "feedback_type": {
                    "type": "string",
                    "enum": [
                      "new_tool",
                      "improvement",
                      "bug",
                      "workflow_gap"
                    ],
                    "description": "Feedback category: new_tool (request new capability), improvement (enhance existing tool), bug (report issue), workflow_gap (missing workflow)"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 200,
                    "description": "Concise title summarizing the feedback"
                  },
                  "description": {
                    "type": "string",
                    "minLength": 20,
                    "maxLength": 2000,
                    "description": "What is needed and why"
                  },
                  "current_workaround": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Current workaround, if any"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ],
                    "default": "medium",
                    "description": "Impact level: low (nice-to-have), medium (improves workflow), high (blocking issue)"
                  },
                  "interface": {
                    "type": "string",
                    "enum": [
                      "MCP",
                      "CLI"
                    ],
                    "default": "MCP",
                    "description": "Interface the feedback originated from: MCP (default) or CLI"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "feedback_type",
                  "title",
                  "description",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "missing-tool": {
                  "summary": "Missing tool",
                  "value": {
                    "feedback_type": "new_tool",
                    "title": "Bulk ad group status toggle",
                    "description": "Need to pause/enable multiple ad groups at once rather than one by one",
                    "priority": "high",
                    "reason": "User asked to pause 10 ad groups individually"
                  }
                },
                "workflow-gap": {
                  "summary": "Workflow gap",
                  "value": {
                    "feedback_type": "workflow_gap",
                    "title": "Campaign cloning with ad groups",
                    "description": "No way to duplicate a campaign including all ad groups and ads",
                    "current_workaround": "Read and recreate each level one by one",
                    "reason": "User wanted to duplicate campaign structure"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_ping": {
      "post": {
        "operationId": "reddit_ads_ping",
        "summary": "Ping Reddit Ads MCP Server",
        "description": "Health check for the Reddit Ads MCP server.",
        "tags": [
          "auth"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "message": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "Optional message to echo back"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "health-check": {
                  "summary": "Health check",
                  "value": {
                    "reason": "Verify server is running"
                  }
                },
                "with-message": {
                  "summary": "With message",
                  "value": {
                    "message": "hello",
                    "reason": "Test connectivity"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_store_preference": {
      "post": {
        "operationId": "reddit_ads_store_preference",
        "summary": "Store Reddit Ads Preference",
        "description": "Store a persistent preference for a Reddit ad entity. Use when you infer a recurring preference about analysis, reporting, or management. Updates existing keys.",
        "tags": [
          "preferences"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity_type": {
                    "type": "string",
                    "enum": [
                      "ad_account",
                      "campaign",
                      "ad_set",
                      "ad"
                    ],
                    "description": "Type of ad entity: ad_account, campaign, ad_set (Meta ad sets / Google ad groups), or ad"
                  },
                  "entity_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The platform entity ID (e.g. act_123456, 23842453456789)"
                  },
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100,
                    "description": "Preference key (e.g. preferred_conversion_metric, budget_alert_threshold)"
                  },
                  "value": {
                    "description": "Preference value — string, number, boolean, or JSON object"
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "agent",
                      "user",
                      "system"
                    ],
                    "default": "agent",
                    "description": "Who set this preference: agent (default), user, or system"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Optional context about why this preference was set"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "entity_type",
                  "entity_id",
                  "key",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "set-metric": {
                  "summary": "Set metric",
                  "value": {
                    "entity_type": "ad_account",
                    "entity_id": "t2_123",
                    "key": "preferred_conversion_metric",
                    "value": "ROAS",
                    "reason": "User wants ROAS as default metric"
                  }
                },
                "set-threshold": {
                  "summary": "Set threshold",
                  "value": {
                    "entity_type": "campaign",
                    "entity_id": "456",
                    "key": "budget_alert_threshold",
                    "value": 0.8,
                    "reason": "Alert at 80% budget"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_get_preferences": {
      "post": {
        "operationId": "reddit_ads_get_preferences",
        "summary": "Get Reddit Ads Preferences",
        "description": "Get all stored preferences for a Reddit ad entity. Preferences are also auto-attached to list tool responses as _stored_preferences.",
        "tags": [
          "preferences"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity_type": {
                    "type": "string",
                    "enum": [
                      "ad_account",
                      "campaign",
                      "ad_set",
                      "ad"
                    ],
                    "description": "Type of ad entity: ad_account, campaign, ad_set, or ad"
                  },
                  "entity_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The platform entity ID"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "entity_type",
                  "entity_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "get-prefs": {
                  "summary": "Get prefs",
                  "value": {
                    "entity_type": "ad_account",
                    "entity_id": "t2_123",
                    "reason": "Check stored preferences"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_delete_preference": {
      "post": {
        "operationId": "reddit_ads_delete_preference",
        "summary": "Delete Reddit Ads Preference",
        "description": "Delete a stored preference by key. No-op if it doesn't exist.",
        "tags": [
          "preferences"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "destructiveHint": true,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity_type": {
                    "type": "string",
                    "enum": [
                      "ad_account",
                      "campaign",
                      "ad_set",
                      "ad"
                    ],
                    "description": "Type of ad entity: ad_account, campaign, ad_set, or ad"
                  },
                  "entity_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The platform entity ID"
                  },
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "description": "The preference key to delete"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "entity_type",
                  "entity_id",
                  "key",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "delete-pref": {
                  "summary": "Delete pref",
                  "value": {
                    "entity_type": "campaign",
                    "entity_id": "456",
                    "key": "budget_alert_threshold",
                    "reason": "User no longer wants budget alerts"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Markdown-formatted result with structured content",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    },
    "/tools/reddit_ads_get_performance_report": {
      "post": {
        "operationId": "reddit_ads_get_performance_report",
        "summary": "Get Reddit Ads Performance Report",
        "description": "Get a performance report for a Reddit ad account over a date range, with optional breakdowns and entity filters.",
        "tags": [
          "reporting"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": true
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Reddit ad account ID."
                  },
                  "campaign_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Filter to specific campaign IDs."
                  },
                  "ad_group_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Filter to specific ad group IDs."
                  },
                  "ad_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Filter to specific ad IDs."
                  },
                  "date_start": {
                    "type": "string",
                    "description": "Start date in YYYY-MM-DD format."
                  },
                  "date_end": {
                    "type": "string",
                    "description": "End date in YYYY-MM-DD format."
                  },
                  "breakdown": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "campaign",
                        "ad_group",
                        "ad",
                        "community",
                        "date",
                        "country",
                        "region",
                        "placement",
                        "device_os"
                      ]
                    },
                    "maxItems": 3,
                    "description": "Up to 3 breakdown dimensions. \"community\" shows subreddit-level data."
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "account_id",
                  "date_start",
                  "date_end",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON report data",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpToolResult"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpError"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          },
          "422": {
            "description": "Invalid parameters — request body failed schema validation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Supabase JWT or hpk_live_... API key"
      }
    },
    "schemas": {
      "McpToolResult": {
        "type": "object",
        "properties": {
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "enum": [
                    "text",
                    "resource_link"
                  ]
                },
                "text": {
                  "type": "string"
                }
              }
            }
          },
          "structuredContent": {
            "type": "object",
            "additionalProperties": true
          },
          "isError": {
            "type": "boolean"
          }
        }
      },
      "McpError": {
        "type": "object",
        "properties": {
          "isError": {
            "type": "boolean",
            "const": true
          },
          "content": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "const": "text"
                },
                "text": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "RestError": {
        "type": "object",
        "description": "Error response from REST tool endpoints (mapped from JSON-RPC error codes)",
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable error message"
          },
          "code": {
            "type": "integer",
            "description": "JSON-RPC error code"
          },
          "data": {
            "description": "Additional error context"
          }
        },
        "required": [
          "error",
          "code"
        ]
      },
      "ToolList": {
        "type": "object",
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "inputSchema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "discovery",
      "description": "Tool discovery and introspection"
    },
    {
      "name": "account-summary",
      "description": "Account-summary tools"
    },
    {
      "name": "ad-accounts",
      "description": "Ad-accounts tools"
    },
    {
      "name": "ad-groups",
      "description": "Ad-groups tools"
    },
    {
      "name": "ads",
      "description": "Ads tools"
    },
    {
      "name": "auth",
      "description": "Auth tools"
    },
    {
      "name": "campaigns",
      "description": "Campaigns tools"
    },
    {
      "name": "chart",
      "description": "Chart tools"
    },
    {
      "name": "custom-audiences",
      "description": "Custom-audiences tools"
    },
    {
      "name": "feedback",
      "description": "Feedback tools"
    },
    {
      "name": "preferences",
      "description": "Preferences tools"
    },
    {
      "name": "reporting",
      "description": "Reporting tools"
    }
  ]
}