{
  "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, with optional conversion metrics such as sign-ups, leads, purchases, CPA, value, and ROAS.",
        "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."
                  },
                  "metrics": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 40,
                    "description": "Optional summary metrics. Defaults to impressions, clicks, spend, ecpm, ctr, cpc. Conversion examples: signup_total, lead_total, purchase_total, conversion_purchase_roas."
                  },
                  "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_connections": {
      "post": {
        "operationId": "reddit_ads_list_connections",
        "summary": "List Reddit Connections",
        "description": "List the Reddit Ads connections available to you — both ones you own and ones shared with you via an organization. Use this to discover connection IDs for set_default / share / rename / revoke.",
        "tags": [
          "connections"
        ],
        "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": "Why this tool call is needed"
                  }
                },
                "required": [
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "list-connections": {
                  "summary": "List connections",
                  "value": {
                    "reason": "User asked which Reddit accounts they have connected"
                  }
                }
              }
            }
          }
        },
        "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_set_default_connection": {
      "post": {
        "operationId": "reddit_ads_set_default_connection",
        "summary": "Set Default Reddit Connection",
        "description": "Set the Reddit connection that should be used by default for subsequent Reddit Ads tool calls. The default is scoped to the calling actor (your user account, or the API key being used).",
        "tags": [
          "set-default-connection"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": true,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connection_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the connection to mark as the actor's default Reddit connection."
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "connection_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "set-default": {
                  "summary": "Set default",
                  "value": {
                    "connection_id": "00000000-0000-0000-0000-000000000001",
                    "reason": "User picked their primary Reddit workspace"
                  }
                }
              }
            }
          }
        },
        "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_share_connection": {
      "post": {
        "operationId": "reddit_ads_share_connection",
        "summary": "Share Reddit Connection With Organization",
        "description": "Share an owned Reddit connection with all members of your organization, so teammates can use it without having to reconnect Reddit themselves. You must be the owner of the connection.",
        "tags": [
          "share-connection"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connection_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the connection to share with your organization. You must be the owner."
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "connection_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "share-with-org": {
                  "summary": "Share with org",
                  "value": {
                    "connection_id": "00000000-0000-0000-0000-000000000001",
                    "reason": "User asked to share this Reddit connection with their teammates"
                  }
                }
              }
            }
          }
        },
        "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_unshare_connection": {
      "post": {
        "operationId": "reddit_ads_unshare_connection",
        "summary": "Unshare Reddit Connection From Organization",
        "description": "Stop sharing an owned Reddit connection with your organization. Teammates lose access immediately. You must be the owner.",
        "tags": [
          "unshare-connection"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "destructiveHint": true,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connection_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the connection to stop sharing with your organization. You must be the owner."
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "connection_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "stop-sharing": {
                  "summary": "Stop sharing",
                  "value": {
                    "connection_id": "00000000-0000-0000-0000-000000000001",
                    "reason": "User no longer wants the team to access this Reddit connection"
                  }
                }
              }
            }
          }
        },
        "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_rename_connection": {
      "post": {
        "operationId": "reddit_ads_rename_connection",
        "summary": "Rename Reddit Connection",
        "description": "Rename the display name of an owned Reddit connection. The OAuth grant and underlying account are unaffected — this only changes the human-readable label. You must be the owner.",
        "tags": [
          "rename-connection"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "destructiveHint": false,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connection_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the connection to rename. You must be the owner."
                  },
                  "display_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "description": "New human-readable name for the connection."
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "connection_id",
                  "display_name",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "rename": {
                  "summary": "Rename",
                  "value": {
                    "connection_id": "00000000-0000-0000-0000-000000000001",
                    "display_name": "Acme — Production",
                    "reason": "User wanted a clearer label for this Reddit connection"
                  }
                }
              }
            }
          }
        },
        "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_revoke_connection": {
      "post": {
        "operationId": "reddit_ads_revoke_connection",
        "summary": "Revoke Reddit Connection",
        "description": "Revoke (soft-delete) an owned Reddit connection. Any defaults pointing to it are invalidated and shared org members lose access. The OAuth grant at Reddit is NOT revoked by this tool — the user must disconnect via the dashboard if they want to fully revoke at Reddit. You must be the owner.",
        "tags": [
          "revoke-connection"
        ],
        "x-mcp-annotations": {
          "readOnlyHint": false,
          "destructiveHint": true,
          "idempotentHint": true,
          "openWorldHint": false
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connection_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "UUID of the connection to revoke. You must be the owner."
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500,
                    "description": "Why this tool call is needed"
                  }
                },
                "required": [
                  "connection_id",
                  "reason"
                ],
                "additionalProperties": false,
                "$schema": "http://json-schema.org/draft-07/schema#"
              },
              "examples": {
                "revoke": {
                  "summary": "Revoke",
                  "value": {
                    "connection_id": "00000000-0000-0000-0000-000000000001",
                    "reason": "User asked to disconnect this Reddit account"
                  }
                }
              }
            }
          }
        },
        "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_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_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, entity filters, and opt-in conversion metrics such as sign-ups, leads, purchases, CPA, value, and ROAS.",
        "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."
                  },
                  "metrics": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1,
                    "maxItems": 40,
                    "description": "Optional report metrics. Defaults to impressions, clicks, spend, ecpm, ctr, cpc. Conversion examples: signup_total, lead_total, purchase_total, conversion_purchase_roas."
                  },
                  "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": "connections",
      "description": "Connections tools"
    },
    {
      "name": "custom-audiences",
      "description": "Custom-audiences tools"
    },
    {
      "name": "feedback",
      "description": "Feedback tools"
    },
    {
      "name": "rename-connection",
      "description": "Rename-connection tools"
    },
    {
      "name": "reporting",
      "description": "Reporting tools"
    },
    {
      "name": "revoke-connection",
      "description": "Revoke-connection tools"
    },
    {
      "name": "set-default-connection",
      "description": "Set-default-connection tools"
    },
    {
      "name": "share-connection",
      "description": "Share-connection tools"
    },
    {
      "name": "unshare-connection",
      "description": "Unshare-connection tools"
    }
  ]
}