{
  "openapi": "3.1.0",
  "info": {
    "title": "Lessly REST API",
    "description": "Generated from the Lessly platform tool catalog — the same source as the MCP tools reference, so the two surfaces describe the same operations. Every endpoint names the MCP tool it is bound to in `x-mcp-tool`. Do not edit by hand: pipeline/run.mjs rewrites this file on every catalog change.",
    "version": "6707f56999a5cdea4a0a6e3de0be3ba0e5d053a2b12b88b7c30ece2821bd1b5a"
  },
  "x-catalog-version": "6707f56999a5cdea4a0a6e3de0be3ba0e5d053a2b12b88b7c30ece2821bd1b5a",
  "servers": [
    {
      "url": "https://api.lessly.com"
    }
  ],
  "tags": [
    {
      "name": "Analytics",
      "description": "REST endpoints for the Analytics area of Lessly."
    },
    {
      "name": "Brain",
      "description": "REST endpoints for the Brain area of Lessly."
    },
    {
      "name": "Consent",
      "description": "REST endpoints for the Consent area of Lessly."
    },
    {
      "name": "Content",
      "description": "REST endpoints for the Content area of Lessly."
    },
    {
      "name": "Deployment",
      "description": "REST endpoints for the Deployment area of Lessly."
    },
    {
      "name": "Mail",
      "description": "REST endpoints for the Mail area of Lessly."
    },
    {
      "name": "Observe",
      "description": "REST endpoints for the Observe area of Lessly."
    },
    {
      "name": "Organization",
      "description": "REST endpoints for the Organization area of Lessly."
    },
    {
      "name": "Realtime",
      "description": "REST endpoints for the Realtime area of Lessly."
    },
    {
      "name": "Support",
      "description": "REST endpoints for the Support area of Lessly."
    },
    {
      "name": "Tracking",
      "description": "REST endpoints for the Tracking area of Lessly."
    },
    {
      "name": "Users",
      "description": "REST endpoints for the Users area of Lessly."
    },
    {
      "name": "Waitlist",
      "description": "REST endpoints for the Waitlist area of Lessly."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/analytics/catalog": {
      "get": {
        "operationId": "analytics_catalog_get",
        "summary": "Read the analytics semantic catalog: every entity this product may chart, with its declared metrics, dimensions and person-graph identity kinds.",
        "description": "Read the analytics semantic catalog: every entity this product may chart, with its declared metrics, dimensions and person-graph identity kinds. Call this FIRST to discover the exact `entity`, `metric` and `dimension` names analytics_metric_query and analytics_funnel_run accept — those names are resolved against this catalog and a name that is not in it is rejected.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_catalog_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "product_id",
                    "generated_at",
                    "cycle",
                    "entities"
                  ],
                  "properties": {
                    "cycle": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "to": {
                              "type": "string"
                            },
                            "from": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "entity",
                          "extensionSlug",
                          "entityName",
                          "description",
                          "timeColumn",
                          "dimensions",
                          "metrics",
                          "identityKinds",
                          "propertiesColumn"
                        ],
                        "properties": {
                          "entity": {
                            "type": "string"
                          },
                          "metrics": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "name",
                                "type",
                                "description"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "count",
                                    "sum",
                                    "avg",
                                    "ratio"
                                  ]
                                },
                                "description": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "dimensions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "name",
                                "description"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "description": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "entityName": {
                            "type": "string"
                          },
                          "timeColumn": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "description": {
                            "type": "string"
                          },
                          "extensionSlug": {
                            "type": "string"
                          },
                          "identityKinds": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "email",
                                "phone",
                                "users_id",
                                "anonymous_id"
                              ]
                            }
                          },
                          "propertiesColumn": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "product_id": {
                      "type": "string"
                    },
                    "generated_at": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/dashboards": {
      "get": {
        "operationId": "analytics_dashboard_list",
        "summary": "List the saved dashboards of the current product, newest first.",
        "description": "List the saved dashboards of the current product, newest first. Narrow by an exact tag or by a case-insensitive substring of the name or slug. Returns definitions, not results.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_dashboard_list",
        "parameters": [
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Exact tag the dashboard must carry",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring of the name or slug",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dashboards"
                  ],
                  "properties": {
                    "dashboards": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "slug",
                          "name",
                          "tiles",
                          "id",
                          "product_id",
                          "created_by",
                          "created_at",
                          "updated_at"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "slug": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                          },
                          "tags": {
                            "type": "array",
                            "default": [],
                            "maxItems": 20,
                            "items": {
                              "type": "string",
                              "maxLength": 40
                            }
                          },
                          "tiles": {
                            "type": "array",
                            "maxItems": 40,
                            "items": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "id",
                                    "layout",
                                    "type",
                                    "insight_id"
                                  ],
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "type": {
                                      "type": "string",
                                      "const": "insight"
                                    },
                                    "title": {
                                      "default": null,
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 120
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "layout": {
                                      "type": "object",
                                      "required": [
                                        "x",
                                        "y",
                                        "w",
                                        "h"
                                      ],
                                      "properties": {
                                        "h": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 12
                                        },
                                        "w": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 12
                                        },
                                        "x": {
                                          "type": "integer",
                                          "minimum": 0
                                        },
                                        "y": {
                                          "type": "integer",
                                          "minimum": 0
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "insight_id": {
                                      "type": "string",
                                      "format": "uuid"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "id",
                                    "layout",
                                    "type",
                                    "markdown"
                                  ],
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "type": {
                                      "type": "string",
                                      "const": "text"
                                    },
                                    "title": {
                                      "default": null,
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "maxLength": 120
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "layout": {
                                      "type": "object",
                                      "required": [
                                        "x",
                                        "y",
                                        "w",
                                        "h"
                                      ],
                                      "properties": {
                                        "h": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 12
                                        },
                                        "w": {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 12
                                        },
                                        "x": {
                                          "type": "integer",
                                          "minimum": 0
                                        },
                                        "y": {
                                          "type": "integer",
                                          "minimum": 0
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    "markdown": {
                                      "type": "string",
                                      "maxLength": 4000
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            }
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "created_by": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "product_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "analytics_dashboard_create",
        "summary": "Save a named dashboard for the current product: up to forty tiles, each either a reference to a saved insight by its uuid (from analytics_insight_list) or a block of markdown, each placed on a twelve-column grid.",
        "description": "Save a named dashboard for the current product: up to forty tiles, each either a reference to a saved insight by its uuid (from analytics_insight_list) or a block of markdown, each placed on a twelve-column grid. The slug is the address the dashboard is read by and cannot be changed later. Stores the arrangement only; it does not run it. Every insight a tile names must already exist in this product, so a stored dashboard always resolves.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_dashboard_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "tiles": {
                    "type": "array",
                    "maxItems": 40,
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "layout",
                            "type",
                            "insight_id"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "const": "insight"
                            },
                            "title": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "layout": {
                              "type": "object",
                              "required": [
                                "x",
                                "y",
                                "w",
                                "h"
                              ],
                              "properties": {
                                "h": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 12
                                },
                                "w": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 12
                                },
                                "x": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "y": {
                                  "type": "integer",
                                  "minimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "insight_id": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "layout",
                            "type",
                            "markdown"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "const": "text"
                            },
                            "title": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "layout": {
                              "type": "object",
                              "required": [
                                "x",
                                "y",
                                "w",
                                "h"
                              ],
                              "properties": {
                                "h": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 12
                                },
                                "w": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 12
                                },
                                "x": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "y": {
                                  "type": "integer",
                                  "minimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "markdown": {
                              "type": "string",
                              "maxLength": 4000
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "tags": {
                    "type": "array",
                    "default": [],
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 40
                    }
                  }
                },
                "required": [
                  "slug",
                  "name",
                  "tiles"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "slug",
                    "name",
                    "tiles",
                    "id",
                    "product_id",
                    "created_by",
                    "created_at",
                    "updated_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "slug": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                    },
                    "tags": {
                      "type": "array",
                      "default": [],
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "maxLength": 40
                      }
                    },
                    "tiles": {
                      "type": "array",
                      "maxItems": 40,
                      "items": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "layout",
                              "type",
                              "insight_id"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "type": {
                                "type": "string",
                                "const": "insight"
                              },
                              "title": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "layout": {
                                "type": "object",
                                "required": [
                                  "x",
                                  "y",
                                  "w",
                                  "h"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "w": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "x": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "y": {
                                    "type": "integer",
                                    "minimum": 0
                                  }
                                },
                                "additionalProperties": false
                              },
                              "insight_id": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "layout",
                              "type",
                              "markdown"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "type": {
                                "type": "string",
                                "const": "text"
                              },
                              "title": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "layout": {
                                "type": "object",
                                "required": [
                                  "x",
                                  "y",
                                  "w",
                                  "h"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "w": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "x": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "y": {
                                    "type": "integer",
                                    "minimum": 0
                                  }
                                },
                                "additionalProperties": false
                              },
                              "markdown": {
                                "type": "string",
                                "maxLength": 4000
                              }
                            },
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "product_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/dashboards/{id}": {
      "delete": {
        "operationId": "analytics_dashboard_delete",
        "summary": "Permanently delete one saved dashboard of the current product.",
        "description": "Permanently delete one saved dashboard of the current product. The insights its tiles referred to are not deleted.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_dashboard_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dashboard's uuid; slugs are not accepted here",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "analytics_dashboard_update",
        "summary": "Change fields of a saved dashboard of the current product.",
        "description": "Change fields of a saved dashboard of the current product. Only the fields supplied are changed; the rest keep their stored values. Supplying tiles replaces the whole arrangement, so send the tiles you want to keep along with the new ones. The slug cannot be changed — create a new dashboard instead.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_dashboard_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The dashboard's uuid; slugs are not accepted here",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "tiles": {
                    "type": "array",
                    "maxItems": 40,
                    "items": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "layout",
                            "type",
                            "insight_id"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "const": "insight"
                            },
                            "title": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "layout": {
                              "type": "object",
                              "required": [
                                "x",
                                "y",
                                "w",
                                "h"
                              ],
                              "properties": {
                                "h": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 12
                                },
                                "w": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 12
                                },
                                "x": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "y": {
                                  "type": "integer",
                                  "minimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "insight_id": {
                              "type": "string",
                              "format": "uuid"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "layout",
                            "type",
                            "markdown"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "type": {
                              "type": "string",
                              "const": "text"
                            },
                            "title": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 120
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "layout": {
                              "type": "object",
                              "required": [
                                "x",
                                "y",
                                "w",
                                "h"
                              ],
                              "properties": {
                                "h": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 12
                                },
                                "w": {
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 12
                                },
                                "x": {
                                  "type": "integer",
                                  "minimum": 0
                                },
                                "y": {
                                  "type": "integer",
                                  "minimum": 0
                                }
                              },
                              "additionalProperties": false
                            },
                            "markdown": {
                              "type": "string",
                              "maxLength": 4000
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    }
                  },
                  "tags": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 40
                    }
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "slug",
                    "name",
                    "tiles",
                    "id",
                    "product_id",
                    "created_by",
                    "created_at",
                    "updated_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "slug": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                    },
                    "tags": {
                      "type": "array",
                      "default": [],
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "maxLength": 40
                      }
                    },
                    "tiles": {
                      "type": "array",
                      "maxItems": 40,
                      "items": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "layout",
                              "type",
                              "insight_id"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "type": {
                                "type": "string",
                                "const": "insight"
                              },
                              "title": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "layout": {
                                "type": "object",
                                "required": [
                                  "x",
                                  "y",
                                  "w",
                                  "h"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "w": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "x": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "y": {
                                    "type": "integer",
                                    "minimum": 0
                                  }
                                },
                                "additionalProperties": false
                              },
                              "insight_id": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "layout",
                              "type",
                              "markdown"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "type": {
                                "type": "string",
                                "const": "text"
                              },
                              "title": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "layout": {
                                "type": "object",
                                "required": [
                                  "x",
                                  "y",
                                  "w",
                                  "h"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "w": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "x": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "y": {
                                    "type": "integer",
                                    "minimum": 0
                                  }
                                },
                                "additionalProperties": false
                              },
                              "markdown": {
                                "type": "string",
                                "maxLength": 4000
                              }
                            },
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "product_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/dashboards/{idOrSlug}": {
      "get": {
        "operationId": "analytics_dashboard_get",
        "summary": "Read one saved dashboard of the current product by its slug or its id.",
        "description": "Read one saved dashboard of the current product by its slug or its id. Returns the tiles and their layout, not results.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_dashboard_get",
        "parameters": [
          {
            "name": "idOrSlug",
            "in": "path",
            "required": true,
            "description": "The dashboard's slug, or its uuid",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "slug",
                    "name",
                    "tiles",
                    "id",
                    "product_id",
                    "created_by",
                    "created_at",
                    "updated_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "slug": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                    },
                    "tags": {
                      "type": "array",
                      "default": [],
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "maxLength": 40
                      }
                    },
                    "tiles": {
                      "type": "array",
                      "maxItems": 40,
                      "items": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "layout",
                              "type",
                              "insight_id"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "type": {
                                "type": "string",
                                "const": "insight"
                              },
                              "title": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "layout": {
                                "type": "object",
                                "required": [
                                  "x",
                                  "y",
                                  "w",
                                  "h"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "w": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "x": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "y": {
                                    "type": "integer",
                                    "minimum": 0
                                  }
                                },
                                "additionalProperties": false
                              },
                              "insight_id": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "layout",
                              "type",
                              "markdown"
                            ],
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "type": {
                                "type": "string",
                                "const": "text"
                              },
                              "title": {
                                "default": null,
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "maxLength": 120
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "layout": {
                                "type": "object",
                                "required": [
                                  "x",
                                  "y",
                                  "w",
                                  "h"
                                ],
                                "properties": {
                                  "h": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "w": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 12
                                  },
                                  "x": {
                                    "type": "integer",
                                    "minimum": 0
                                  },
                                  "y": {
                                    "type": "integer",
                                    "minimum": 0
                                  }
                                },
                                "additionalProperties": false
                              },
                              "markdown": {
                                "type": "string",
                                "maxLength": 4000
                              }
                            },
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "product_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/dashboards/{idOrSlug}/run": {
      "post": {
        "operationId": "analytics_dashboard_run",
        "summary": "Run every tile of a saved dashboard of the current product and return one entry per tile, in board order: the tile itself, and what it produced.",
        "description": "Run every tile of a saved dashboard of the current product and return one entry per tile, in board order: the tile itself, and what it produced. An insight tile carries exactly what analytics_insight_run answers for that insight; a text tile carries a null result, because its content is the tile. `from` and `to` override the window of every insight tile for this call only, changing nothing stored. A tile that fails carries an error with an HTTP status and does not stop the rest of the board, so check each tile's result before reading numbers.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_dashboard_run",
        "parameters": [
          {
            "name": "idOrSlug",
            "in": "path",
            "required": true,
            "description": "The dashboard's slug, or its uuid",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "description": "Inclusive window start; overrides the stored window",
                    "type": "string",
                    "format": "date-time"
                  },
                  "to": {
                    "description": "Inclusive window end; overrides the stored window",
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "dashboard",
                    "tiles"
                  ],
                  "properties": {
                    "tiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "tile",
                          "result"
                        ],
                        "properties": {
                          "tile": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "id",
                                  "layout",
                                  "type",
                                  "insight_id"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "insight"
                                  },
                                  "title": {
                                    "default": null,
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "layout": {
                                    "type": "object",
                                    "required": [
                                      "x",
                                      "y",
                                      "w",
                                      "h"
                                    ],
                                    "properties": {
                                      "h": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "w": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "x": {
                                        "type": "integer",
                                        "minimum": 0
                                      },
                                      "y": {
                                        "type": "integer",
                                        "minimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "insight_id": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "id",
                                  "layout",
                                  "type",
                                  "markdown"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "text"
                                  },
                                  "title": {
                                    "default": null,
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "layout": {
                                    "type": "object",
                                    "required": [
                                      "x",
                                      "y",
                                      "w",
                                      "h"
                                    ],
                                    "properties": {
                                      "h": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "w": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "x": {
                                        "type": "integer",
                                        "minimum": 0
                                      },
                                      "y": {
                                        "type": "integer",
                                        "minimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "markdown": {
                                    "type": "string",
                                    "maxLength": 4000
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "result": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "required": [
                                      "insight",
                                      "window",
                                      "series",
                                      "formula",
                                      "total",
                                      "target_status"
                                    ],
                                    "properties": {
                                      "extra": {
                                        "type": "object",
                                        "additionalProperties": {
                                          "type": "object",
                                          "required": [
                                            "cohort_size",
                                            "retained"
                                          ],
                                          "properties": {
                                            "retained": {
                                              "anyOf": [
                                                {
                                                  "type": "integer"
                                                },
                                                {
                                                  "type": "null"
                                                }
                                              ]
                                            },
                                            "cohort_size": {
                                              "type": "integer"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      },
                                      "total": {
                                        "type": "object",
                                        "additionalProperties": {
                                          "type": [
                                            "number",
                                            "null"
                                          ]
                                        }
                                      },
                                      "series": {
                                        "type": "object",
                                        "additionalProperties": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "required": [
                                              "bucket",
                                              "value"
                                            ],
                                            "properties": {
                                              "value": {
                                                "type": [
                                                  "number",
                                                  "null"
                                                ]
                                              },
                                              "bucket": {
                                                "description": "Bucket start, YYYY-MM-DD (UTC)",
                                                "type": "string"
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "window": {
                                        "type": "object",
                                        "required": [
                                          "from",
                                          "to",
                                          "grain"
                                        ],
                                        "properties": {
                                          "to": {
                                            "type": "string"
                                          },
                                          "from": {
                                            "type": "string"
                                          },
                                          "grain": {
                                            "type": "string",
                                            "enum": [
                                              "day",
                                              "week",
                                              "month"
                                            ]
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "formula": {
                                        "anyOf": [
                                          {
                                            "type": "array",
                                            "items": {
                                              "type": "object",
                                              "required": [
                                                "bucket",
                                                "value"
                                              ],
                                              "properties": {
                                                "value": {
                                                  "type": [
                                                    "number",
                                                    "null"
                                                  ]
                                                },
                                                "bucket": {
                                                  "description": "Bucket start, YYYY-MM-DD (UTC)",
                                                  "type": "string"
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "insight": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "required": [
                                              "slug",
                                              "name",
                                              "kind",
                                              "series",
                                              "window",
                                              "id",
                                              "product_id",
                                              "created_by",
                                              "created_at",
                                              "updated_at"
                                            ],
                                            "properties": {
                                              "id": {
                                                "type": "string",
                                                "format": "uuid"
                                              },
                                              "kind": {
                                                "type": "string",
                                                "enum": [
                                                  "trend",
                                                  "funnel",
                                                  "number",
                                                  "retention"
                                                ]
                                              },
                                              "name": {
                                                "type": "string",
                                                "minLength": 1,
                                                "maxLength": 120
                                              },
                                              "slug": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                                              },
                                              "tags": {
                                                "type": "array",
                                                "default": [],
                                                "maxItems": 20,
                                                "items": {
                                                  "type": "string",
                                                  "maxLength": 40
                                                }
                                              },
                                              "grain": {
                                                "type": "string",
                                                "enum": [
                                                  "day",
                                                  "week",
                                                  "month"
                                                ],
                                                "default": "day"
                                              },
                                              "series": {
                                                "type": "array",
                                                "minItems": 1,
                                                "maxItems": 8,
                                                "items": {
                                                  "type": "object",
                                                  "required": [
                                                    "key",
                                                    "request"
                                                  ],
                                                  "properties": {
                                                    "key": {
                                                      "type": "string",
                                                      "pattern": "^[A-Z]$"
                                                    },
                                                    "request": {
                                                      "anyOf": [
                                                        {
                                                          "type": "object",
                                                          "required": [
                                                            "entity",
                                                            "metrics",
                                                            "grain",
                                                            "from",
                                                            "to"
                                                          ],
                                                          "properties": {
                                                            "to": {
                                                              "description": "Inclusive last day (UTC)"
                                                            },
                                                            "from": {
                                                              "description": "Inclusive first day (UTC)"
                                                            },
                                                            "grain": {
                                                              "description": "Time bucket size"
                                                            },
                                                            "entity": {
                                                              "description": "Semantic view name from the catalog"
                                                            },
                                                            "filters": {
                                                              "description": "Equality filters on declared dimensions, or on `props.<key>` event properties"
                                                            },
                                                            "metrics": {
                                                              "description": "Declared metric names to compute"
                                                            },
                                                            "group_by": {
                                                              "description": "One declared dimension, or `props.<key>`, to group by"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "required": [
                                                            "steps",
                                                            "from",
                                                            "to"
                                                          ],
                                                          "properties": {
                                                            "to": {
                                                              "description": "Inclusive last day (UTC)"
                                                            },
                                                            "from": {
                                                              "description": "Inclusive first day (UTC)"
                                                            },
                                                            "grain": {
                                                              "description": "When set, also return per-step persons bucketed by step-entry time"
                                                            },
                                                            "steps": {
                                                              "description": "Ordered funnel steps, 2 to 5"
                                                            },
                                                            "window_days": {
                                                              "description": "Maximum days between two CONSECUTIVE steps for the later one to count"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        },
                                                        {
                                                          "type": "object",
                                                          "required": [
                                                            "entity",
                                                            "subject",
                                                            "day",
                                                            "from",
                                                            "to",
                                                            "grain"
                                                          ],
                                                          "properties": {
                                                            "to": {
                                                              "description": "Inclusive last day of the cohort range (UTC)"
                                                            },
                                                            "day": {
                                                              "description": "N: a subject is retained if it has a return event at least N days after its cohort event"
                                                            },
                                                            "from": {
                                                              "description": "Inclusive first day of the cohort range (UTC)"
                                                            },
                                                            "grain": {
                                                              "description": "Cohort bucket size, applied to each subject's FIRST cohort event"
                                                            },
                                                            "cohort": {
                                                              "description": "The starting event; empty filters mean any row of the entity"
                                                            },
                                                            "entity": {
                                                              "description": "Semantic view name from the catalog"
                                                            },
                                                            "return": {
                                                              "description": "The coming-back event; empty filters mean any row of the entity"
                                                            },
                                                            "subject": {
                                                              "description": "Cohort key: \"identity\" or `props.<key>`"
                                                            },
                                                            "return_window_days": {
                                                              "description": "Length of the window that opens on day N; a return event must fall inside it"
                                                            }
                                                          },
                                                          "additionalProperties": false
                                                        }
                                                      ]
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "target": {
                                                "default": null,
                                                "anyOf": [
                                                  {
                                                    "type": "object",
                                                    "required": [
                                                      "op",
                                                      "value"
                                                    ],
                                                    "properties": {
                                                      "op": {
                                                        "type": "string",
                                                        "enum": [
                                                          ">=",
                                                          "<=",
                                                          "="
                                                        ]
                                                      },
                                                      "value": {
                                                        "type": "number"
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "window": {
                                                "anyOf": [
                                                  {
                                                    "type": "object",
                                                    "required": [
                                                      "from",
                                                      "to"
                                                    ],
                                                    "properties": {
                                                      "to": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                      },
                                                      "from": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  },
                                                  {
                                                    "type": "object",
                                                    "required": [
                                                      "relative"
                                                    ],
                                                    "properties": {
                                                      "relative": {
                                                        "type": "string",
                                                        "enum": [
                                                          "last_7d",
                                                          "last_30d",
                                                          "last_90d",
                                                          "cycle"
                                                        ]
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                ]
                                              },
                                              "display": {
                                                "type": "string",
                                                "enum": [
                                                  "line",
                                                  "bar",
                                                  "bold_number",
                                                  "table"
                                                ],
                                                "default": "line"
                                              },
                                              "formula": {
                                                "default": null,
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "maxLength": 500
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "created_at": {
                                                "type": "string",
                                                "format": "date-time"
                                              },
                                              "created_by": {
                                                "type": [
                                                  "string",
                                                  "null"
                                                ]
                                              },
                                              "product_id": {
                                                "type": "string",
                                                "format": "uuid"
                                              },
                                              "updated_at": {
                                                "type": "string",
                                                "format": "date-time"
                                              },
                                              "description": {
                                                "type": "string",
                                                "maxLength": 2000
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "target_status": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "enum": [
                                              "met",
                                              "missed"
                                            ]
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "required": [
                                      "error"
                                    ],
                                    "properties": {
                                      "error": {
                                        "type": "object",
                                        "required": [
                                          "status",
                                          "message"
                                        ],
                                        "properties": {
                                          "status": {
                                            "type": "integer"
                                          },
                                          "message": {
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "dashboard": {
                      "type": "object",
                      "required": [
                        "slug",
                        "name",
                        "tiles",
                        "id",
                        "product_id",
                        "created_by",
                        "created_at",
                        "updated_at"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 120
                        },
                        "slug": {
                          "type": "string",
                          "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                        },
                        "tags": {
                          "type": "array",
                          "default": [],
                          "maxItems": 20,
                          "items": {
                            "type": "string",
                            "maxLength": 40
                          }
                        },
                        "tiles": {
                          "type": "array",
                          "maxItems": 40,
                          "items": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "id",
                                  "layout",
                                  "type",
                                  "insight_id"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "insight"
                                  },
                                  "title": {
                                    "default": null,
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "layout": {
                                    "type": "object",
                                    "required": [
                                      "x",
                                      "y",
                                      "w",
                                      "h"
                                    ],
                                    "properties": {
                                      "h": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "w": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "x": {
                                        "type": "integer",
                                        "minimum": 0
                                      },
                                      "y": {
                                        "type": "integer",
                                        "minimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "insight_id": {
                                    "type": "string",
                                    "format": "uuid"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "id",
                                  "layout",
                                  "type",
                                  "markdown"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "text"
                                  },
                                  "title": {
                                    "default": null,
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "maxLength": 120
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "layout": {
                                    "type": "object",
                                    "required": [
                                      "x",
                                      "y",
                                      "w",
                                      "h"
                                    ],
                                    "properties": {
                                      "h": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "w": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 12
                                      },
                                      "x": {
                                        "type": "integer",
                                        "minimum": 0
                                      },
                                      "y": {
                                        "type": "integer",
                                        "minimum": 0
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "markdown": {
                                    "type": "string",
                                    "maxLength": 4000
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "created_by": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "product_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/funnels/run": {
      "post": {
        "operationId": "analytics_funnel_run",
        "summary": "Run an ordered conversion funnel over the analytics semantic layer for the current product.",
        "description": "Run an ordered conversion funnel over the analytics semantic layer for the current product. Each step names a semantic entity (optionally narrowed by declared-dimension filters) and is counted in resolved persons from the identity graph, so a person is counted once per step no matter how many rows or identifiers they produced. Deterministic: entity, dimension and metric names are resolved against the semantic catalog, never generated. A step whose entity has a `propertiesColumn` in the catalog may also filter on `props.<key>`, compared as a string. Prefer this over analytics_query_run whenever the question is a conversion between ordered steps.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_funnel_run",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "steps": {
                    "description": "Ordered funnel steps, 2 to 5",
                    "type": "array",
                    "minItems": 2,
                    "maxItems": 5,
                    "items": {
                      "type": "object",
                      "required": [
                        "entity"
                      ],
                      "properties": {
                        "entity": {
                          "description": "Semantic view name from the catalog; must declare identity columns",
                          "type": "string",
                          "pattern": "^[a-z][a-z0-9_]*$"
                        },
                        "filters": {
                          "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                          "type": "array",
                          "default": [],
                          "items": {
                            "type": "object",
                            "required": [
                              "dimension",
                              "eq"
                            ],
                            "properties": {
                              "eq": {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean"
                                ]
                              },
                              "dimension": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "from": {
                    "description": "Inclusive first day (UTC)",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "to": {
                    "description": "Inclusive last day (UTC)",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "window_days": {
                    "description": "Maximum days between two CONSECUTIVE steps for the later one to count",
                    "type": "integer",
                    "default": 30,
                    "minimum": 1,
                    "maximum": 90
                  },
                  "grain": {
                    "description": "When set, also return per-step persons bucketed by step-entry time",
                    "type": "string",
                    "enum": [
                      "day",
                      "week",
                      "month"
                    ]
                  }
                },
                "required": [
                  "steps",
                  "from",
                  "to"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "steps",
                    "meta"
                  ],
                  "properties": {
                    "meta": {
                      "type": "object",
                      "required": [
                        "from",
                        "to",
                        "window_days",
                        "grain",
                        "sql"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "sql": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        },
                        "grain": {
                          "anyOf": [
                            {
                              "type": "string",
                              "enum": [
                                "day",
                                "week",
                                "month"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "window_days": {
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "steps": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "step_index",
                          "entity",
                          "persons",
                          "conversion_from_prev"
                        ],
                        "properties": {
                          "entity": {
                            "type": "string"
                          },
                          "persons": {
                            "type": "integer"
                          },
                          "step_index": {
                            "type": "integer"
                          },
                          "conversion_from_prev": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "series": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "ts",
                          "step_index",
                          "entity",
                          "persons"
                        ],
                        "properties": {
                          "ts": {
                            "description": "Bucket start, YYYY-MM-DD (UTC)",
                            "type": "string"
                          },
                          "entity": {
                            "type": "string"
                          },
                          "persons": {
                            "type": "integer"
                          },
                          "step_index": {
                            "type": "integer"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/insights": {
      "get": {
        "operationId": "analytics_insight_list",
        "summary": "List the saved insights of the current product, newest first.",
        "description": "List the saved insights of the current product, newest first. Narrow by an exact tag or by a case-insensitive substring of the name or slug. Returns definitions, not results.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_insight_list",
        "parameters": [
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Exact tag the insight must carry",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring of the name or slug",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "insights"
                  ],
                  "properties": {
                    "insights": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "slug",
                          "name",
                          "kind",
                          "series",
                          "window",
                          "id",
                          "product_id",
                          "created_by",
                          "created_at",
                          "updated_at"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "trend",
                              "funnel",
                              "number",
                              "retention"
                            ]
                          },
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "slug": {
                            "type": "string",
                            "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                          },
                          "tags": {
                            "type": "array",
                            "default": [],
                            "maxItems": 20,
                            "items": {
                              "type": "string",
                              "maxLength": 40
                            }
                          },
                          "grain": {
                            "type": "string",
                            "enum": [
                              "day",
                              "week",
                              "month"
                            ],
                            "default": "day"
                          },
                          "series": {
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 8,
                            "items": {
                              "type": "object",
                              "required": [
                                "key",
                                "request"
                              ],
                              "properties": {
                                "key": {
                                  "type": "string",
                                  "pattern": "^[A-Z]$"
                                },
                                "request": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "required": [
                                        "entity",
                                        "metrics",
                                        "grain",
                                        "from",
                                        "to"
                                      ],
                                      "properties": {
                                        "to": {
                                          "description": "Inclusive last day (UTC)",
                                          "type": "string",
                                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                        },
                                        "from": {
                                          "description": "Inclusive first day (UTC)",
                                          "type": "string",
                                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                        },
                                        "grain": {
                                          "description": "Time bucket size",
                                          "type": "string",
                                          "enum": [
                                            "day",
                                            "week",
                                            "month"
                                          ]
                                        },
                                        "entity": {
                                          "description": "Semantic view name from the catalog",
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_]*$"
                                        },
                                        "filters": {
                                          "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                          "type": "array",
                                          "default": [],
                                          "items": {
                                            "type": "object",
                                            "required": [
                                              "dimension",
                                              "eq"
                                            ],
                                            "properties": {
                                              "eq": {
                                                "type": [
                                                  "string",
                                                  "number",
                                                  "boolean"
                                                ]
                                              },
                                              "dimension": {
                                                "description": "One declared dimension, or `props.<key>`, to group by",
                                                "type": "string"
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "metrics": {
                                          "description": "Declared metric names to compute",
                                          "type": "array",
                                          "minItems": 1,
                                          "items": {
                                            "type": "string",
                                            "pattern": "^[a-z][a-z0-9_]*$"
                                          }
                                        },
                                        "group_by": {
                                          "description": "One declared dimension, or `props.<key>`, to group by",
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "required": [
                                        "steps",
                                        "from",
                                        "to"
                                      ],
                                      "properties": {
                                        "to": {
                                          "description": "Inclusive last day (UTC)",
                                          "type": "string",
                                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                        },
                                        "from": {
                                          "description": "Inclusive first day (UTC)",
                                          "type": "string",
                                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                        },
                                        "grain": {
                                          "description": "When set, also return per-step persons bucketed by step-entry time",
                                          "type": "string",
                                          "enum": [
                                            "day",
                                            "week",
                                            "month"
                                          ]
                                        },
                                        "steps": {
                                          "description": "Ordered funnel steps, 2 to 5",
                                          "type": "array",
                                          "minItems": 2,
                                          "maxItems": 5,
                                          "items": {
                                            "type": "object",
                                            "required": [
                                              "entity"
                                            ],
                                            "properties": {
                                              "entity": {
                                                "description": "Semantic view name from the catalog; must declare identity columns",
                                                "type": "string",
                                                "pattern": "^[a-z][a-z0-9_]*$"
                                              },
                                              "filters": {
                                                "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                                "type": "array",
                                                "default": [],
                                                "items": {
                                                  "type": "object",
                                                  "required": [
                                                    "dimension",
                                                    "eq"
                                                  ],
                                                  "properties": {
                                                    "eq": {
                                                      "type": [
                                                        "string",
                                                        "number",
                                                        "boolean"
                                                      ]
                                                    },
                                                    "dimension": {
                                                      "description": "One declared dimension, or `props.<key>`, to group by",
                                                      "type": "string"
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "window_days": {
                                          "description": "Maximum days between two CONSECUTIVE steps for the later one to count",
                                          "type": "integer",
                                          "default": 30,
                                          "minimum": 1,
                                          "maximum": 90
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "object",
                                      "required": [
                                        "entity",
                                        "subject",
                                        "day",
                                        "from",
                                        "to",
                                        "grain"
                                      ],
                                      "properties": {
                                        "to": {
                                          "description": "Inclusive last day of the cohort range (UTC)",
                                          "type": "string",
                                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                        },
                                        "day": {
                                          "description": "N: a subject is retained if it has a return event at least N days after its cohort event",
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 365
                                        },
                                        "from": {
                                          "description": "Inclusive first day of the cohort range (UTC)",
                                          "type": "string",
                                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                        },
                                        "grain": {
                                          "description": "Cohort bucket size, applied to each subject's FIRST cohort event",
                                          "type": "string",
                                          "enum": [
                                            "day",
                                            "week",
                                            "month"
                                          ]
                                        },
                                        "cohort": {
                                          "description": "The starting event; empty filters mean any row of the entity",
                                          "type": "object",
                                          "default": {
                                            "filters": []
                                          },
                                          "properties": {
                                            "filters": {
                                              "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                              "type": "array",
                                              "default": [],
                                              "items": {
                                                "type": "object",
                                                "required": [
                                                  "dimension",
                                                  "eq"
                                                ],
                                                "properties": {
                                                  "eq": {
                                                    "type": [
                                                      "string",
                                                      "number",
                                                      "boolean"
                                                    ]
                                                  },
                                                  "dimension": {
                                                    "description": "One declared dimension, or `props.<key>`, to group by",
                                                    "type": "string"
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "entity": {
                                          "description": "Semantic view name from the catalog",
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_]*$"
                                        },
                                        "return": {
                                          "description": "The coming-back event; empty filters mean any row of the entity",
                                          "type": "object",
                                          "default": {
                                            "filters": []
                                          },
                                          "properties": {
                                            "filters": {
                                              "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                              "type": "array",
                                              "default": [],
                                              "items": {
                                                "type": "object",
                                                "required": [
                                                  "dimension",
                                                  "eq"
                                                ],
                                                "properties": {
                                                  "eq": {
                                                    "type": [
                                                      "string",
                                                      "number",
                                                      "boolean"
                                                    ]
                                                  },
                                                  "dimension": {
                                                    "description": "One declared dimension, or `props.<key>`, to group by",
                                                    "type": "string"
                                                  }
                                                },
                                                "additionalProperties": false
                                              }
                                            }
                                          },
                                          "additionalProperties": false
                                        },
                                        "subject": {
                                          "description": "Cohort key: \"identity\" or `props.<key>`",
                                          "type": "string"
                                        },
                                        "return_window_days": {
                                          "description": "Length of the window that opens on day N; a return event must fall inside it",
                                          "type": "integer",
                                          "default": 7,
                                          "minimum": 1,
                                          "maximum": 90
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "target": {
                            "default": null,
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "op",
                                  "value"
                                ],
                                "properties": {
                                  "op": {
                                    "type": "string",
                                    "enum": [
                                      ">=",
                                      "<=",
                                      "="
                                    ]
                                  },
                                  "value": {
                                    "type": "number"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "window": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "from",
                                  "to"
                                ],
                                "properties": {
                                  "to": {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  "from": {
                                    "type": "string",
                                    "format": "date-time"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "relative"
                                ],
                                "properties": {
                                  "relative": {
                                    "type": "string",
                                    "enum": [
                                      "last_7d",
                                      "last_30d",
                                      "last_90d",
                                      "cycle"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "display": {
                            "type": "string",
                            "enum": [
                              "line",
                              "bar",
                              "bold_number",
                              "table"
                            ],
                            "default": "line"
                          },
                          "formula": {
                            "default": null,
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 500
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "created_by": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "product_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "description": {
                            "type": "string",
                            "maxLength": 2000
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "analytics_insight_create",
        "summary": "Save a named insight for the current product: one to eight series over the analytics semantic layer, an optional formula combining them by key, a time window and how to display it.",
        "description": "Save a named insight for the current product: one to eight series over the analytics semantic layer, an optional formula combining them by key, a time window and how to display it. The slug is the address the insight is read by and cannot be changed later. Stores the definition only; it does not run it. Series requests are validated with the same schemas analytics_metric_query and analytics_funnel_run accept, so a stored insight always runs.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_insight_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "trend",
                      "funnel",
                      "number",
                      "retention"
                    ]
                  },
                  "series": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 8,
                    "items": {
                      "type": "object",
                      "required": [
                        "key",
                        "request"
                      ],
                      "properties": {
                        "key": {
                          "type": "string",
                          "pattern": "^[A-Z]$"
                        },
                        "request": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "entity",
                                "metrics",
                                "grain",
                                "from",
                                "to"
                              ],
                              "properties": {
                                "to": {
                                  "description": "Inclusive last day (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "from": {
                                  "description": "Inclusive first day (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "grain": {
                                  "description": "Time bucket size",
                                  "type": "string",
                                  "enum": [
                                    "day",
                                    "week",
                                    "month"
                                  ]
                                },
                                "entity": {
                                  "description": "Semantic view name from the catalog",
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]*$"
                                },
                                "filters": {
                                  "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                  "type": "array",
                                  "default": [],
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "dimension",
                                      "eq"
                                    ],
                                    "properties": {
                                      "eq": {
                                        "type": [
                                          "string",
                                          "number",
                                          "boolean"
                                        ]
                                      },
                                      "dimension": {
                                        "description": "One declared dimension, or `props.<key>`, to group by",
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "metrics": {
                                  "description": "Declared metric names to compute",
                                  "type": "array",
                                  "minItems": 1,
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  }
                                },
                                "group_by": {
                                  "description": "One declared dimension, or `props.<key>`, to group by",
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "steps",
                                "from",
                                "to"
                              ],
                              "properties": {
                                "to": {
                                  "description": "Inclusive last day (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "from": {
                                  "description": "Inclusive first day (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "grain": {
                                  "description": "When set, also return per-step persons bucketed by step-entry time",
                                  "type": "string",
                                  "enum": [
                                    "day",
                                    "week",
                                    "month"
                                  ]
                                },
                                "steps": {
                                  "description": "Ordered funnel steps, 2 to 5",
                                  "type": "array",
                                  "minItems": 2,
                                  "maxItems": 5,
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "entity"
                                    ],
                                    "properties": {
                                      "entity": {
                                        "description": "Semantic view name from the catalog; must declare identity columns",
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]*$"
                                      },
                                      "filters": {
                                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                        "type": "array",
                                        "default": [],
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "dimension",
                                            "eq"
                                          ],
                                          "properties": {
                                            "eq": {
                                              "type": [
                                                "string",
                                                "number",
                                                "boolean"
                                              ]
                                            },
                                            "dimension": {
                                              "description": "One declared dimension, or `props.<key>`, to group by",
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "window_days": {
                                  "description": "Maximum days between two CONSECUTIVE steps for the later one to count",
                                  "type": "integer",
                                  "default": 30,
                                  "minimum": 1,
                                  "maximum": 90
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "entity",
                                "subject",
                                "day",
                                "from",
                                "to",
                                "grain"
                              ],
                              "properties": {
                                "to": {
                                  "description": "Inclusive last day of the cohort range (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "day": {
                                  "description": "N: a subject is retained if it has a return event at least N days after its cohort event",
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 365
                                },
                                "from": {
                                  "description": "Inclusive first day of the cohort range (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "grain": {
                                  "description": "Cohort bucket size, applied to each subject's FIRST cohort event",
                                  "type": "string",
                                  "enum": [
                                    "day",
                                    "week",
                                    "month"
                                  ]
                                },
                                "cohort": {
                                  "description": "The starting event; empty filters mean any row of the entity",
                                  "type": "object",
                                  "default": {
                                    "filters": []
                                  },
                                  "properties": {
                                    "filters": {
                                      "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                      "type": "array",
                                      "default": [],
                                      "items": {
                                        "type": "object",
                                        "required": [
                                          "dimension",
                                          "eq"
                                        ],
                                        "properties": {
                                          "eq": {
                                            "type": [
                                              "string",
                                              "number",
                                              "boolean"
                                            ]
                                          },
                                          "dimension": {
                                            "description": "One declared dimension, or `props.<key>`, to group by",
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "entity": {
                                  "description": "Semantic view name from the catalog",
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]*$"
                                },
                                "return": {
                                  "description": "The coming-back event; empty filters mean any row of the entity",
                                  "type": "object",
                                  "default": {
                                    "filters": []
                                  },
                                  "properties": {
                                    "filters": {
                                      "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                      "type": "array",
                                      "default": [],
                                      "items": {
                                        "type": "object",
                                        "required": [
                                          "dimension",
                                          "eq"
                                        ],
                                        "properties": {
                                          "eq": {
                                            "type": [
                                              "string",
                                              "number",
                                              "boolean"
                                            ]
                                          },
                                          "dimension": {
                                            "description": "One declared dimension, or `props.<key>`, to group by",
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "subject": {
                                  "description": "Cohort key: \"identity\" or `props.<key>`",
                                  "type": "string"
                                },
                                "return_window_days": {
                                  "description": "Length of the window that opens on day N; a return event must fall inside it",
                                  "type": "integer",
                                  "default": 7,
                                  "minimum": 1,
                                  "maximum": 90
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "formula": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "window": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "from",
                          "to"
                        ],
                        "properties": {
                          "to": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "from": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "relative"
                        ],
                        "properties": {
                          "relative": {
                            "type": "string",
                            "enum": [
                              "last_7d",
                              "last_30d",
                              "last_90d",
                              "cycle"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "grain": {
                    "type": "string",
                    "enum": [
                      "day",
                      "week",
                      "month"
                    ],
                    "default": "day"
                  },
                  "display": {
                    "type": "string",
                    "enum": [
                      "line",
                      "bar",
                      "bold_number",
                      "table"
                    ],
                    "default": "line"
                  },
                  "tags": {
                    "type": "array",
                    "default": [],
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 40
                    }
                  },
                  "target": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "op",
                          "value"
                        ],
                        "properties": {
                          "op": {
                            "type": "string",
                            "enum": [
                              ">=",
                              "<=",
                              "="
                            ]
                          },
                          "value": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "slug",
                  "name",
                  "kind",
                  "series",
                  "window"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "slug",
                    "name",
                    "kind",
                    "series",
                    "window",
                    "id",
                    "product_id",
                    "created_by",
                    "created_at",
                    "updated_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "trend",
                        "funnel",
                        "number",
                        "retention"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "slug": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                    },
                    "tags": {
                      "type": "array",
                      "default": [],
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "maxLength": 40
                      }
                    },
                    "grain": {
                      "type": "string",
                      "enum": [
                        "day",
                        "week",
                        "month"
                      ],
                      "default": "day"
                    },
                    "series": {
                      "type": "array",
                      "minItems": 1,
                      "maxItems": 8,
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "request"
                        ],
                        "properties": {
                          "key": {
                            "type": "string",
                            "pattern": "^[A-Z]$"
                          },
                          "request": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "entity",
                                  "metrics",
                                  "grain",
                                  "from",
                                  "to"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "from": {
                                    "description": "Inclusive first day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "Time bucket size",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "entity": {
                                    "description": "Semantic view name from the catalog",
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "filters": {
                                    "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                    "type": "array",
                                    "default": [],
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "dimension",
                                        "eq"
                                      ],
                                      "properties": {
                                        "eq": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean"
                                          ]
                                        },
                                        "dimension": {
                                          "description": "One declared dimension, or `props.<key>`, to group by",
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "metrics": {
                                    "description": "Declared metric names to compute",
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]*$"
                                    }
                                  },
                                  "group_by": {
                                    "description": "One declared dimension, or `props.<key>`, to group by",
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "steps",
                                  "from",
                                  "to"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "from": {
                                    "description": "Inclusive first day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "When set, also return per-step persons bucketed by step-entry time",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "steps": {
                                    "description": "Ordered funnel steps, 2 to 5",
                                    "type": "array",
                                    "minItems": 2,
                                    "maxItems": 5,
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "entity"
                                      ],
                                      "properties": {
                                        "entity": {
                                          "description": "Semantic view name from the catalog; must declare identity columns",
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_]*$"
                                        },
                                        "filters": {
                                          "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                          "type": "array",
                                          "default": [],
                                          "items": {
                                            "type": "object",
                                            "required": [
                                              "dimension",
                                              "eq"
                                            ],
                                            "properties": {
                                              "eq": {
                                                "type": [
                                                  "string",
                                                  "number",
                                                  "boolean"
                                                ]
                                              },
                                              "dimension": {
                                                "description": "One declared dimension, or `props.<key>`, to group by",
                                                "type": "string"
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "window_days": {
                                    "description": "Maximum days between two CONSECUTIVE steps for the later one to count",
                                    "type": "integer",
                                    "default": 30,
                                    "minimum": 1,
                                    "maximum": 90
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "entity",
                                  "subject",
                                  "day",
                                  "from",
                                  "to",
                                  "grain"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day of the cohort range (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "day": {
                                    "description": "N: a subject is retained if it has a return event at least N days after its cohort event",
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 365
                                  },
                                  "from": {
                                    "description": "Inclusive first day of the cohort range (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "Cohort bucket size, applied to each subject's FIRST cohort event",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "cohort": {
                                    "description": "The starting event; empty filters mean any row of the entity",
                                    "type": "object",
                                    "default": {
                                      "filters": []
                                    },
                                    "properties": {
                                      "filters": {
                                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                        "type": "array",
                                        "default": [],
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "dimension",
                                            "eq"
                                          ],
                                          "properties": {
                                            "eq": {
                                              "type": [
                                                "string",
                                                "number",
                                                "boolean"
                                              ]
                                            },
                                            "dimension": {
                                              "description": "One declared dimension, or `props.<key>`, to group by",
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "entity": {
                                    "description": "Semantic view name from the catalog",
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "return": {
                                    "description": "The coming-back event; empty filters mean any row of the entity",
                                    "type": "object",
                                    "default": {
                                      "filters": []
                                    },
                                    "properties": {
                                      "filters": {
                                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                        "type": "array",
                                        "default": [],
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "dimension",
                                            "eq"
                                          ],
                                          "properties": {
                                            "eq": {
                                              "type": [
                                                "string",
                                                "number",
                                                "boolean"
                                              ]
                                            },
                                            "dimension": {
                                              "description": "One declared dimension, or `props.<key>`, to group by",
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "subject": {
                                    "description": "Cohort key: \"identity\" or `props.<key>`",
                                    "type": "string"
                                  },
                                  "return_window_days": {
                                    "description": "Length of the window that opens on day N; a return event must fall inside it",
                                    "type": "integer",
                                    "default": 7,
                                    "minimum": 1,
                                    "maximum": 90
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "target": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "op",
                            "value"
                          ],
                          "properties": {
                            "op": {
                              "type": "string",
                              "enum": [
                                ">=",
                                "<=",
                                "="
                              ]
                            },
                            "value": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "window": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "to": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "from": {
                              "type": "string",
                              "format": "date-time"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "relative"
                          ],
                          "properties": {
                            "relative": {
                              "type": "string",
                              "enum": [
                                "last_7d",
                                "last_30d",
                                "last_90d",
                                "cycle"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "display": {
                      "type": "string",
                      "enum": [
                        "line",
                        "bar",
                        "bold_number",
                        "table"
                      ],
                      "default": "line"
                    },
                    "formula": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "product_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/insights/{id}": {
      "delete": {
        "operationId": "analytics_insight_delete",
        "summary": "Permanently delete one saved insight of the current product.",
        "description": "Permanently delete one saved insight of the current product. Dashboards referring to it will no longer resolve it.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_insight_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The insight's uuid; slugs are not accepted here",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "analytics_insight_update",
        "summary": "Change fields of a saved insight of the current product.",
        "description": "Change fields of a saved insight of the current product. Only the fields supplied are changed; the rest keep their stored values. The slug cannot be changed — create a new insight instead.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_insight_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The insight's uuid; slugs are not accepted here",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "trend",
                      "funnel",
                      "number",
                      "retention"
                    ]
                  },
                  "series": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 8,
                    "items": {
                      "type": "object",
                      "required": [
                        "key",
                        "request"
                      ],
                      "properties": {
                        "key": {
                          "type": "string",
                          "pattern": "^[A-Z]$"
                        },
                        "request": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "entity",
                                "metrics",
                                "grain",
                                "from",
                                "to"
                              ],
                              "properties": {
                                "to": {
                                  "description": "Inclusive last day (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "from": {
                                  "description": "Inclusive first day (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "grain": {
                                  "description": "Time bucket size",
                                  "type": "string",
                                  "enum": [
                                    "day",
                                    "week",
                                    "month"
                                  ]
                                },
                                "entity": {
                                  "description": "Semantic view name from the catalog",
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]*$"
                                },
                                "filters": {
                                  "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                  "type": "array",
                                  "default": [],
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "dimension",
                                      "eq"
                                    ],
                                    "properties": {
                                      "eq": {
                                        "type": [
                                          "string",
                                          "number",
                                          "boolean"
                                        ]
                                      },
                                      "dimension": {
                                        "description": "One declared dimension, or `props.<key>`, to group by",
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "metrics": {
                                  "description": "Declared metric names to compute",
                                  "type": "array",
                                  "minItems": 1,
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  }
                                },
                                "group_by": {
                                  "description": "One declared dimension, or `props.<key>`, to group by",
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "steps",
                                "from",
                                "to"
                              ],
                              "properties": {
                                "to": {
                                  "description": "Inclusive last day (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "from": {
                                  "description": "Inclusive first day (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "grain": {
                                  "description": "When set, also return per-step persons bucketed by step-entry time",
                                  "type": "string",
                                  "enum": [
                                    "day",
                                    "week",
                                    "month"
                                  ]
                                },
                                "steps": {
                                  "description": "Ordered funnel steps, 2 to 5",
                                  "type": "array",
                                  "minItems": 2,
                                  "maxItems": 5,
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "entity"
                                    ],
                                    "properties": {
                                      "entity": {
                                        "description": "Semantic view name from the catalog; must declare identity columns",
                                        "type": "string",
                                        "pattern": "^[a-z][a-z0-9_]*$"
                                      },
                                      "filters": {
                                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                        "type": "array",
                                        "default": [],
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "dimension",
                                            "eq"
                                          ],
                                          "properties": {
                                            "eq": {
                                              "type": [
                                                "string",
                                                "number",
                                                "boolean"
                                              ]
                                            },
                                            "dimension": {
                                              "description": "One declared dimension, or `props.<key>`, to group by",
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "window_days": {
                                  "description": "Maximum days between two CONSECUTIVE steps for the later one to count",
                                  "type": "integer",
                                  "default": 30,
                                  "minimum": 1,
                                  "maximum": 90
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "entity",
                                "subject",
                                "day",
                                "from",
                                "to",
                                "grain"
                              ],
                              "properties": {
                                "to": {
                                  "description": "Inclusive last day of the cohort range (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "day": {
                                  "description": "N: a subject is retained if it has a return event at least N days after its cohort event",
                                  "type": "integer",
                                  "minimum": 1,
                                  "maximum": 365
                                },
                                "from": {
                                  "description": "Inclusive first day of the cohort range (UTC)",
                                  "type": "string",
                                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "grain": {
                                  "description": "Cohort bucket size, applied to each subject's FIRST cohort event",
                                  "type": "string",
                                  "enum": [
                                    "day",
                                    "week",
                                    "month"
                                  ]
                                },
                                "cohort": {
                                  "description": "The starting event; empty filters mean any row of the entity",
                                  "type": "object",
                                  "default": {
                                    "filters": []
                                  },
                                  "properties": {
                                    "filters": {
                                      "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                      "type": "array",
                                      "default": [],
                                      "items": {
                                        "type": "object",
                                        "required": [
                                          "dimension",
                                          "eq"
                                        ],
                                        "properties": {
                                          "eq": {
                                            "type": [
                                              "string",
                                              "number",
                                              "boolean"
                                            ]
                                          },
                                          "dimension": {
                                            "description": "One declared dimension, or `props.<key>`, to group by",
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "entity": {
                                  "description": "Semantic view name from the catalog",
                                  "type": "string",
                                  "pattern": "^[a-z][a-z0-9_]*$"
                                },
                                "return": {
                                  "description": "The coming-back event; empty filters mean any row of the entity",
                                  "type": "object",
                                  "default": {
                                    "filters": []
                                  },
                                  "properties": {
                                    "filters": {
                                      "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                      "type": "array",
                                      "default": [],
                                      "items": {
                                        "type": "object",
                                        "required": [
                                          "dimension",
                                          "eq"
                                        ],
                                        "properties": {
                                          "eq": {
                                            "type": [
                                              "string",
                                              "number",
                                              "boolean"
                                            ]
                                          },
                                          "dimension": {
                                            "description": "One declared dimension, or `props.<key>`, to group by",
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "subject": {
                                  "description": "Cohort key: \"identity\" or `props.<key>`",
                                  "type": "string"
                                },
                                "return_window_days": {
                                  "description": "Length of the window that opens on day N; a return event must fall inside it",
                                  "type": "integer",
                                  "default": 7,
                                  "minimum": 1,
                                  "maximum": 90
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "formula": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "window": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "from",
                          "to"
                        ],
                        "properties": {
                          "to": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "from": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "relative"
                        ],
                        "properties": {
                          "relative": {
                            "type": "string",
                            "enum": [
                              "last_7d",
                              "last_30d",
                              "last_90d",
                              "cycle"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "grain": {
                    "type": "string",
                    "enum": [
                      "day",
                      "week",
                      "month"
                    ]
                  },
                  "display": {
                    "type": "string",
                    "enum": [
                      "line",
                      "bar",
                      "bold_number",
                      "table"
                    ]
                  },
                  "tags": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 40
                    }
                  },
                  "target": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "op",
                          "value"
                        ],
                        "properties": {
                          "op": {
                            "type": "string",
                            "enum": [
                              ">=",
                              "<=",
                              "="
                            ]
                          },
                          "value": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "slug",
                    "name",
                    "kind",
                    "series",
                    "window",
                    "id",
                    "product_id",
                    "created_by",
                    "created_at",
                    "updated_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "trend",
                        "funnel",
                        "number",
                        "retention"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "slug": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                    },
                    "tags": {
                      "type": "array",
                      "default": [],
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "maxLength": 40
                      }
                    },
                    "grain": {
                      "type": "string",
                      "enum": [
                        "day",
                        "week",
                        "month"
                      ],
                      "default": "day"
                    },
                    "series": {
                      "type": "array",
                      "minItems": 1,
                      "maxItems": 8,
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "request"
                        ],
                        "properties": {
                          "key": {
                            "type": "string",
                            "pattern": "^[A-Z]$"
                          },
                          "request": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "entity",
                                  "metrics",
                                  "grain",
                                  "from",
                                  "to"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "from": {
                                    "description": "Inclusive first day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "Time bucket size",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "entity": {
                                    "description": "Semantic view name from the catalog",
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "filters": {
                                    "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                    "type": "array",
                                    "default": [],
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "dimension",
                                        "eq"
                                      ],
                                      "properties": {
                                        "eq": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean"
                                          ]
                                        },
                                        "dimension": {
                                          "description": "One declared dimension, or `props.<key>`, to group by",
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "metrics": {
                                    "description": "Declared metric names to compute",
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]*$"
                                    }
                                  },
                                  "group_by": {
                                    "description": "One declared dimension, or `props.<key>`, to group by",
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "steps",
                                  "from",
                                  "to"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "from": {
                                    "description": "Inclusive first day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "When set, also return per-step persons bucketed by step-entry time",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "steps": {
                                    "description": "Ordered funnel steps, 2 to 5",
                                    "type": "array",
                                    "minItems": 2,
                                    "maxItems": 5,
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "entity"
                                      ],
                                      "properties": {
                                        "entity": {
                                          "description": "Semantic view name from the catalog; must declare identity columns",
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_]*$"
                                        },
                                        "filters": {
                                          "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                          "type": "array",
                                          "default": [],
                                          "items": {
                                            "type": "object",
                                            "required": [
                                              "dimension",
                                              "eq"
                                            ],
                                            "properties": {
                                              "eq": {
                                                "type": [
                                                  "string",
                                                  "number",
                                                  "boolean"
                                                ]
                                              },
                                              "dimension": {
                                                "description": "One declared dimension, or `props.<key>`, to group by",
                                                "type": "string"
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "window_days": {
                                    "description": "Maximum days between two CONSECUTIVE steps for the later one to count",
                                    "type": "integer",
                                    "default": 30,
                                    "minimum": 1,
                                    "maximum": 90
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "entity",
                                  "subject",
                                  "day",
                                  "from",
                                  "to",
                                  "grain"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day of the cohort range (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "day": {
                                    "description": "N: a subject is retained if it has a return event at least N days after its cohort event",
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 365
                                  },
                                  "from": {
                                    "description": "Inclusive first day of the cohort range (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "Cohort bucket size, applied to each subject's FIRST cohort event",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "cohort": {
                                    "description": "The starting event; empty filters mean any row of the entity",
                                    "type": "object",
                                    "default": {
                                      "filters": []
                                    },
                                    "properties": {
                                      "filters": {
                                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                        "type": "array",
                                        "default": [],
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "dimension",
                                            "eq"
                                          ],
                                          "properties": {
                                            "eq": {
                                              "type": [
                                                "string",
                                                "number",
                                                "boolean"
                                              ]
                                            },
                                            "dimension": {
                                              "description": "One declared dimension, or `props.<key>`, to group by",
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "entity": {
                                    "description": "Semantic view name from the catalog",
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "return": {
                                    "description": "The coming-back event; empty filters mean any row of the entity",
                                    "type": "object",
                                    "default": {
                                      "filters": []
                                    },
                                    "properties": {
                                      "filters": {
                                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                        "type": "array",
                                        "default": [],
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "dimension",
                                            "eq"
                                          ],
                                          "properties": {
                                            "eq": {
                                              "type": [
                                                "string",
                                                "number",
                                                "boolean"
                                              ]
                                            },
                                            "dimension": {
                                              "description": "One declared dimension, or `props.<key>`, to group by",
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "subject": {
                                    "description": "Cohort key: \"identity\" or `props.<key>`",
                                    "type": "string"
                                  },
                                  "return_window_days": {
                                    "description": "Length of the window that opens on day N; a return event must fall inside it",
                                    "type": "integer",
                                    "default": 7,
                                    "minimum": 1,
                                    "maximum": 90
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "target": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "op",
                            "value"
                          ],
                          "properties": {
                            "op": {
                              "type": "string",
                              "enum": [
                                ">=",
                                "<=",
                                "="
                              ]
                            },
                            "value": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "window": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "to": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "from": {
                              "type": "string",
                              "format": "date-time"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "relative"
                          ],
                          "properties": {
                            "relative": {
                              "type": "string",
                              "enum": [
                                "last_7d",
                                "last_30d",
                                "last_90d",
                                "cycle"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "display": {
                      "type": "string",
                      "enum": [
                        "line",
                        "bar",
                        "bold_number",
                        "table"
                      ],
                      "default": "line"
                    },
                    "formula": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "product_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/insights/{idOrSlug}": {
      "get": {
        "operationId": "analytics_insight_get",
        "summary": "Read one saved insight of the current product by its slug or its id.",
        "description": "Read one saved insight of the current product by its slug or its id. Returns the definition, not results.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_insight_get",
        "parameters": [
          {
            "name": "idOrSlug",
            "in": "path",
            "required": true,
            "description": "The insight's slug, or its uuid",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "slug",
                    "name",
                    "kind",
                    "series",
                    "window",
                    "id",
                    "product_id",
                    "created_by",
                    "created_at",
                    "updated_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "trend",
                        "funnel",
                        "number",
                        "retention"
                      ]
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "slug": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                    },
                    "tags": {
                      "type": "array",
                      "default": [],
                      "maxItems": 20,
                      "items": {
                        "type": "string",
                        "maxLength": 40
                      }
                    },
                    "grain": {
                      "type": "string",
                      "enum": [
                        "day",
                        "week",
                        "month"
                      ],
                      "default": "day"
                    },
                    "series": {
                      "type": "array",
                      "minItems": 1,
                      "maxItems": 8,
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "request"
                        ],
                        "properties": {
                          "key": {
                            "type": "string",
                            "pattern": "^[A-Z]$"
                          },
                          "request": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "entity",
                                  "metrics",
                                  "grain",
                                  "from",
                                  "to"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "from": {
                                    "description": "Inclusive first day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "Time bucket size",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "entity": {
                                    "description": "Semantic view name from the catalog",
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "filters": {
                                    "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                    "type": "array",
                                    "default": [],
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "dimension",
                                        "eq"
                                      ],
                                      "properties": {
                                        "eq": {
                                          "type": [
                                            "string",
                                            "number",
                                            "boolean"
                                          ]
                                        },
                                        "dimension": {
                                          "description": "One declared dimension, or `props.<key>`, to group by",
                                          "type": "string"
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "metrics": {
                                    "description": "Declared metric names to compute",
                                    "type": "array",
                                    "minItems": 1,
                                    "items": {
                                      "type": "string",
                                      "pattern": "^[a-z][a-z0-9_]*$"
                                    }
                                  },
                                  "group_by": {
                                    "description": "One declared dimension, or `props.<key>`, to group by",
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "steps",
                                  "from",
                                  "to"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "from": {
                                    "description": "Inclusive first day (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "When set, also return per-step persons bucketed by step-entry time",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "steps": {
                                    "description": "Ordered funnel steps, 2 to 5",
                                    "type": "array",
                                    "minItems": 2,
                                    "maxItems": 5,
                                    "items": {
                                      "type": "object",
                                      "required": [
                                        "entity"
                                      ],
                                      "properties": {
                                        "entity": {
                                          "description": "Semantic view name from the catalog; must declare identity columns",
                                          "type": "string",
                                          "pattern": "^[a-z][a-z0-9_]*$"
                                        },
                                        "filters": {
                                          "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                          "type": "array",
                                          "default": [],
                                          "items": {
                                            "type": "object",
                                            "required": [
                                              "dimension",
                                              "eq"
                                            ],
                                            "properties": {
                                              "eq": {
                                                "type": [
                                                  "string",
                                                  "number",
                                                  "boolean"
                                                ]
                                              },
                                              "dimension": {
                                                "description": "One declared dimension, or `props.<key>`, to group by",
                                                "type": "string"
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        }
                                      },
                                      "additionalProperties": false
                                    }
                                  },
                                  "window_days": {
                                    "description": "Maximum days between two CONSECUTIVE steps for the later one to count",
                                    "type": "integer",
                                    "default": 30,
                                    "minimum": 1,
                                    "maximum": 90
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "entity",
                                  "subject",
                                  "day",
                                  "from",
                                  "to",
                                  "grain"
                                ],
                                "properties": {
                                  "to": {
                                    "description": "Inclusive last day of the cohort range (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "day": {
                                    "description": "N: a subject is retained if it has a return event at least N days after its cohort event",
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 365
                                  },
                                  "from": {
                                    "description": "Inclusive first day of the cohort range (UTC)",
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                  },
                                  "grain": {
                                    "description": "Cohort bucket size, applied to each subject's FIRST cohort event",
                                    "type": "string",
                                    "enum": [
                                      "day",
                                      "week",
                                      "month"
                                    ]
                                  },
                                  "cohort": {
                                    "description": "The starting event; empty filters mean any row of the entity",
                                    "type": "object",
                                    "default": {
                                      "filters": []
                                    },
                                    "properties": {
                                      "filters": {
                                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                        "type": "array",
                                        "default": [],
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "dimension",
                                            "eq"
                                          ],
                                          "properties": {
                                            "eq": {
                                              "type": [
                                                "string",
                                                "number",
                                                "boolean"
                                              ]
                                            },
                                            "dimension": {
                                              "description": "One declared dimension, or `props.<key>`, to group by",
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "entity": {
                                    "description": "Semantic view name from the catalog",
                                    "type": "string",
                                    "pattern": "^[a-z][a-z0-9_]*$"
                                  },
                                  "return": {
                                    "description": "The coming-back event; empty filters mean any row of the entity",
                                    "type": "object",
                                    "default": {
                                      "filters": []
                                    },
                                    "properties": {
                                      "filters": {
                                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                        "type": "array",
                                        "default": [],
                                        "items": {
                                          "type": "object",
                                          "required": [
                                            "dimension",
                                            "eq"
                                          ],
                                          "properties": {
                                            "eq": {
                                              "type": [
                                                "string",
                                                "number",
                                                "boolean"
                                              ]
                                            },
                                            "dimension": {
                                              "description": "One declared dimension, or `props.<key>`, to group by",
                                              "type": "string"
                                            }
                                          },
                                          "additionalProperties": false
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "subject": {
                                    "description": "Cohort key: \"identity\" or `props.<key>`",
                                    "type": "string"
                                  },
                                  "return_window_days": {
                                    "description": "Length of the window that opens on day N; a return event must fall inside it",
                                    "type": "integer",
                                    "default": 7,
                                    "minimum": 1,
                                    "maximum": 90
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "target": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "op",
                            "value"
                          ],
                          "properties": {
                            "op": {
                              "type": "string",
                              "enum": [
                                ">=",
                                "<=",
                                "="
                              ]
                            },
                            "value": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "window": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "from",
                            "to"
                          ],
                          "properties": {
                            "to": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "from": {
                              "type": "string",
                              "format": "date-time"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "relative"
                          ],
                          "properties": {
                            "relative": {
                              "type": "string",
                              "enum": [
                                "last_7d",
                                "last_30d",
                                "last_90d",
                                "cycle"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "display": {
                      "type": "string",
                      "enum": [
                        "line",
                        "bar",
                        "bold_number",
                        "table"
                      ],
                      "default": "line"
                    },
                    "formula": {
                      "default": null,
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "created_by": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "product_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "description": {
                      "type": "string",
                      "maxLength": 2000
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/insights/{idOrSlug}/run": {
      "post": {
        "operationId": "analytics_insight_run",
        "summary": "Run a saved insight of the current product and return its numbers: every series executed over the resolved window and aligned onto the same buckets, the formula evaluated bucket by bucket, a total per series, and whether the target was met.",
        "description": "Run a saved insight of the current product and return its numbers: every series executed over the resolved window and aligned onto the same buckets, the formula evaluated bucket by bucket, a total per series, and whether the target was met. The window comes from the stored definition — relative windows and the current cycle are resolved at call time — and `from` and `to` override it for this call only, changing nothing stored. Use this rather than rebuilding the insight out of analytics_metric_query calls: the alignment and the formula are what make the numbers comparable.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_insight_run",
        "parameters": [
          {
            "name": "idOrSlug",
            "in": "path",
            "required": true,
            "description": "The insight's slug, or its uuid",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "description": "Inclusive window start; overrides the stored window",
                    "type": "string",
                    "format": "date-time"
                  },
                  "to": {
                    "description": "Inclusive window end; overrides the stored window",
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "insight",
                    "window",
                    "series",
                    "formula",
                    "total",
                    "target_status"
                  ],
                  "properties": {
                    "extra": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "object",
                        "required": [
                          "cohort_size",
                          "retained"
                        ],
                        "properties": {
                          "retained": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cohort_size": {
                            "type": "integer"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "type": "object",
                      "additionalProperties": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    },
                    "series": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "bucket",
                            "value"
                          ],
                          "properties": {
                            "value": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "bucket": {
                              "description": "Bucket start, YYYY-MM-DD (UTC)",
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "window": {
                      "type": "object",
                      "required": [
                        "from",
                        "to",
                        "grain"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        },
                        "grain": {
                          "type": "string",
                          "enum": [
                            "day",
                            "week",
                            "month"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "formula": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "bucket",
                              "value"
                            ],
                            "properties": {
                              "value": {
                                "type": [
                                  "number",
                                  "null"
                                ]
                              },
                              "bucket": {
                                "description": "Bucket start, YYYY-MM-DD (UTC)",
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "insight": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "slug",
                            "name",
                            "kind",
                            "series",
                            "window",
                            "id",
                            "product_id",
                            "created_by",
                            "created_at",
                            "updated_at"
                          ],
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "kind": {
                              "type": "string",
                              "enum": [
                                "trend",
                                "funnel",
                                "number",
                                "retention"
                              ]
                            },
                            "name": {
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 120
                            },
                            "slug": {
                              "type": "string",
                              "pattern": "^[a-z0-9][a-z0-9-]{1,63}$"
                            },
                            "tags": {
                              "type": "array",
                              "default": [],
                              "maxItems": 20,
                              "items": {
                                "type": "string",
                                "maxLength": 40
                              }
                            },
                            "grain": {
                              "type": "string",
                              "enum": [
                                "day",
                                "week",
                                "month"
                              ],
                              "default": "day"
                            },
                            "series": {
                              "type": "array",
                              "minItems": 1,
                              "maxItems": 8,
                              "items": {
                                "type": "object",
                                "required": [
                                  "key",
                                  "request"
                                ],
                                "properties": {
                                  "key": {
                                    "type": "string",
                                    "pattern": "^[A-Z]$"
                                  },
                                  "request": {
                                    "anyOf": [
                                      {
                                        "type": "object",
                                        "required": [
                                          "entity",
                                          "metrics",
                                          "grain",
                                          "from",
                                          "to"
                                        ],
                                        "properties": {
                                          "to": {
                                            "description": "Inclusive last day (UTC)",
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                          },
                                          "from": {
                                            "description": "Inclusive first day (UTC)",
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                          },
                                          "grain": {
                                            "description": "Time bucket size",
                                            "type": "string",
                                            "enum": [
                                              "day",
                                              "week",
                                              "month"
                                            ]
                                          },
                                          "entity": {
                                            "description": "Semantic view name from the catalog",
                                            "type": "string",
                                            "pattern": "^[a-z][a-z0-9_]*$"
                                          },
                                          "filters": {
                                            "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                            "type": "array",
                                            "default": [],
                                            "items": {
                                              "type": "object",
                                              "required": [
                                                "dimension",
                                                "eq"
                                              ],
                                              "properties": {
                                                "eq": {
                                                  "type": [
                                                    "string",
                                                    "number",
                                                    "boolean"
                                                  ]
                                                },
                                                "dimension": {
                                                  "description": "One declared dimension, or `props.<key>`, to group by",
                                                  "type": "string"
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "metrics": {
                                            "description": "Declared metric names to compute",
                                            "type": "array",
                                            "minItems": 1,
                                            "items": {
                                              "type": "string",
                                              "pattern": "^[a-z][a-z0-9_]*$"
                                            }
                                          },
                                          "group_by": {
                                            "description": "One declared dimension, or `props.<key>`, to group by",
                                            "type": "string"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "required": [
                                          "steps",
                                          "from",
                                          "to"
                                        ],
                                        "properties": {
                                          "to": {
                                            "description": "Inclusive last day (UTC)",
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                          },
                                          "from": {
                                            "description": "Inclusive first day (UTC)",
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                          },
                                          "grain": {
                                            "description": "When set, also return per-step persons bucketed by step-entry time",
                                            "type": "string",
                                            "enum": [
                                              "day",
                                              "week",
                                              "month"
                                            ]
                                          },
                                          "steps": {
                                            "description": "Ordered funnel steps, 2 to 5",
                                            "type": "array",
                                            "minItems": 2,
                                            "maxItems": 5,
                                            "items": {
                                              "type": "object",
                                              "required": [
                                                "entity"
                                              ],
                                              "properties": {
                                                "entity": {
                                                  "description": "Semantic view name from the catalog; must declare identity columns",
                                                  "type": "string",
                                                  "pattern": "^[a-z][a-z0-9_]*$"
                                                },
                                                "filters": {
                                                  "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                                  "type": "array",
                                                  "default": [],
                                                  "items": {
                                                    "type": "object",
                                                    "required": [
                                                      "dimension",
                                                      "eq"
                                                    ],
                                                    "properties": {
                                                      "eq": {
                                                        "type": [
                                                          "string",
                                                          "number",
                                                          "boolean"
                                                        ]
                                                      },
                                                      "dimension": {
                                                        "description": "One declared dimension, or `props.<key>`, to group by",
                                                        "type": "string"
                                                      }
                                                    },
                                                    "additionalProperties": false
                                                  }
                                                }
                                              },
                                              "additionalProperties": false
                                            }
                                          },
                                          "window_days": {
                                            "description": "Maximum days between two CONSECUTIVE steps for the later one to count",
                                            "type": "integer",
                                            "default": 30,
                                            "minimum": 1,
                                            "maximum": 90
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      {
                                        "type": "object",
                                        "required": [
                                          "entity",
                                          "subject",
                                          "day",
                                          "from",
                                          "to",
                                          "grain"
                                        ],
                                        "properties": {
                                          "to": {
                                            "description": "Inclusive last day of the cohort range (UTC)",
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                          },
                                          "day": {
                                            "description": "N: a subject is retained if it has a return event at least N days after its cohort event",
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 365
                                          },
                                          "from": {
                                            "description": "Inclusive first day of the cohort range (UTC)",
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                          },
                                          "grain": {
                                            "description": "Cohort bucket size, applied to each subject's FIRST cohort event",
                                            "type": "string",
                                            "enum": [
                                              "day",
                                              "week",
                                              "month"
                                            ]
                                          },
                                          "cohort": {
                                            "description": "The starting event; empty filters mean any row of the entity",
                                            "type": "object",
                                            "default": {
                                              "filters": []
                                            },
                                            "properties": {
                                              "filters": {
                                                "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                                "type": "array",
                                                "default": [],
                                                "items": {
                                                  "type": "object",
                                                  "required": [
                                                    "dimension",
                                                    "eq"
                                                  ],
                                                  "properties": {
                                                    "eq": {
                                                      "type": [
                                                        "string",
                                                        "number",
                                                        "boolean"
                                                      ]
                                                    },
                                                    "dimension": {
                                                      "description": "One declared dimension, or `props.<key>`, to group by",
                                                      "type": "string"
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "entity": {
                                            "description": "Semantic view name from the catalog",
                                            "type": "string",
                                            "pattern": "^[a-z][a-z0-9_]*$"
                                          },
                                          "return": {
                                            "description": "The coming-back event; empty filters mean any row of the entity",
                                            "type": "object",
                                            "default": {
                                              "filters": []
                                            },
                                            "properties": {
                                              "filters": {
                                                "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                                                "type": "array",
                                                "default": [],
                                                "items": {
                                                  "type": "object",
                                                  "required": [
                                                    "dimension",
                                                    "eq"
                                                  ],
                                                  "properties": {
                                                    "eq": {
                                                      "type": [
                                                        "string",
                                                        "number",
                                                        "boolean"
                                                      ]
                                                    },
                                                    "dimension": {
                                                      "description": "One declared dimension, or `props.<key>`, to group by",
                                                      "type": "string"
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          "subject": {
                                            "description": "Cohort key: \"identity\" or `props.<key>`",
                                            "type": "string"
                                          },
                                          "return_window_days": {
                                            "description": "Length of the window that opens on day N; a return event must fall inside it",
                                            "type": "integer",
                                            "default": 7,
                                            "minimum": 1,
                                            "maximum": 90
                                          }
                                        },
                                        "additionalProperties": false
                                      }
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "target": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "op",
                                    "value"
                                  ],
                                  "properties": {
                                    "op": {
                                      "type": "string",
                                      "enum": [
                                        ">=",
                                        "<=",
                                        "="
                                      ]
                                    },
                                    "value": {
                                      "type": "number"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "window": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "required": [
                                    "from",
                                    "to"
                                  ],
                                  "properties": {
                                    "to": {
                                      "type": "string",
                                      "format": "date-time"
                                    },
                                    "from": {
                                      "type": "string",
                                      "format": "date-time"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                {
                                  "type": "object",
                                  "required": [
                                    "relative"
                                  ],
                                  "properties": {
                                    "relative": {
                                      "type": "string",
                                      "enum": [
                                        "last_7d",
                                        "last_30d",
                                        "last_90d",
                                        "cycle"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              ]
                            },
                            "display": {
                              "type": "string",
                              "enum": [
                                "line",
                                "bar",
                                "bold_number",
                                "table"
                              ],
                              "default": "line"
                            },
                            "formula": {
                              "default": null,
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 500
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "created_at": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "created_by": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "product_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "updated_at": {
                              "type": "string",
                              "format": "date-time"
                            },
                            "description": {
                              "type": "string",
                              "maxLength": 2000
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "target_status": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "met",
                            "missed"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/metrics/query": {
      "post": {
        "operationId": "analytics_metric_query",
        "summary": "Compute declared metrics from the analytics semantic layer for the current product, bucketed by time and optionally grouped by one declared dimension.",
        "description": "Compute declared metrics from the analytics semantic layer for the current product, bucketed by time and optionally grouped by one declared dimension. Deterministic: entity, metric and dimension names are resolved against the semantic catalog, never generated. Prefer this over analytics_query_run whenever the question is a metric over time — no LLM, no SQL generation. Where the catalog gives an entity a `propertiesColumn`, `group_by` and a filter dimension also accept `props.<key>` to read one raw event property; property values always compare as strings.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_metric_query",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity": {
                    "description": "Semantic view name from the catalog",
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]*$"
                  },
                  "metrics": {
                    "description": "Declared metric names to compute",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z][a-z0-9_]*$"
                    }
                  },
                  "grain": {
                    "description": "Time bucket size",
                    "type": "string",
                    "enum": [
                      "day",
                      "week",
                      "month"
                    ]
                  },
                  "from": {
                    "description": "Inclusive first day (UTC)",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "to": {
                    "description": "Inclusive last day (UTC)",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "group_by": {
                    "description": "One declared dimension, or `props.<key>`, to group by",
                    "type": "string"
                  },
                  "filters": {
                    "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                    "type": "array",
                    "default": [],
                    "items": {
                      "type": "object",
                      "required": [
                        "dimension",
                        "eq"
                      ],
                      "properties": {
                        "eq": {
                          "type": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        },
                        "dimension": {
                          "description": "One declared dimension, or `props.<key>`, to group by",
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "entity",
                  "metrics",
                  "grain",
                  "from",
                  "to"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "series",
                    "meta"
                  ],
                  "properties": {
                    "meta": {
                      "type": "object",
                      "required": [
                        "entity",
                        "grain",
                        "sql",
                        "source"
                      ],
                      "properties": {
                        "sql": {
                          "type": "string"
                        },
                        "grain": {
                          "type": "string",
                          "enum": [
                            "day",
                            "week",
                            "month"
                          ]
                        },
                        "entity": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string",
                          "enum": [
                            "rollup",
                            "live",
                            "mixed"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "series": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "ts",
                          "metric",
                          "value"
                        ],
                        "properties": {
                          "ts": {
                            "description": "Bucket start, YYYY-MM-DD (UTC)",
                            "type": "string"
                          },
                          "group": {
                            "type": "string"
                          },
                          "value": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "metric": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/persons/timeline": {
      "post": {
        "operationId": "analytics_person_timeline",
        "summary": "Return one resolved person's profile and their chronological activity across every identity-bearing semantic entity of the current product.",
        "description": "Return one resolved person's profile and their chronological activity across every identity-bearing semantic entity of the current product. Address the person either by person_id or by any single identifier (email, phone, users_id, anonymous_id), which is normalised exactly as the identity graph normalised it. Deterministic: no LLM, and only catalog-declared columns are returned. Prefer this over analytics_query_run whenever the question is about one specific person.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_person_timeline",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "person_id": {
                    "description": "Graph person id, when already known",
                    "type": "string",
                    "minLength": 1
                  },
                  "identifier": {
                    "description": "Any single identifier belonging to the person",
                    "type": "object",
                    "required": [
                      "type",
                      "value"
                    ],
                    "properties": {
                      "type": {
                        "description": "Which kind of identifier `value` is",
                        "type": "string",
                        "enum": [
                          "email",
                          "phone",
                          "users_id",
                          "anonymous_id"
                        ]
                      },
                      "value": {
                        "description": "Raw identifier; normalised server-side before lookup",
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "from": {
                    "description": "Inclusive first day (UTC); unbounded when omitted",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "to": {
                    "description": "Inclusive last day (UTC); unbounded when omitted",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "limit": {
                    "description": "Maximum events to return, newest first",
                    "type": "integer",
                    "default": 200,
                    "minimum": 1,
                    "maximum": 1000
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "person",
                    "events",
                    "truncated",
                    "meta"
                  ],
                  "properties": {
                    "meta": {
                      "type": "object",
                      "required": [
                        "entities",
                        "limit",
                        "sql"
                      ],
                      "properties": {
                        "sql": {
                          "type": "string"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "entities": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "ts",
                          "entity",
                          "fields"
                        ],
                        "properties": {
                          "ts": {
                            "description": "Event time, ISO-8601 (UTC)",
                            "type": "string"
                          },
                          "entity": {
                            "description": "Semantic view the event came from",
                            "type": "string"
                          },
                          "fields": {
                            "description": "Catalog-declared columns of that row",
                            "type": "object",
                            "additionalProperties": {}
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "person": {
                      "type": "object",
                      "required": [
                        "person_id",
                        "primary_email",
                        "primary_phone",
                        "users_id",
                        "first_seen",
                        "last_seen"
                      ],
                      "properties": {
                        "users_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "last_seen": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "person_id": {
                          "type": "string"
                        },
                        "first_seen": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "primary_email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "primary_phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/query": {
      "post": {
        "operationId": "analytics_query_run",
        "summary": "Answer a natural-language analytics question for the current product.",
        "description": "Answer a natural-language analytics question for the current product. Fallback surface: it routes the question to analytics_metric_query or analytics_funnel_run when it fits one of them and returns that tool's exact request and response in `structured`; it generates SQL only when neither fits. Call analytics_metric_query, analytics_funnel_run or analytics_person_timeline directly when you already know the shape of the question — those are deterministic and cheaper.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_query_run",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "description": "Natural-language analytics question",
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "q"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "answer",
                    "sql",
                    "rows",
                    "truncated",
                    "explanation"
                  ],
                  "properties": {
                    "sql": {
                      "type": "string"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": {}
                      }
                    },
                    "answer": {
                      "type": "string"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "structured": {
                      "type": "object",
                      "required": [
                        "kind",
                        "request",
                        "response"
                      ],
                      "properties": {
                        "kind": {
                          "description": "Which deterministic tool answered",
                          "type": "string",
                          "enum": [
                            "metric_query",
                            "funnel"
                          ]
                        },
                        "request": {
                          "description": "The exact tool input that was executed",
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "response": {
                          "description": "The exact tool output",
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "additionalProperties": false
                    },
                    "explanation": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/analytics/retention/run": {
      "post": {
        "operationId": "analytics_retention_run",
        "summary": "Measure day-N retention over the analytics semantic layer for the current product: of the subjects whose FIRST matching cohort event falls in a bucket, how many produced a return event on day N (within `return_window_days` after it).",
        "description": "Measure day-N retention over the analytics semantic layer for the current product: of the subjects whose FIRST matching cohort event falls in a bucket, how many produced a return event on day N (within `return_window_days` after it). The cohort key is `subject` — an event property (`props.<key>`, e.g. the customer product id) or `identity` for the entity's declared identity columns — and each subject is counted exactly once. Deterministic: entity and dimension names are resolved against the semantic catalog, never generated. A bucket whose day-N horizon has not elapsed yet is still returned, with `retained` and `rate` NULL rather than 0 — null means \"not measurable yet\", 0 means \"measured, nobody came back\", and a caller must not confuse them. `total` therefore covers the measurable buckets ONLY, so a half-elapsed cohort never drags the headline rate down; `meta.unmeasurable_buckets` says how many were left out.",
        "tags": [
          "Analytics"
        ],
        "x-mcp-tool": "analytics_retention_run",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entity": {
                    "description": "Semantic view name from the catalog",
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9_]*$"
                  },
                  "subject": {
                    "description": "Cohort key: \"identity\" or `props.<key>`",
                    "type": "string"
                  },
                  "cohort": {
                    "description": "The starting event; empty filters mean any row of the entity",
                    "type": "object",
                    "default": {
                      "filters": []
                    },
                    "properties": {
                      "filters": {
                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                        "type": "array",
                        "default": [],
                        "items": {
                          "type": "object",
                          "required": [
                            "dimension",
                            "eq"
                          ],
                          "properties": {
                            "eq": {
                              "type": [
                                "string",
                                "number",
                                "boolean"
                              ]
                            },
                            "dimension": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  "return": {
                    "description": "The coming-back event; empty filters mean any row of the entity",
                    "type": "object",
                    "default": {
                      "filters": []
                    },
                    "properties": {
                      "filters": {
                        "description": "Equality filters on declared dimensions, or on `props.<key>` event properties",
                        "type": "array",
                        "default": [],
                        "items": {
                          "type": "object",
                          "required": [
                            "dimension",
                            "eq"
                          ],
                          "properties": {
                            "eq": {
                              "type": [
                                "string",
                                "number",
                                "boolean"
                              ]
                            },
                            "dimension": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  "day": {
                    "description": "N: a subject is retained if it has a return event at least N days after its cohort event",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  },
                  "return_window_days": {
                    "description": "Length of the window that opens on day N; a return event must fall inside it",
                    "type": "integer",
                    "default": 7,
                    "minimum": 1,
                    "maximum": 90
                  },
                  "from": {
                    "description": "Inclusive first day of the cohort range (UTC)",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "to": {
                    "description": "Inclusive last day of the cohort range (UTC)",
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "grain": {
                    "description": "Cohort bucket size, applied to each subject's FIRST cohort event",
                    "type": "string",
                    "enum": [
                      "day",
                      "week",
                      "month"
                    ]
                  }
                },
                "required": [
                  "entity",
                  "subject",
                  "day",
                  "from",
                  "to",
                  "grain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "buckets",
                    "total",
                    "meta"
                  ],
                  "properties": {
                    "meta": {
                      "type": "object",
                      "required": [
                        "entity",
                        "subject",
                        "from",
                        "to",
                        "grain",
                        "day",
                        "return_window_days",
                        "unmeasurable_buckets",
                        "sql",
                        "source"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "day": {
                          "type": "integer"
                        },
                        "sql": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        },
                        "grain": {
                          "type": "string",
                          "enum": [
                            "day",
                            "week",
                            "month"
                          ]
                        },
                        "entity": {
                          "type": "string"
                        },
                        "source": {
                          "type": "string",
                          "const": "live"
                        },
                        "subject": {
                          "type": "string"
                        },
                        "return_window_days": {
                          "type": "integer"
                        },
                        "unmeasurable_buckets": {
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "total": {
                      "type": "object",
                      "required": [
                        "cohort_size",
                        "retained",
                        "rate"
                      ],
                      "properties": {
                        "rate": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "retained": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "cohort_size": {
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "buckets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "bucket",
                          "cohort_size",
                          "retained",
                          "rate"
                        ],
                        "properties": {
                          "rate": {
                            "description": "retained / cohort_size; null when not measurable yet or the cohort is empty",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "bucket": {
                            "description": "Bucket start, YYYY-MM-DD (UTC)",
                            "type": "string"
                          },
                          "retained": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "cohort_size": {
                            "type": "integer"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/admin/shared-memory/reset": {
      "post": {
        "operationId": "brain_product_shared_memory_reset",
        "summary": "DESTRUCTIVE admin op: reset a product's SHARED Brain memory (vectors + knowledge graph) and clear its connector_state so a re-ingest re-writes.",
        "description": "DESTRUCTIVE admin op: reset a product's SHARED Brain memory (vectors + knowledge graph) and clear its connector_state so a re-ingest re-writes. Requires confirm:true AND confirmProductId echo; gated by an env arm flag, an env allowlist, and governance access.",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_product_shared_memory_reset",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "description": "Explicit product id whose SHARED memory will be wiped. Never inferred from ambient context.",
                    "type": "string",
                    "minLength": 1
                  },
                  "confirmProductId": {
                    "description": "Must EXACTLY equal productId (double-entry confirmation).",
                    "type": "string",
                    "minLength": 1
                  },
                  "confirm": {
                    "description": "Must be true to proceed. Guards against accidental invocation.",
                    "type": "boolean"
                  }
                },
                "required": [
                  "productId",
                  "confirmProductId",
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "scope",
                    "vectorsDeleted",
                    "graphDeleted",
                    "connectorStateRowsCleared"
                  ],
                  "properties": {
                    "scope": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "graphDeleted": {
                      "type": "number"
                    },
                    "vectorsDeleted": {
                      "type": "number"
                    },
                    "connectorStateRowsCleared": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/backups": {
      "get": {
        "operationId": "brain_backups_list",
        "summary": "List the current product's backups (most recent first).",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_backups_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "snapshotId",
                      "gcsPath",
                      "status",
                      "nodeCount",
                      "edgeCount",
                      "sizeBytes",
                      "trigger",
                      "engineVersion",
                      "embeddingDims",
                      "error",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "error": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "running",
                          "completed",
                          "failed"
                        ]
                      },
                      "gcsPath": {
                        "type": "string"
                      },
                      "trigger": {
                        "type": "string",
                        "enum": [
                          "scheduled",
                          "manual",
                          "pre-restore"
                        ]
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "edgeCount": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "nodeCount": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "productId": {
                        "type": "string"
                      },
                      "sizeBytes": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "snapshotId": {
                        "type": "string"
                      },
                      "embeddingDims": {
                        "type": [
                          "number",
                          "null"
                        ]
                      },
                      "engineVersion": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "brain_backup_create",
        "summary": "Request an on-demand point-in-time backup of the current product's Brain memory.",
        "description": "Request an on-demand point-in-time backup of the current product's Brain memory. Async (202): records a running snapshot and runs the backup in the background — returns { accepted, snapshotId }; poll brain_backups_list / brain_backup_status for completion. Rejects (409) if a backup is already running for the product.",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_backup_create",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accepted",
                    "snapshotId"
                  ],
                  "properties": {
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    },
                    "snapshotId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/backups/{snapshotId}": {
      "get": {
        "operationId": "brain_backup_status",
        "summary": "Get a backup status by snapshot id, or the latest backup for the current product.",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_backup_status",
        "parameters": [
          {
            "name": "snapshotId",
            "in": "path",
            "required": true,
            "description": "Specific snapshot to look up; omit for the latest.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "id",
                        "productId",
                        "snapshotId",
                        "gcsPath",
                        "status",
                        "nodeCount",
                        "edgeCount",
                        "sizeBytes",
                        "trigger",
                        "engineVersion",
                        "embeddingDims",
                        "error",
                        "createdAt",
                        "updatedAt"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "error": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "running",
                            "completed",
                            "failed"
                          ]
                        },
                        "gcsPath": {
                          "type": "string"
                        },
                        "trigger": {
                          "type": "string",
                          "enum": [
                            "scheduled",
                            "manual",
                            "pre-restore"
                          ]
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "edgeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "nodeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "productId": {
                          "type": "string"
                        },
                        "sizeBytes": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "snapshotId": {
                          "type": "string"
                        },
                        "embeddingDims": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "engineVersion": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/clickup/channels": {
      "get": {
        "operationId": "brain_clickup_channels_list",
        "summary": "List the chat channels in a ClickUp workspace connection (for selecting channels to ingest)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_clickup_channels_list",
        "parameters": [
          {
            "name": "connectorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "channelId",
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "channelId": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/clickup/connections": {
      "get": {
        "operationId": "brain_clickup_connections_list",
        "summary": "List the ClickUp workspace connections available to the current product",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_clickup_connections_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "connectorId",
                      "workspaceId",
                      "workspaceName",
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "connectorId": {
                        "type": "string"
                      },
                      "workspaceId": {
                        "type": "string"
                      },
                      "workspaceName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/clickup/lists": {
      "get": {
        "operationId": "brain_clickup_lists_list",
        "summary": "List all lists in a ClickUp space (folderless and within folders, optionally filtered by search)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_clickup_lists_list",
        "parameters": [
          {
            "name": "connectorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "spaceId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "listId",
                      "name",
                      "folderId",
                      "folderName",
                      "archived"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "listId": {
                        "type": "string"
                      },
                      "archived": {
                        "type": "boolean"
                      },
                      "folderId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "folderName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/clickup/spaces": {
      "get": {
        "operationId": "brain_clickup_spaces_list",
        "summary": "List the spaces in a ClickUp connection (optionally filtered by search)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_clickup_spaces_list",
        "parameters": [
          {
            "name": "connectorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "spaceId",
                      "name",
                      "archived"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "spaceId": {
                        "type": "string"
                      },
                      "archived": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/cognition/digest": {
      "post": {
        "operationId": "brain_cognition_digest",
        "summary": "Queue a System-2 digest over the product shared pool (async); returns { accepted, run_id }.",
        "description": "Queue a System-2 digest over the product shared pool (async); returns { accepted, run_id }. Poll brain_cognition_status for the result.",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_cognition_digest",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accepted",
                    "run_id"
                  ],
                  "properties": {
                    "run_id": {
                      "type": "string"
                    },
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/cognition/status": {
      "get": {
        "operationId": "brain_cognition_status",
        "summary": "Read the engine-global System-2 queue gauge plus this product's last digest/sweep run (status, counts, timing).",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_cognition_status",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "engine",
                    "digest",
                    "sweep"
                  ],
                  "properties": {
                    "sweep": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "run_id",
                            "kind",
                            "status",
                            "error",
                            "started_at",
                            "finished_at"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "digest",
                                "sweep"
                              ]
                            },
                            "error": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "result": {},
                            "run_id": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "finished_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "digest": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "run_id",
                            "kind",
                            "status",
                            "error",
                            "started_at",
                            "finished_at"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "digest",
                                "sweep"
                              ]
                            },
                            "error": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "result": {},
                            "run_id": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "started_at": {
                              "type": "string"
                            },
                            "finished_at": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "engine": {
                      "type": "object",
                      "required": [
                        "running",
                        "queue_size",
                        "trigger_mode"
                      ],
                      "properties": {
                        "running": {
                          "type": "boolean"
                        },
                        "queue_size": {
                          "type": "number"
                        },
                        "trigger_mode": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/cognition/sweep": {
      "post": {
        "operationId": "brain_cognition_sweep",
        "summary": "Queue a cross-domain sweep over the product shared pool (async); returns { accepted, run_id }.",
        "description": "Queue a cross-domain sweep over the product shared pool (async); returns { accepted, run_id }. Poll brain_cognition_status for the result.",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_cognition_sweep",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accepted",
                    "run_id"
                  ],
                  "properties": {
                    "run_id": {
                      "type": "string"
                    },
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons": {
      "get": {
        "operationId": "brain_daemons_list",
        "summary": "List configured ingestion daemons for this product",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemons_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "type",
                      "name",
                      "owner",
                      "repo",
                      "branch",
                      "connectorId",
                      "enabled",
                      "lastRunAt",
                      "loadMode",
                      "model",
                      "sourceAuthority",
                      "effectiveModel",
                      "degradedCount",
                      "unmeasuredCount"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "repo": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "type": {
                        "type": "string"
                      },
                      "model": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "owner": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "branch": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "config": {},
                      "enabled": {
                        "type": "boolean"
                      },
                      "loadMode": {
                        "type": "string"
                      },
                      "lastRunAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastResult": {},
                      "connectorId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "clickupConfig": {},
                      "degradedCount": {
                        "type": "number"
                      },
                      "effectiveModel": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "sourceAuthority": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "unmeasuredCount": {
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "brain_daemon_create",
        "summary": "Create a new ingestion daemon (github, clickup or gdrive)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_create",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "github",
                      "clickup",
                      "gdrive"
                    ],
                    "default": "github"
                  },
                  "name": {
                    "type": "string"
                  },
                  "connectorId": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "owner": {
                    "type": "string"
                  },
                  "repo": {
                    "type": "string"
                  },
                  "branch": {
                    "type": "string",
                    "default": "main"
                  },
                  "config": {
                    "type": "string"
                  },
                  "clickupConfig": {
                    "type": "object",
                    "required": [
                      "workspaceId",
                      "workspaceName",
                      "spaceId",
                      "spaceName",
                      "listId",
                      "listName"
                    ],
                    "properties": {
                      "listId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "content": {
                        "type": "object",
                        "default": {},
                        "properties": {
                          "chat": {
                            "type": "boolean",
                            "default": false
                          },
                          "docs": {
                            "type": "boolean",
                            "default": true
                          },
                          "tasks": {
                            "type": "boolean",
                            "default": true
                          },
                          "comments": {
                            "type": "boolean",
                            "default": true
                          }
                        },
                        "additionalProperties": false
                      },
                      "spaceId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "listName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "spaceName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "workspaceId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "chatChannels": {
                        "type": "array",
                        "default": [],
                        "items": {
                          "type": "object",
                          "required": [
                            "channelId",
                            "name"
                          ],
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "channelId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "initialWindow": {
                        "type": "string",
                        "enum": [
                          "7d",
                          "30d",
                          "90d",
                          "all"
                        ]
                      },
                      "workspaceName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "loadMode": {
                    "type": "string",
                    "enum": [
                      "hot",
                      "batch"
                    ],
                    "default": "hot"
                  },
                  "model": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "sourceAuthority": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "policy",
                          "official",
                          "team",
                          "informal"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "name",
                    "owner",
                    "repo",
                    "branch",
                    "connectorId",
                    "enabled",
                    "lastRunAt",
                    "loadMode",
                    "model",
                    "sourceAuthority",
                    "effectiveModel",
                    "degradedCount",
                    "unmeasuredCount"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "repo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string"
                    },
                    "model": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "owner": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "branch": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "config": {},
                    "enabled": {
                      "type": "boolean"
                    },
                    "loadMode": {
                      "type": "string"
                    },
                    "lastRunAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastResult": {},
                    "connectorId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "clickupConfig": {},
                    "degradedCount": {
                      "type": "number"
                    },
                    "effectiveModel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sourceAuthority": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "unmeasuredCount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons/{id}": {
      "delete": {
        "operationId": "brain_daemon_remove",
        "summary": "Remove an ingestion daemon and its connector state (leaves ingested memory)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_remove",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "brain_daemon_get",
        "summary": "Get a specific ingestion daemon by id",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "name",
                    "owner",
                    "repo",
                    "branch",
                    "connectorId",
                    "enabled",
                    "lastRunAt",
                    "loadMode",
                    "model",
                    "sourceAuthority",
                    "effectiveModel",
                    "degradedCount",
                    "unmeasuredCount"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "repo": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "type": {
                      "type": "string"
                    },
                    "model": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "owner": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "branch": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "config": {},
                    "enabled": {
                      "type": "boolean"
                    },
                    "loadMode": {
                      "type": "string"
                    },
                    "lastRunAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastResult": {},
                    "connectorId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "clickupConfig": {},
                    "degradedCount": {
                      "type": "number"
                    },
                    "effectiveModel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sourceAuthority": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "unmeasuredCount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "brain_daemon_update",
        "summary": "Update an ingestion daemon (config, enabled, name, branch)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "config": {
                    "type": "string"
                  },
                  "clickupConfig": {
                    "type": "object",
                    "required": [
                      "workspaceId",
                      "workspaceName",
                      "spaceId",
                      "spaceName",
                      "listId",
                      "listName"
                    ],
                    "properties": {
                      "listId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "content": {
                        "type": "object",
                        "default": {},
                        "properties": {
                          "chat": {
                            "type": "boolean",
                            "default": false
                          },
                          "docs": {
                            "type": "boolean",
                            "default": true
                          },
                          "tasks": {
                            "type": "boolean",
                            "default": true
                          },
                          "comments": {
                            "type": "boolean",
                            "default": true
                          }
                        },
                        "additionalProperties": false
                      },
                      "spaceId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "listName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "spaceName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "workspaceId": {
                        "type": "string",
                        "minLength": 1
                      },
                      "chatChannels": {
                        "type": "array",
                        "default": [],
                        "items": {
                          "type": "object",
                          "required": [
                            "channelId",
                            "name"
                          ],
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "channelId": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "initialWindow": {
                        "type": "string",
                        "enum": [
                          "7d",
                          "30d",
                          "90d",
                          "all"
                        ]
                      },
                      "workspaceName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "branch": {
                    "type": "string"
                  },
                  "loadMode": {
                    "type": "string",
                    "enum": [
                      "hot",
                      "batch"
                    ]
                  },
                  "model": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "sourceAuthority": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "policy",
                          "official",
                          "team",
                          "informal"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons/{id}/batch-status": {
      "get": {
        "operationId": "brain_daemon_batch_status",
        "summary": "Get batch ingestion status for a daemon (pending count, job, ETA, model, outcome)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_batch_status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "daemonId",
                    "loadMode",
                    "supportsBatch",
                    "model",
                    "effectiveModel",
                    "pendingCount",
                    "run"
                  ],
                  "properties": {
                    "run": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "runId",
                            "status",
                            "batchJobId",
                            "submittedAt",
                            "startedAt",
                            "finishedAt",
                            "model",
                            "polls",
                            "pollIntervalMs",
                            "elapsedMs",
                            "etaAt",
                            "etaMs",
                            "outcome",
                            "counts",
                            "errorMessage"
                          ],
                          "properties": {
                            "etaAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "etaMs": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "model": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "polls": {
                              "type": "number"
                            },
                            "runId": {
                              "type": "string"
                            },
                            "counts": {
                              "type": "object",
                              "properties": {
                                "errored": {
                                  "type": "number"
                                },
                                "finalized": {
                                  "type": "number"
                                },
                                "submitted": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            },
                            "status": {
                              "type": "string"
                            },
                            "outcome": {
                              "anyOf": [
                                {
                                  "type": "string",
                                  "enum": [
                                    "finalized",
                                    "finalized-with-fallback",
                                    "below-min-files",
                                    "nothing-submitted",
                                    "timeout",
                                    "failed",
                                    "finalize-failed",
                                    "crash"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "elapsedMs": {
                              "type": [
                                "number",
                                "null"
                              ]
                            },
                            "startedAt": {
                              "type": "string"
                            },
                            "batchJobId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "finishedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "submittedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "errorMessage": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "pollIntervalMs": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "model": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "daemonId": {
                      "type": "string"
                    },
                    "loadMode": {
                      "type": "string"
                    },
                    "pendingCount": {
                      "type": "number"
                    },
                    "supportsBatch": {
                      "type": "boolean"
                    },
                    "effectiveModel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons/{id}/reingest": {
      "post": {
        "operationId": "brain_daemon_reingest",
        "summary": "Force re-ingest of specific document paths for a daemon: clears their stored content hash and triggers a realtime run, so degraded or never-measured documents are re-extracted instead of hash-skipped forever",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_reingest",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "paths": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "paths"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cleared",
                    "notFound",
                    "skippedPending",
                    "triggered"
                  ],
                  "properties": {
                    "cleared": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "notFound": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "triggered": {
                      "type": "boolean"
                    },
                    "triggerError": {
                      "type": "string"
                    },
                    "skippedPending": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons/{id}/run": {
      "post": {
        "operationId": "brain_daemon_run",
        "summary": "Trigger an immediate run for a daemon and return its current status",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_run",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId",
                    "status",
                    "done",
                    "sources",
                    "progress",
                    "triggered",
                    "routedTo"
                  ],
                  "properties": {
                    "done": {
                      "type": "boolean"
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "running",
                        "done",
                        "failed",
                        "none"
                      ]
                    },
                    "sources": {
                      "type": "array",
                      "items": {}
                    },
                    "progress": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "counts",
                            "byCategory"
                          ],
                          "properties": {
                            "counts": {
                              "type": "object",
                              "required": [
                                "discovered",
                                "fetched",
                                "ingested",
                                "skippedUnchanged",
                                "denied",
                                "error"
                              ],
                              "properties": {
                                "error": {
                                  "type": "number"
                                },
                                "denied": {
                                  "type": "number"
                                },
                                "fetched": {
                                  "type": "number"
                                },
                                "ingested": {
                                  "type": "number"
                                },
                                "discovered": {
                                  "type": "number"
                                },
                                "skippedUnchanged": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            },
                            "byCategory": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "object",
                                "required": [
                                  "discovered",
                                  "fetched",
                                  "ingested",
                                  "skippedUnchanged",
                                  "denied",
                                  "error"
                                ],
                                "properties": {
                                  "error": {
                                    "type": "number"
                                  },
                                  "denied": {
                                    "type": "number"
                                  },
                                  "fetched": {
                                    "type": "number"
                                  },
                                  "ingested": {
                                    "type": "number"
                                  },
                                  "discovered": {
                                    "type": "number"
                                  },
                                  "skippedUnchanged": {
                                    "type": "number"
                                  }
                                },
                                "additionalProperties": false
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "routedTo": {
                      "type": "string",
                      "enum": [
                        "realtime",
                        "batch"
                      ]
                    },
                    "triggered": {
                      "type": "boolean"
                    },
                    "triggerError": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons/{id}/runs": {
      "get": {
        "operationId": "brain_daemon_runs",
        "summary": "Recent run history for a daemon with per-run ingest counts",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_runs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "daemonId",
                    "runs"
                  ],
                  "properties": {
                    "runs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "runId",
                          "status",
                          "lane",
                          "outcome",
                          "startedAt",
                          "finishedAt",
                          "counts",
                          "deniedCount",
                          "errorCount",
                          "degradedCount"
                        ],
                        "properties": {
                          "lane": {
                            "type": "string",
                            "enum": [
                              "realtime",
                              "batch",
                              "reclaimed"
                            ]
                          },
                          "runId": {
                            "type": "string"
                          },
                          "counts": {
                            "type": "object",
                            "required": [
                              "discovered",
                              "fetched",
                              "ingested",
                              "skippedUnchanged",
                              "denied",
                              "error"
                            ],
                            "properties": {
                              "error": {
                                "type": "number"
                              },
                              "denied": {
                                "type": "number"
                              },
                              "fetched": {
                                "type": "number"
                              },
                              "ingested": {
                                "type": "number"
                              },
                              "discovered": {
                                "type": "number"
                              },
                              "skippedUnchanged": {
                                "type": "number"
                              }
                            },
                            "additionalProperties": false
                          },
                          "status": {
                            "type": "string"
                          },
                          "outcome": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "startedAt": {
                            "type": "string"
                          },
                          "errorCount": {
                            "type": "number"
                          },
                          "finishedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "deniedCount": {
                            "type": "number"
                          },
                          "degradedCount": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "daemonId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons/{id}/status": {
      "get": {
        "operationId": "brain_daemon_status",
        "summary": "Get the latest run status for a daemon",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId",
                    "status",
                    "done",
                    "sources",
                    "progress"
                  ],
                  "properties": {
                    "done": {
                      "type": "boolean"
                    },
                    "runId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "running",
                        "done",
                        "failed",
                        "none"
                      ]
                    },
                    "sources": {
                      "type": "array",
                      "items": {}
                    },
                    "progress": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "counts",
                            "byCategory"
                          ],
                          "properties": {
                            "counts": {
                              "type": "object",
                              "required": [
                                "discovered",
                                "fetched",
                                "ingested",
                                "skippedUnchanged",
                                "denied",
                                "error"
                              ],
                              "properties": {
                                "error": {
                                  "type": "number"
                                },
                                "denied": {
                                  "type": "number"
                                },
                                "fetched": {
                                  "type": "number"
                                },
                                "ingested": {
                                  "type": "number"
                                },
                                "discovered": {
                                  "type": "number"
                                },
                                "skippedUnchanged": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            },
                            "byCategory": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "object",
                                "required": [
                                  "discovered",
                                  "fetched",
                                  "ingested",
                                  "skippedUnchanged",
                                  "denied",
                                  "error"
                                ],
                                "properties": {
                                  "error": {
                                    "type": "number"
                                  },
                                  "denied": {
                                    "type": "number"
                                  },
                                  "fetched": {
                                    "type": "number"
                                  },
                                  "ingested": {
                                    "type": "number"
                                  },
                                  "discovered": {
                                    "type": "number"
                                  },
                                  "skippedUnchanged": {
                                    "type": "number"
                                  }
                                },
                                "additionalProperties": false
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons/gdrive/connections": {
      "get": {
        "operationId": "brain_gdrive_connections_list",
        "summary": "List Google Drive connections for this product with their picked files",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_gdrive_connections_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "connectorId",
                      "email",
                      "displayName",
                      "pickedFiles"
                    ],
                    "properties": {
                      "email": {
                        "type": "string"
                      },
                      "connectorId": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "pickedFiles": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "id",
                            "name",
                            "mimeType"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "mimeType": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/daemons/runs/{runId}/items": {
      "get": {
        "operationId": "brain_daemon_run_items",
        "summary": "List the per-item ingest ledger for a run (filter by outcome, esp.",
        "description": "List the per-item ingest ledger for a run (filter by outcome, esp. denied)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_daemon_run_items",
        "parameters": [
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "discovered",
                "fetched",
                "ingested",
                "skipped_unchanged",
                "denied",
                "error"
              ]
            }
          },
          {
            "name": "sourceKind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "runId",
                    "counts",
                    "items",
                    "nextCursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "sourceKind",
                          "itemId",
                          "outcome",
                          "reason",
                          "updatedAt"
                        ],
                        "properties": {
                          "itemId": {
                            "type": "string"
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "outcome": {
                            "type": "string",
                            "enum": [
                              "discovered",
                              "fetched",
                              "ingested",
                              "skipped_unchanged",
                              "denied",
                              "error"
                            ]
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "sourceKind": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "runId": {
                      "type": "string"
                    },
                    "counts": {
                      "type": "object",
                      "required": [
                        "discovered",
                        "fetched",
                        "ingested",
                        "skippedUnchanged",
                        "denied",
                        "error"
                      ],
                      "properties": {
                        "error": {
                          "type": "number"
                        },
                        "denied": {
                          "type": "number"
                        },
                        "fetched": {
                          "type": "number"
                        },
                        "ingested": {
                          "type": "number"
                        },
                        "discovered": {
                          "type": "number"
                        },
                        "skippedUnchanged": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/knowledge/entities": {
      "get": {
        "operationId": "brain_knowledge_search",
        "summary": "Search product knowledge-graph entities (Feature, Decision, Risk, …) for the current product",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_knowledge_search",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Filter by entity name / alias substring",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entity_type",
            "in": "query",
            "required": false,
            "description": "Filter by ontology entity type (e.g. Feature, Integration)",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max entities",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Pagination offset",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Read scope; 'both' (default) unions shared + your private",
            "schema": {
              "type": "string",
              "enum": [
                "shared",
                "private",
                "both"
              ],
              "default": "both"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "entities",
                    "total",
                    "request_id",
                    "elapsed_ms"
                  ],
                  "properties": {
                    "total": {
                      "type": "number"
                    },
                    "entities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "entity_id",
                          "entity_type",
                          "canonical_name",
                          "display_name",
                          "aliases",
                          "description",
                          "evidence_count"
                        ],
                        "properties": {
                          "score": {
                            "type": "number"
                          },
                          "aliases": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "entity_id": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entity_type": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "canonical_name": {
                            "type": "string"
                          },
                          "evidence_count": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "elapsed_ms": {
                      "type": "number"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/knowledge/entities/{entity_ref}/memories": {
      "get": {
        "operationId": "brain_knowledge_entity_memories",
        "summary": "List the memories a knowledge entity was extracted from (its DERIVED_FROM evidence)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_knowledge_entity_memories",
        "parameters": [
          {
            "name": "entity_ref",
            "in": "path",
            "required": true,
            "description": "Entity id, name, or alias to fetch backing memories for",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max memories (default 50)",
            "schema": {
              "type": "integer",
              "maximum": 200,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Pagination offset",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Read scope; 'both' (default) unions shared + your private",
            "schema": {
              "type": "string",
              "enum": [
                "shared",
                "private",
                "both"
              ],
              "default": "both"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "entity",
                    "memories",
                    "total",
                    "request_id",
                    "elapsed_ms"
                  ],
                  "properties": {
                    "total": {
                      "type": "number"
                    },
                    "entity": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "entity_id",
                            "entity_type",
                            "canonical_name",
                            "display_name",
                            "aliases",
                            "description",
                            "evidence_count"
                          ],
                          "properties": {
                            "score": {
                              "type": "number"
                            },
                            "aliases": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "entity_id": {
                              "type": "string"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "entity_type": {
                              "type": "string"
                            },
                            "display_name": {
                              "type": "string"
                            },
                            "canonical_name": {
                              "type": "string"
                            },
                            "evidence_count": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "memories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "memory_id",
                          "content",
                          "layer",
                          "status",
                          "memory_at",
                          "gmt_created",
                          "user_id",
                          "agent_id",
                          "session_id",
                          "speculate",
                          "source_raw_memory_id",
                          "tags",
                          "custom",
                          "source_authority",
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "description": "Consumer-facing label derived from the layer; 'unknown' for an unrecognised layer",
                            "type": "string",
                            "enum": [
                              "schema",
                              "intention",
                              "identity",
                              "basic",
                              "fact",
                              "summary",
                              "knowledge",
                              "raw",
                              "unknown"
                            ]
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "layer": {
                            "description": "Engine memory layer (l0_basic_info…l7_intention)",
                            "type": "string",
                            "enum": [
                              "l6_schema",
                              "l7_intention",
                              "l4_identity",
                              "l0_basic_info",
                              "l2_fact",
                              "l3_summary",
                              "l5_knowledge",
                              "l1_raw"
                            ]
                          },
                          "custom": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "status": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "user_id": {
                            "type": "string"
                          },
                          "agent_id": {
                            "type": "string"
                          },
                          "memory_at": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "memory_id": {
                            "type": "string"
                          },
                          "speculate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "session_id": {
                            "type": "string"
                          },
                          "gmt_created": {
                            "type": "number"
                          },
                          "source_authority": {
                            "description": "Source authority (highest→lowest): policy > official > team > informal",
                            "type": "string",
                            "enum": [
                              "policy",
                              "official",
                              "team",
                              "informal"
                            ]
                          },
                          "source_raw_memory_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "elapsed_ms": {
                      "type": "number"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/knowledge/entities/{entity_ref}/neighborhood": {
      "get": {
        "operationId": "brain_knowledge_neighborhood",
        "summary": "Expand the neighborhood (related entities + relations) around one knowledge entity",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_knowledge_neighborhood",
        "parameters": [
          {
            "name": "entity_ref",
            "in": "path",
            "required": true,
            "description": "Entity id or name to expand around",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "depth",
            "in": "query",
            "required": false,
            "description": "Hops to expand (engine clamps to 3)",
            "schema": {
              "type": "integer",
              "maximum": 3,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "relation_type",
            "in": "query",
            "required": false,
            "description": "Only traverse this relation type",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "entity_type",
            "in": "query",
            "required": false,
            "description": "Only include neighbors of this entity type",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max neighbors",
            "schema": {
              "type": "integer",
              "maximum": 200,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Read scope; 'both' (default) unions shared + your private",
            "schema": {
              "type": "string",
              "enum": [
                "shared",
                "private",
                "both"
              ],
              "default": "both"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "root",
                    "entities",
                    "relations",
                    "request_id",
                    "elapsed_ms"
                  ],
                  "properties": {
                    "root": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "entity_id",
                            "entity_type",
                            "canonical_name",
                            "display_name",
                            "aliases",
                            "description",
                            "evidence_count"
                          ],
                          "properties": {
                            "score": {
                              "type": "number"
                            },
                            "aliases": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "entity_id": {
                              "type": "string"
                            },
                            "description": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "entity_type": {
                              "type": "string"
                            },
                            "display_name": {
                              "type": "string"
                            },
                            "canonical_name": {
                              "type": "string"
                            },
                            "evidence_count": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "entities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "entity_id",
                          "entity_type",
                          "canonical_name",
                          "display_name",
                          "aliases",
                          "description",
                          "evidence_count"
                        ],
                        "properties": {
                          "score": {
                            "type": "number"
                          },
                          "aliases": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "entity_id": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entity_type": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "canonical_name": {
                            "type": "string"
                          },
                          "evidence_count": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "relations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "source_id",
                          "target_id",
                          "relation_type",
                          "symmetric",
                          "reason",
                          "source_display_name",
                          "source_canonical_name",
                          "target_display_name",
                          "target_canonical_name"
                        ],
                        "properties": {
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "symmetric": {
                            "type": "boolean"
                          },
                          "target_id": {
                            "type": "string"
                          },
                          "relation_type": {
                            "type": "string"
                          },
                          "source_display_name": {
                            "type": "string"
                          },
                          "target_display_name": {
                            "type": "string"
                          },
                          "source_canonical_name": {
                            "type": "string"
                          },
                          "target_canonical_name": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "elapsed_ms": {
                      "type": "number"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/knowledge/graph": {
      "get": {
        "operationId": "brain_knowledge_graph",
        "summary": "Export the product knowledge graph (entities + typed relations) as nodes and edges; truncation keeps the highest-degree nodes, so a small limit returns the hub concepts",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_knowledge_graph",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max nodes (default 5000). When the cap applies the HIGHEST-DEGREE nodes are kept, so a small limit (e.g. 100) returns the hub concepts — that is usually what you want",
            "schema": {
              "type": "integer",
              "maximum": 5000,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Read scope; 'both' (default) unions shared + your private",
            "schema": {
              "type": "string",
              "enum": [
                "shared",
                "private",
                "both"
              ],
              "default": "both"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "nodes",
                    "edges",
                    "totals",
                    "truncated",
                    "request_id",
                    "elapsed_ms"
                  ],
                  "properties": {
                    "edges": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "source",
                          "target",
                          "relation_type",
                          "symmetric",
                          "reason"
                        ],
                        "properties": {
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": "string"
                          },
                          "target": {
                            "type": "string"
                          },
                          "symmetric": {
                            "type": "boolean"
                          },
                          "relation_type": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nodes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "entity_type",
                          "canonical_name",
                          "display_name",
                          "aliases",
                          "description",
                          "evidence_count",
                          "degree"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "degree": {
                            "type": "number"
                          },
                          "aliases": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "entity_type": {
                            "type": "string"
                          },
                          "display_name": {
                            "type": "string"
                          },
                          "canonical_name": {
                            "type": "string"
                          },
                          "evidence_count": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "totals": {
                      "type": "object",
                      "required": [
                        "nodeCount",
                        "edgeCount"
                      ],
                      "properties": {
                        "edgeCount": {
                          "type": "number"
                        },
                        "nodeCount": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "elapsed_ms": {
                      "type": "number"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/knowledge/relations": {
      "get": {
        "operationId": "brain_knowledge_relations",
        "summary": "List typed relations (depends_on, competes_with, …) in the product knowledge graph",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_knowledge_relations",
        "parameters": [
          {
            "name": "relation_type",
            "in": "query",
            "required": false,
            "description": "Filter by ontology relation type (e.g. depends_on)",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "source_entity",
            "in": "query",
            "required": false,
            "description": "Filter by source entity id or name",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "target_entity",
            "in": "query",
            "required": false,
            "description": "Filter by target entity id or name",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max relations",
            "schema": {
              "type": "integer",
              "maximum": 200,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Read scope; 'both' (default) unions shared + your private",
            "schema": {
              "type": "string",
              "enum": [
                "shared",
                "private",
                "both"
              ],
              "default": "both"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "relations",
                    "request_id",
                    "elapsed_ms"
                  ],
                  "properties": {
                    "relations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "source_id",
                          "target_id",
                          "relation_type",
                          "symmetric",
                          "reason",
                          "source_display_name",
                          "source_canonical_name",
                          "target_display_name",
                          "target_canonical_name"
                        ],
                        "properties": {
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source_id": {
                            "type": "string"
                          },
                          "symmetric": {
                            "type": "boolean"
                          },
                          "target_id": {
                            "type": "string"
                          },
                          "relation_type": {
                            "type": "string"
                          },
                          "source_display_name": {
                            "type": "string"
                          },
                          "target_display_name": {
                            "type": "string"
                          },
                          "source_canonical_name": {
                            "type": "string"
                          },
                          "target_canonical_name": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "elapsed_ms": {
                      "type": "number"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/memory": {
      "get": {
        "operationId": "brain_memory_list",
        "summary": "List memories (shared + your private by default)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_memory_list",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Read scope; 'both' (default) unions shared + your private",
            "schema": {
              "type": "string",
              "enum": [
                "shared",
                "private",
                "both"
              ],
              "default": "both"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "memories",
                    "total"
                  ],
                  "properties": {
                    "total": {
                      "type": "number"
                    },
                    "memories": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "memory_id",
                          "content",
                          "layer",
                          "status",
                          "memory_at",
                          "gmt_created",
                          "user_id",
                          "agent_id",
                          "session_id",
                          "speculate",
                          "source_raw_memory_id",
                          "tags",
                          "custom",
                          "source_authority",
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "description": "Consumer-facing label derived from the layer; 'unknown' for an unrecognised layer",
                            "type": "string",
                            "enum": [
                              "schema",
                              "intention",
                              "identity",
                              "basic",
                              "fact",
                              "summary",
                              "knowledge",
                              "raw",
                              "unknown"
                            ]
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "layer": {
                            "description": "Engine memory layer (l0_basic_info…l7_intention)",
                            "type": "string",
                            "enum": [
                              "l6_schema",
                              "l7_intention",
                              "l4_identity",
                              "l0_basic_info",
                              "l2_fact",
                              "l3_summary",
                              "l5_knowledge",
                              "l1_raw"
                            ]
                          },
                          "custom": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "status": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "user_id": {
                            "type": "string"
                          },
                          "agent_id": {
                            "type": "string"
                          },
                          "memory_at": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "memory_id": {
                            "type": "string"
                          },
                          "speculate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "session_id": {
                            "type": "string"
                          },
                          "gmt_created": {
                            "type": "number"
                          },
                          "source_authority": {
                            "description": "Source authority (highest→lowest): policy > official > team > informal",
                            "type": "string",
                            "enum": [
                              "policy",
                              "official",
                              "team",
                              "informal"
                            ]
                          },
                          "source_raw_memory_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "brain_memory_add",
        "summary": "Store a memory for the current product",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_memory_add",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "description": "The memory text to store",
                    "type": "string",
                    "minLength": 1
                  },
                  "metadata": {
                    "description": "Optional structured metadata",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "scope": {
                    "description": "'shared' = product-wide pool (default); 'private' = this agent only",
                    "type": "string",
                    "enum": [
                      "shared",
                      "private"
                    ],
                    "default": "shared"
                  },
                  "source_authority": {
                    "description": "Source authority (highest→lowest): policy > official > team > informal. Omit to default to official; an unrecognized value is rejected.",
                    "type": "string",
                    "enum": [
                      "policy",
                      "official",
                      "team",
                      "informal"
                    ]
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "memory_id",
                    "request_id"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "memory_id": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/memory/{memory_id}": {
      "delete": {
        "operationId": "brain_memory_delete",
        "summary": "Delete a memory you own (or a shared one)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_memory_delete",
        "parameters": [
          {
            "name": "memory_id",
            "in": "path",
            "required": true,
            "description": "Engine memory id",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "deleted_count",
                    "request_id"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "deleted_count": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "brain_memory_get",
        "summary": "Get one memory by id (product+agent scoped)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_memory_get",
        "parameters": [
          {
            "name": "memory_id",
            "in": "path",
            "required": true,
            "description": "Engine memory id",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "memory_id",
                    "content",
                    "layer",
                    "status",
                    "is_latest",
                    "supersedes",
                    "superseded_by",
                    "tags",
                    "memory_at",
                    "gmt_created",
                    "speculate",
                    "source_raw_memory_id",
                    "user_id",
                    "agent_id",
                    "confidence",
                    "custom",
                    "source",
                    "source_authority",
                    "request_id",
                    "elapsed_ms"
                  ],
                  "properties": {
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "layer": {
                      "description": "Engine memory layer (l0_basic_info…l7_intention)",
                      "type": "string",
                      "enum": [
                        "l6_schema",
                        "l7_intention",
                        "l4_identity",
                        "l0_basic_info",
                        "l2_fact",
                        "l3_summary",
                        "l5_knowledge",
                        "l1_raw"
                      ]
                    },
                    "custom": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "vdb",
                        "graph"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string"
                    },
                    "user_id": {
                      "type": "string"
                    },
                    "agent_id": {
                      "type": "string"
                    },
                    "is_latest": {
                      "type": "boolean"
                    },
                    "memory_at": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "memory_id": {
                      "type": "string"
                    },
                    "speculate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "confidence": {
                      "type": "number"
                    },
                    "elapsed_ms": {
                      "type": "number"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "supersedes": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "gmt_created": {
                      "type": "number"
                    },
                    "superseded_by": {
                      "anyOf": [
                        {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source_authority": {
                      "description": "Source authority (highest→lowest): policy > official > team > informal",
                      "type": "string",
                      "enum": [
                        "policy",
                        "official",
                        "team",
                        "informal"
                      ]
                    },
                    "source_raw_memory_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "brain_memory_update",
        "summary": "Replace a memory you own (or a shared one)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_memory_update",
        "parameters": [
          {
            "name": "memory_id",
            "in": "path",
            "required": true,
            "description": "Engine memory id",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "description": "Replacement content",
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "content"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success",
                    "memory_id",
                    "request_id"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean",
                      "const": true
                    },
                    "memory_id": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/memory/search": {
      "get": {
        "operationId": "brain_memory_search",
        "summary": "Search memories for the current product",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_memory_search",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "Natural-language search query",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max results per channel",
            "schema": {
              "type": "integer",
              "maximum": 100,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Read scope; 'both' (default) unions shared + your private. A person sees shared only (empty private namespace).",
            "schema": {
              "type": "string",
              "enum": [
                "shared",
                "private",
                "both"
              ],
              "default": "both"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "profile",
                    "normal",
                    "proactive"
                  ],
                  "properties": {
                    "normal": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "memory_id",
                          "content",
                          "score",
                          "layer",
                          "speculate",
                          "source_raw_memory_id",
                          "tags",
                          "memory_at",
                          "gmt_created",
                          "source_authority",
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "description": "Consumer-facing label derived from the layer; 'unknown' for an unrecognised layer",
                            "type": "string",
                            "enum": [
                              "schema",
                              "intention",
                              "identity",
                              "basic",
                              "fact",
                              "summary",
                              "knowledge",
                              "raw",
                              "unknown"
                            ]
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "layer": {
                            "description": "Engine memory layer (l0_basic_info…l7_intention)",
                            "type": "string",
                            "enum": [
                              "l6_schema",
                              "l7_intention",
                              "l4_identity",
                              "l0_basic_info",
                              "l2_fact",
                              "l3_summary",
                              "l5_knowledge",
                              "l1_raw"
                            ]
                          },
                          "score": {
                            "type": "number"
                          },
                          "content": {
                            "type": "string"
                          },
                          "memory_at": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "memory_id": {
                            "type": "string"
                          },
                          "speculate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "gmt_created": {
                            "type": "number"
                          },
                          "schema_type": {
                            "type": "string"
                          },
                          "evolution_chain": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "source_authority": {
                            "description": "Source authority (highest→lowest): policy > official > team > informal",
                            "type": "string",
                            "enum": [
                              "policy",
                              "official",
                              "team",
                              "informal"
                            ]
                          },
                          "source_raw_memory_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "profile": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "memory_id",
                          "content",
                          "score",
                          "layer",
                          "speculate",
                          "source_raw_memory_id",
                          "tags",
                          "memory_at",
                          "gmt_created",
                          "source_authority",
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "description": "Consumer-facing label derived from the layer; 'unknown' for an unrecognised layer",
                            "type": "string",
                            "enum": [
                              "schema",
                              "intention",
                              "identity",
                              "basic",
                              "fact",
                              "summary",
                              "knowledge",
                              "raw",
                              "unknown"
                            ]
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "layer": {
                            "description": "Engine memory layer (l0_basic_info…l7_intention)",
                            "type": "string",
                            "enum": [
                              "l6_schema",
                              "l7_intention",
                              "l4_identity",
                              "l0_basic_info",
                              "l2_fact",
                              "l3_summary",
                              "l5_knowledge",
                              "l1_raw"
                            ]
                          },
                          "score": {
                            "type": "number"
                          },
                          "content": {
                            "type": "string"
                          },
                          "memory_at": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "memory_id": {
                            "type": "string"
                          },
                          "speculate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "gmt_created": {
                            "type": "number"
                          },
                          "schema_type": {
                            "type": "string"
                          },
                          "evolution_chain": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "source_authority": {
                            "description": "Source authority (highest→lowest): policy > official > team > informal",
                            "type": "string",
                            "enum": [
                              "policy",
                              "official",
                              "team",
                              "informal"
                            ]
                          },
                          "source_raw_memory_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "proactive": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "memory_id",
                          "content",
                          "score",
                          "layer",
                          "speculate",
                          "source_raw_memory_id",
                          "tags",
                          "memory_at",
                          "gmt_created",
                          "source_authority",
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "description": "Consumer-facing label derived from the layer; 'unknown' for an unrecognised layer",
                            "type": "string",
                            "enum": [
                              "schema",
                              "intention",
                              "identity",
                              "basic",
                              "fact",
                              "summary",
                              "knowledge",
                              "raw",
                              "unknown"
                            ]
                          },
                          "tags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "layer": {
                            "description": "Engine memory layer (l0_basic_info…l7_intention)",
                            "type": "string",
                            "enum": [
                              "l6_schema",
                              "l7_intention",
                              "l4_identity",
                              "l0_basic_info",
                              "l2_fact",
                              "l3_summary",
                              "l5_knowledge",
                              "l1_raw"
                            ]
                          },
                          "score": {
                            "type": "number"
                          },
                          "content": {
                            "type": "string"
                          },
                          "memory_at": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "memory_id": {
                            "type": "string"
                          },
                          "speculate": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "gmt_created": {
                            "type": "number"
                          },
                          "schema_type": {
                            "type": "string"
                          },
                          "evolution_chain": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "source_authority": {
                            "description": "Source authority (highest→lowest): policy > official > team > informal",
                            "type": "string",
                            "enum": [
                              "policy",
                              "official",
                              "team",
                              "informal"
                            ]
                          },
                          "source_raw_memory_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/memory/stats": {
      "get": {
        "operationId": "brain_memory_stats",
        "summary": "Summary counts for the current product (memories by layer, graph nodes/edges, entities)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_memory_stats",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "description": "Read scope; 'both' (default) unions shared + your private",
            "schema": {
              "type": "string",
              "enum": [
                "shared",
                "private",
                "both"
              ],
              "default": "both"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "memories",
                    "graph",
                    "knowledge"
                  ],
                  "properties": {
                    "graph": {
                      "type": "object",
                      "required": [
                        "nodeCount",
                        "edgeCount"
                      ],
                      "properties": {
                        "edgeCount": {
                          "type": "number"
                        },
                        "nodeCount": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "memories": {
                      "type": "object",
                      "required": [
                        "total",
                        "byLayer"
                      ],
                      "properties": {
                        "total": {
                          "type": "number"
                        },
                        "byLayer": {
                          "type": "object",
                          "required": [
                            "l2",
                            "l3",
                            "l4"
                          ],
                          "properties": {
                            "l2": {
                              "type": "number"
                            },
                            "l3": {
                              "type": "number"
                            },
                            "l4": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "knowledge": {
                      "type": "object",
                      "required": [
                        "entityCount"
                      ],
                      "properties": {
                        "entityCount": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/restores": {
      "post": {
        "operationId": "brain_backup_restore",
        "summary": "DESTRUCTIVE: full-replace restore of the current product's Brain from a snapshot (wipe + load).",
        "description": "DESTRUCTIVE: full-replace restore of the current product's Brain from a snapshot (wipe + load). Takes an automatic pre-restore snapshot first (safety net). Requires confirm:true AND confirmProductId echo; refuses on product/snapshot mismatch or embedding-dims mismatch. Async — returns { accepted, restoreId }; poll brain_restore_status.",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_backup_restore",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "snapshotId": {
                    "description": "The snapshot id to restore for the current product.",
                    "type": "string",
                    "minLength": 1
                  },
                  "confirmProductId": {
                    "description": "Must EXACTLY equal the current product id (double-entry confirmation).",
                    "type": "string",
                    "minLength": 1
                  },
                  "confirm": {
                    "description": "Must be true. DESTRUCTIVE: the product's current Brain is wiped and replaced.",
                    "type": "boolean"
                  }
                },
                "required": [
                  "snapshotId",
                  "confirmProductId",
                  "confirm"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accepted",
                    "restoreId"
                  ],
                  "properties": {
                    "accepted": {
                      "type": "boolean",
                      "const": true
                    },
                    "restoreId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/restores/{restoreId}": {
      "get": {
        "operationId": "brain_restore_status",
        "summary": "Read a restore run's status (pending|wiped|importing|completed|failed) with counts + timing, by restoreId (returned by brain_backup_restore).",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_restore_status",
        "parameters": [
          {
            "name": "restoreId",
            "in": "path",
            "required": true,
            "description": "The restore run id (returned by brain_backup_restore).",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "restoreId",
                        "productId",
                        "snapshotId",
                        "preRestoreSnapshotId",
                        "status",
                        "nodeCount",
                        "edgeCount",
                        "error",
                        "startedAt",
                        "finishedAt"
                      ],
                      "properties": {
                        "error": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "wiped",
                            "importing",
                            "completed",
                            "failed"
                          ]
                        },
                        "edgeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "nodeCount": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "productId": {
                          "type": "string"
                        },
                        "restoreId": {
                          "type": "string"
                        },
                        "startedAt": {
                          "type": "string"
                        },
                        "finishedAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "snapshotId": {
                          "type": "string"
                        },
                        "preRestoreSnapshotId": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/usage/report": {
      "get": {
        "operationId": "brain_usage_report",
        "summary": "Reported LLM/embedding token usage for this product, next to the platform billing aggregate",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_usage_report",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "How many UTC days of this product's ledger to return, ending today (default 30, max 90)",
            "schema": {
              "type": "integer",
              "default": 30,
              "maximum": 90,
              "exclusiveMinimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "product",
                    "platform",
                    "platform_error",
                    "note"
                  ],
                  "properties": {
                    "note": {
                      "type": "string"
                    },
                    "product": {
                      "description": "Brain's own ledger, for THIS product only",
                      "type": "object",
                      "required": [
                        "product_id",
                        "days",
                        "from",
                        "to",
                        "rows",
                        "totals"
                      ],
                      "properties": {
                        "to": {
                          "description": "Inclusive UTC end of the window (today), YYYY-MM-DD",
                          "type": "string"
                        },
                        "days": {
                          "description": "The window actually used, after clamping",
                          "type": "number"
                        },
                        "from": {
                          "description": "Inclusive UTC start of the window, YYYY-MM-DD",
                          "type": "string"
                        },
                        "rows": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "usage_date",
                              "meter",
                              "model",
                              "mode",
                              "purpose",
                              "tokens",
                              "events",
                              "delivery_failed"
                            ],
                            "properties": {
                              "mode": {
                                "description": "'sync' | 'batch'; '' when the push carried none",
                                "type": "string"
                              },
                              "meter": {
                                "description": "Manifest meter slug, e.g. llm-tokens",
                                "type": "string"
                              },
                              "model": {
                                "description": "Model dimension; '' when the push carried none",
                                "type": "string"
                              },
                              "events": {
                                "description": "How many record() calls landed in this slice",
                                "type": "number"
                              },
                              "tokens": {
                                "description": "Tokens we metered for this slice, delivered or not",
                                "type": "number"
                              },
                              "purpose": {
                                "description": "Purpose dimension; '' when the push carried none",
                                "type": "string"
                              },
                              "usage_date": {
                                "description": "UTC calendar day, YYYY-MM-DD",
                                "type": "string"
                              },
                              "delivery_failed": {
                                "description": "Of those events, how many billing did not accept",
                                "type": "number"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "totals": {
                          "description": "The rows rolled up per meter across the whole window",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "meter",
                              "tokens",
                              "events",
                              "delivery_failed"
                            ],
                            "properties": {
                              "meter": {
                                "type": "string"
                              },
                              "events": {
                                "type": "number"
                              },
                              "tokens": {
                                "type": "number"
                              },
                              "delivery_failed": {
                                "type": "number"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "product_id": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "platform": {
                      "description": "The platform billing aggregate for the whole ORG; null if it could not be read",
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "scope",
                            "org_id",
                            "plan",
                            "meters"
                          ],
                          "properties": {
                            "plan": {
                              "type": "string"
                            },
                            "scope": {
                              "type": "string",
                              "const": "org"
                            },
                            "meters": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "meter_slug"
                                ],
                                "properties": {
                                  "unit": {
                                    "type": "string"
                                  },
                                  "used": {
                                    "type": "number"
                                  },
                                  "limit": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "remaining": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "unlimited": {
                                    "type": "boolean"
                                  },
                                  "meter_slug": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "org_id": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "platform_error": {
                      "description": "Why the platform aggregate is null; null when it was read successfully",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/vcs/branches": {
      "get": {
        "operationId": "brain_connector_branches_list",
        "summary": "List branches for a repository on a GitHub connection",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_connector_branches_list",
        "parameters": [
          {
            "name": "connectorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "repoFullName",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^/]+\\/[^/]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "commitSha"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "commitSha": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/vcs/connections": {
      "get": {
        "operationId": "brain_connector_connections_list",
        "summary": "List the GitHub connections available to the current product",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_connector_connections_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "connectorId",
                      "installationId",
                      "accountLogin",
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "connectorId": {
                        "type": "string"
                      },
                      "accountLogin": {
                        "type": "string"
                      },
                      "installationId": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/brain/vcs/repos": {
      "get": {
        "operationId": "brain_connector_repos_list",
        "summary": "List repositories accessible to a GitHub connection (optionally filtered by search)",
        "tags": [
          "Brain"
        ],
        "x-mcp-tool": "brain_connector_repos_list",
        "parameters": [
          {
            "name": "connectorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "fullName",
                      "private",
                      "defaultBranch"
                    ],
                    "properties": {
                      "private": {
                        "type": "boolean"
                      },
                      "fullName": {
                        "type": "string"
                      },
                      "defaultBranch": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/config": {
      "patch": {
        "operationId": "consent_config_floating_icon_upsert",
        "summary": "Configures the always-available \"Cookie settings\" entry point that lets a visitor reopen their consent preferences after they have made a choice.",
        "description": "Configures the always-available \"Cookie settings\" entry point that lets a visitor reopen their consent preferences after they have made a choice. By default Lessly renders a floating icon in a page corner; you can move it, or bind the entry point to an element the site already has (for example a \"Cookie settings\" link in the footer) instead of showing the icon. Fields (under `floatingIcon`): enabled — whether to render Lessly's built-in floating icon; position — which corner the icon sits in (\"bottom-right\" / \"bottom-left\" / \"top-right\" / \"top-left\"); customSelector — a CSS selector for an existing element on the page (e.g. \"#footer-cookie-link\") whose click opens consent settings, or null to rely on the built-in icon only. To hide the built-in icon (enabled: false) you must provide a customSelector, so the visitor always keeps a way to reopen settings.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_config_floating_icon_upsert",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "floatingIcon": {
                    "type": "object",
                    "required": [
                      "enabled",
                      "position",
                      "customSelector"
                    ],
                    "properties": {
                      "enabled": {
                        "type": "boolean"
                      },
                      "position": {
                        "type": "string",
                        "enum": [
                          "bottom-right",
                          "bottom-left",
                          "top-right",
                          "top-left"
                        ]
                      },
                      "customSelector": {
                        "anyOf": [
                          {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 256,
                            "pattern": "^[\\x20-\\x7E]+$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "floatingIcon"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "floatingIcon"
                  ],
                  "properties": {
                    "floatingIcon": {
                      "type": "object",
                      "required": [
                        "enabled",
                        "position",
                        "customSelector"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "position": {
                          "type": "string",
                          "enum": [
                            "bottom-right",
                            "bottom-left",
                            "top-right",
                            "top-left"
                          ]
                        },
                        "customSelector": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/config/cookie-domain": {
      "patch": {
        "operationId": "consent_config_cookie_domain_upsert",
        "summary": "Sets an explicit cookie Domain for the consent cookie (lessly_consent).",
        "description": "Sets an explicit cookie Domain for the consent cookie (lessly_consent). By default the banner derives the widest owned boundary automatically: the registrable domain (eTLD+1) on customer sites, or the deploy host on Lessly platform hosts — so consent given on site.com also covers docs.site.com. Set cookieDomain only to NARROW that perimeter, e.g. when several Lessly products live on subdomains of one domain and each must keep its own consent (cookieDomain: \"docs.site.com\" on the docs product). The value must be a suffix of the page hostname at runtime, otherwise the banner ignores it and falls back to auto-derivation. Platform deploy suffixes (lessly.dev / lessly.com / lessly.run / lessly.tech / v2.*) are rejected — a cookie on those would leak consent across tenants. Pass null or an empty string to remove the override.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_config_cookie_domain_upsert",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cookieDomain": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": ""
                      },
                      {
                        "type": "null"
                      },
                      {
                        "type": "string",
                        "pattern": "^(?=.{1,253}$)[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$"
                      }
                    ]
                  }
                },
                "required": [
                  "cookieDomain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cookieDomain"
                  ],
                  "properties": {
                    "cookieDomain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/config/customization": {
      "patch": {
        "operationId": "consent_config_customization_upsert",
        "summary": "Fine-tunes the banner beyond brand tokens, when the theme alone is not enough.",
        "description": "Fine-tunes the banner beyond brand tokens, when the theme alone is not enough. logoUrl / coverUrl — https URLs to images hosted on the client's side (we store nothing; an empty string removes the asset; an external URL exposes the visitor's IP to that host); coverUrl is a header strip across the top of the banner. position — where the banner sits on the page (\"bottom\" / \"top\" / \"bottom-left\" / \"bottom-right\" / \"center-modal\"); this is the banner's placement, distinct from the reopen-icon corner in consent_config_floating_icon_upsert. logoAlign — \"start\" / \"center\" / \"end\"; contentAlign — \"start\" / \"center\". All fields are optional and patch-merge onto the previous customization. This layer does not change button equality (\"Accept all\" / \"Reject all\") or the provider list.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_config_customization_upsert",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "logoUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2048
                      },
                      {
                        "type": "string",
                        "const": ""
                      }
                    ]
                  },
                  "coverUrl": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2048
                      },
                      {
                        "type": "string",
                        "const": ""
                      }
                    ]
                  },
                  "position": {
                    "type": "string",
                    "enum": [
                      "bottom",
                      "top",
                      "bottom-left",
                      "bottom-right",
                      "center-modal"
                    ]
                  },
                  "logoAlign": {
                    "type": "string",
                    "enum": [
                      "start",
                      "center",
                      "end"
                    ]
                  },
                  "contentAlign": {
                    "type": "string",
                    "enum": [
                      "start",
                      "center"
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "customization",
                    "customizationInput"
                  ],
                  "properties": {
                    "customization": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "customizationInput": {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/config/theme": {
      "patch": {
        "operationId": "consent_config_theme_upsert",
        "summary": "Adapts the consent banner's appearance to the site's brand.",
        "description": "Adapts the consent banner's appearance to the site's brand. Pass what you observe on the client's site: brandColor — the site's primary brand color (any CSS color); surface — whether the site is \"light\" or \"dark\"; corners — button corner shape (\"sharp\" / \"rounded\" / \"pill\"); font — the site's font, given as a font name, a full CSS font stack, or \"inherit\" to adopt the host page's font. If the brand tokens are not enough, fine-tune `overrides`: backgroundColor, textColor, primaryTextColor, borderColor, focusColor, dangerColor, successColor, warningColor. primaryTextColor sets the text on the primary button; without it that text is derived from primaryColor. Fails when: primaryTextColor contrasts below 3.0:1 against the effective primaryColor — the patch is rejected, naming the computed ratio. All fields are optional and patch-merge onto the previous theme. To identify the site: use a URL from the request; otherwise the latest decision `pageUrl`; otherwise ask the user once. This layer is cosmetic only — after applying, \"Accept all\" and \"Reject all\" stay equally prominent and the provider list is unchanged.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_config_theme_upsert",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "brandColor": {
                    "type": "string"
                  },
                  "surface": {
                    "type": "string",
                    "enum": [
                      "light",
                      "dark"
                    ]
                  },
                  "corners": {
                    "type": "string",
                    "enum": [
                      "sharp",
                      "rounded",
                      "pill"
                    ]
                  },
                  "font": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "pattern": "^[a-zA-Z0-9 ,'\"_-]+$"
                  },
                  "overrides": {
                    "type": "object",
                    "properties": {
                      "textColor": {
                        "type": "string"
                      },
                      "focusColor": {
                        "type": "string"
                      },
                      "borderColor": {
                        "type": "string"
                      },
                      "dangerColor": {
                        "type": "string"
                      },
                      "successColor": {
                        "type": "string"
                      },
                      "warningColor": {
                        "type": "string"
                      },
                      "backgroundColor": {
                        "type": "string"
                      },
                      "primaryTextColor": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "theme",
                    "themeInput"
                  ],
                  "properties": {
                    "theme": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "themeInput": {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/consent/dashboard/config": {
      "get": {
        "operationId": "consent_dashboard_config_get",
        "summary": "Returns consent config for the current product: theme — the editable brand-theme intent previously set via consent_config_theme_upsert; customization — the editable escape-hatch intent (logo/cover URLs, position, alignment) set via consent_config_customization_upsert (empty object if none set yet) — and floatingIcon (trigger settings).",
        "description": "Returns consent config for the current product: theme — the editable brand-theme intent previously set via consent_config_theme_upsert; customization — the editable escape-hatch intent (logo/cover URLs, position, alignment) set via consent_config_customization_upsert (empty object if none set yet) — and floatingIcon (trigger settings). When no consent_config row exists, returns defaults; never 404s.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_dashboard_config_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "theme",
                    "customization",
                    "floatingIcon"
                  ],
                  "properties": {
                    "theme": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "floatingIcon": {
                      "type": "object",
                      "required": [
                        "enabled",
                        "position",
                        "customSelector"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "position": {
                          "type": "string",
                          "enum": [
                            "bottom-right",
                            "bottom-left",
                            "top-right",
                            "top-left"
                          ]
                        },
                        "customSelector": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "customization": {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/consent/dashboard/decisions": {
      "get": {
        "operationId": "consent_dashboard_decisions_list",
        "summary": "Returns the latest consent decisions for the current product — each with its HMAC signature (`stamp`) and a computed accept/deny/custom/withdrawal label.",
        "description": "Returns the latest consent decisions for the current product — each with its HMAC signature (`stamp`) and a computed accept/deny/custom/withdrawal label. Read-only; useful to confirm decisions are still being signed.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_dashboard_decisions_list",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of records to return (1..10, default 10)",
            "schema": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 10
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Pagination offset (>=0, default 0)",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "stamp",
                          "utc",
                          "label",
                          "method",
                          "flags",
                          "region"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "utc": {
                            "type": "number"
                          },
                          "flags": {
                            "type": "object",
                            "required": [
                              "necessary",
                              "preferences",
                              "statistics",
                              "marketing"
                            ],
                            "properties": {
                              "marketing": {
                                "type": "boolean"
                              },
                              "necessary": {
                                "type": "boolean"
                              },
                              "statistics": {
                                "type": "boolean"
                              },
                              "preferences": {
                                "type": "boolean"
                              }
                            },
                            "additionalProperties": false
                          },
                          "label": {
                            "type": "string",
                            "enum": [
                              "accept",
                              "deny",
                              "custom",
                              "withdrawal"
                            ]
                          },
                          "stamp": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string",
                            "enum": [
                              "explicit",
                              "implied",
                              "withdrawal"
                            ]
                          },
                          "region": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/consent/dashboard/embed-snippet": {
      "get": {
        "operationId": "consent_dashboard_embed_snippet_get",
        "summary": "Returns the consent banner embed <script> tag and public edge URL for the current product.",
        "description": "Returns the consent banner embed <script> tag and public edge URL for the current product. Read-only. Insert script_tag VERBATIM, including its leading HTML comment, as the FIRST script in <head> — before any tracker, tag manager or inline loader. Never add async or defer: banner.js must execute before the parser reaches the first tracker, otherwise trackers run before consent is known.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_dashboard_embed_snippet_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script_tag",
                    "public_edge_url"
                  ],
                  "properties": {
                    "script_tag": {
                      "type": "string"
                    },
                    "public_edge_url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/consent/dashboard/export": {
      "post": {
        "operationId": "consent_records_export",
        "summary": "Export consent records for the current product as CSV (workspace-scoped).",
        "description": "Export consent records for the current product as CSV (workspace-scoped). Returns inline CSV up to `limit` rows; if more rows match the filter, also returns `download_url` pointing to the streaming HTTP endpoint with the same filters applied. For an Art. 15 (DSAR) access request, pass `record_id` (the UUID from the visitor's consent cookie) to filter the export to that visitor's full decision chain.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_records_export",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "description": "Inclusive lower bound for created_at (server clock), ISO-8601. Example: \"2025-01-01T00:00:00Z\". Omit for \"from the beginning\".",
                    "type": "string",
                    "format": "date-time"
                  },
                  "to": {
                    "description": "Inclusive upper bound for created_at, ISO-8601. Example: \"2026-01-01T00:00:00Z\". Omit for \"up to now\".",
                    "type": "string",
                    "format": "date-time"
                  },
                  "limit": {
                    "description": "Maximum rows to return inline. Default 1000, hard cap 10000. If more rows match, the response sets truncated=true and includes download_url for the full dataset via HTTP.",
                    "type": "integer",
                    "default": 1000,
                    "minimum": 1,
                    "maximum": 10000
                  },
                  "record_id": {
                    "description": "DSAR (Art. 15) lookup: a visitor-presented record_id (the UUID from their consent cookie). When set, the export is filtered to that visitor's full decision chain (transitive closure over replaces_id), scoped to the current product. Omit for a product-wide admin export.",
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "csv",
                    "returned_count",
                    "truncated",
                    "total_count",
                    "filters"
                  ],
                  "properties": {
                    "csv": {
                      "type": "string"
                    },
                    "filters": {
                      "type": "object",
                      "required": [
                        "from",
                        "to",
                        "limit"
                      ],
                      "properties": {
                        "to": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "from": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "limit": {
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "total_count": {
                      "type": "integer"
                    },
                    "download_url": {
                      "type": "string"
                    },
                    "returned_count": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/consent/dashboard/stats": {
      "get": {
        "operationId": "consent_dashboard_stats_get",
        "summary": "Returns lightweight dashboard stats for the current product (currently total record count).",
        "description": "Returns lightweight dashboard stats for the current product (currently total record count). Read-only.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_dashboard_stats_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total_records"
                  ],
                  "properties": {
                    "total_records": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/consent/providers": {
      "get": {
        "operationId": "consent_providers_list",
        "summary": "List all consent providers (and their cookies) for the current product.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_providers_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "category",
                      "privacyUrl",
                      "description",
                      "orderIndex",
                      "hosts",
                      "createdAt",
                      "updatedAt",
                      "cookies"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "hosts": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "cookies": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "id",
                            "name",
                            "purpose",
                            "storageDuration",
                            "type"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string",
                              "enum": [
                                "http_cookie",
                                "local_storage",
                                "session_storage"
                              ]
                            },
                            "purpose": {
                              "type": "string"
                            },
                            "storageDuration": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "category": {
                        "type": "string",
                        "enum": [
                          "necessary",
                          "preferences",
                          "statistics",
                          "marketing"
                        ]
                      },
                      "isSystem": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "catalogKey": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "orderIndex": {
                        "type": "integer"
                      },
                      "privacyUrl": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "description": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "consent_providers_create",
        "summary": "Create a new consent provider.",
        "description": "Create a new consent provider. cookies (optional) is the full set; cookies must have unique names within the provider.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_providers_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Provider display name, e.g. \"Google Analytics 4 (gtag.js)\"",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "category": {
                    "description": "Consent category bucket — matches CHECK constraint on consent_providers.category",
                    "type": "string",
                    "enum": [
                      "necessary",
                      "preferences",
                      "statistics",
                      "marketing"
                    ]
                  },
                  "hosts": {
                    "description": "Hostnames where this provider loads scripts. Required (min 1) for non-necessary categories.",
                    "type": "array",
                    "default": [],
                    "maxItems": 50,
                    "items": {
                      "allOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 253,
                          "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$"
                        }
                      ]
                    }
                  },
                  "privacyUrl": {
                    "description": "Link to provider privacy policy",
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "description": {
                    "description": "Short description shown in consent UI. Stored as empty string when omitted.",
                    "type": "string",
                    "maxLength": 4000
                  },
                  "orderIndex": {
                    "description": "Sort order; lower = earlier",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  "cookies": {
                    "description": "List of cookies/storage entries this provider sets",
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "purpose",
                        "storageDuration",
                        "type"
                      ],
                      "properties": {
                        "name": {
                          "description": "Cookie/storage key name, e.g. \"_ga\"",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "type": {
                          "description": "Storage mechanism — matches CHECK constraint on consent_cookies.type",
                          "type": "string",
                          "enum": [
                            "http_cookie",
                            "local_storage",
                            "session_storage"
                          ]
                        },
                        "purpose": {
                          "description": "Human-readable description of why the cookie is set",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        },
                        "storageDuration": {
                          "description": "Duration like \"2 years\", \"session\", \"30 days\"",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "catalogKey": {
                    "description": "Catalog key if created from picker. Null for manual creation.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  }
                },
                "required": [
                  "name",
                  "category"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "category",
                    "privacyUrl",
                    "description",
                    "orderIndex",
                    "hosts",
                    "createdAt",
                    "updatedAt",
                    "cookies"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "hosts": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cookies": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "purpose",
                          "storageDuration",
                          "type"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "http_cookie",
                              "local_storage",
                              "session_storage"
                            ]
                          },
                          "purpose": {
                            "type": "string"
                          },
                          "storageDuration": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "category": {
                      "type": "string",
                      "enum": [
                        "necessary",
                        "preferences",
                        "statistics",
                        "marketing"
                      ]
                    },
                    "isSystem": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "catalogKey": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "orderIndex": {
                      "type": "integer"
                    },
                    "privacyUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/consent/providers/{id}": {
      "delete": {
        "operationId": "consent_providers_delete",
        "summary": "Delete a consent provider and all its cookies (cascade).",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_providers_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Provider id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "consent_providers_update",
        "summary": "Update an existing consent provider.",
        "description": "Update an existing consent provider. cookies: undefined leaves cookies unchanged, [] clears them, [...] replaces the whole set. privacyUrl: null clears the field.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_providers_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Provider id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024
                  },
                  "category": {
                    "description": "Consent category bucket — matches CHECK constraint on consent_providers.category",
                    "type": "string",
                    "enum": [
                      "necessary",
                      "preferences",
                      "statistics",
                      "marketing"
                    ]
                  },
                  "hosts": {
                    "description": "If provided, REPLACES the hosts list. Omit to leave unchanged.",
                    "type": "array",
                    "default": [],
                    "maxItems": 50,
                    "items": {
                      "allOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 253,
                          "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$"
                        }
                      ]
                    }
                  },
                  "privacyUrl": {
                    "description": "null clears the field, undefined leaves it unchanged",
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "description": {
                    "description": "Pass empty string to clear; undefined leaves unchanged",
                    "type": "string",
                    "maxLength": 4000
                  },
                  "orderIndex": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10000
                  },
                  "cookies": {
                    "description": "If provided, REPLACES the whole cookies set for this provider. Omit to leave unchanged.",
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "purpose",
                        "storageDuration",
                        "type"
                      ],
                      "properties": {
                        "name": {
                          "description": "Cookie/storage key name, e.g. \"_ga\"",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "type": {
                          "description": "Storage mechanism — matches CHECK constraint on consent_cookies.type",
                          "type": "string",
                          "enum": [
                            "http_cookie",
                            "local_storage",
                            "session_storage"
                          ]
                        },
                        "purpose": {
                          "description": "Human-readable description of why the cookie is set",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        },
                        "storageDuration": {
                          "description": "Duration like \"2 years\", \"session\", \"30 days\"",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "category",
                    "privacyUrl",
                    "description",
                    "orderIndex",
                    "hosts",
                    "createdAt",
                    "updatedAt",
                    "cookies"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "hosts": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "cookies": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "purpose",
                          "storageDuration",
                          "type"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "http_cookie",
                              "local_storage",
                              "session_storage"
                            ]
                          },
                          "purpose": {
                            "type": "string"
                          },
                          "storageDuration": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "category": {
                      "type": "string",
                      "enum": [
                        "necessary",
                        "preferences",
                        "statistics",
                        "marketing"
                      ]
                    },
                    "isSystem": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "catalogKey": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "orderIndex": {
                      "type": "integer"
                    },
                    "privacyUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/consent/stats": {
      "get": {
        "operationId": "consent_stats_get",
        "summary": "Returns aggregated consent decision stats for the current product over a configurable window (default 30d, max 365d).",
        "description": "Returns aggregated consent decision stats for the current product over a configurable window (default 30d, max 365d). Returns integer percentages 0..100; due to per-bucket rounding the sum may be 99..101. Read-only.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_stats_get",
        "parameters": [
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Time window for aggregation in days, e.g. \"30d\". Omit to use the server default (30d). Maximum: 365d.",
            "schema": {
              "type": "string",
              "pattern": "^\\d+d$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total",
                    "accept_all_pct",
                    "deny_all_pct",
                    "custom_pct",
                    "by_category",
                    "range"
                  ],
                  "properties": {
                    "range": {
                      "type": "object",
                      "required": [
                        "from",
                        "to"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "total": {
                      "type": "integer"
                    },
                    "custom_pct": {
                      "type": "integer"
                    },
                    "by_category": {
                      "type": "object",
                      "required": [
                        "preferences_pct",
                        "statistics_pct",
                        "marketing_pct"
                      ],
                      "properties": {
                        "marketing_pct": {
                          "type": "integer"
                        },
                        "statistics_pct": {
                          "type": "integer"
                        },
                        "preferences_pct": {
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "deny_all_pct": {
                      "type": "integer"
                    },
                    "accept_all_pct": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/consent/embed": {
      "get": {
        "operationId": "consent_embed_get",
        "summary": "Returns the consent banner embed <script> tag for the current product.",
        "description": "Returns the consent banner embed <script> tag for the current product. Insert script_tag VERBATIM, including its leading HTML comment, as the FIRST script in <head> — before any tracker, tag manager or inline loader. Never add async or defer: banner.js must execute before the parser reaches the first tracker, otherwise trackers run before consent is known.",
        "tags": [
          "Consent"
        ],
        "x-mcp-tool": "consent_embed_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script_tag",
                    "product_id",
                    "public_edge_url"
                  ],
                  "properties": {
                    "product_id": {
                      "type": "string"
                    },
                    "script_tag": {
                      "type": "string"
                    },
                    "public_edge_url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/channels": {
      "get": {
        "operationId": "content_channels_list",
        "summary": "List the channels this product can publish to, with each one's limits and per-post cost.",
        "description": "List the channels this product can publish to, with each one's limits and per-post cost. Seeded channels all use reminder delivery: the system prepares the post and notifies a person to publish it.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_channels_list",
        "parameters": [
          {
            "name": "network",
            "in": "query",
            "required": false,
            "description": "Return only channels on this network.",
            "schema": {
              "type": "string",
              "enum": [
                "linkedin",
                "x",
                "youtube",
                "instagram",
                "reddit"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of channels to return (1-100, default 50).",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many channels to skip, for paging.",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channels",
                    "total"
                  ],
                  "properties": {
                    "total": {
                      "description": "Total number of matching channels, ignoring paging.",
                      "type": "integer"
                    },
                    "channels": {
                      "description": "The page of channels, ordered by network.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "network",
                          "subjectType",
                          "deliveryMode",
                          "displayName",
                          "capabilities",
                          "connectorId",
                          "pausedAt",
                          "pauseReason",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Channel id — pass this to content_publications_schedule.",
                            "type": "string"
                          },
                          "network": {
                            "description": "Social network: linkedin, x, youtube, instagram or reddit.",
                            "type": "string"
                          },
                          "pausedAt": {
                            "description": "ISO-8601 time the connector stopped working, or null when healthy. A paused channel keeps its scheduled publications — they are frozen, not cancelled, and dispatch once it resumes.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation time.",
                            "type": "string"
                          },
                          "updatedAt": {
                            "description": "ISO-8601 time of the last change.",
                            "type": "string"
                          },
                          "connectorId": {
                            "description": "Platform connector this channel publishes through, or null for a reminder channel that needs none. An id — this toolkit never holds social credentials; a token is fetched per call and discarded.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayName": {
                            "description": "Human label for the channel.",
                            "type": "string"
                          },
                          "pauseReason": {
                            "description": "Why it paused: revoked (access was taken away), expired (the credential ran out), or the provider reason code from a failed publish. Null when healthy.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "subjectType": {
                            "description": "Who publishes: member (a personal account) or organization (a company page). Phase 1 channels are all member accounts.",
                            "type": "string",
                            "enum": [
                              "member",
                              "organization"
                            ]
                          },
                          "capabilities": {
                            "description": "What the channel accepts and what it costs: maxTextLength, maxMedia, supportsVideo, supportsLink, costPerPostUsd, costPerLinkPostUsd, dailyPostCeiling, ceilingIsRuntimeData. Read maxTextLength before writing a per-channel text variant.",
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "deliveryMode": {
                            "description": "How the post reaches the network: auto (this API publishes it) or reminder (the system prepares it and notifies a person, who publishes by hand). Every seeded channel is reminder.",
                            "type": "string",
                            "enum": [
                              "auto",
                              "reminder"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/channels/{id}": {
      "get": {
        "operationId": "content_channels_get",
        "summary": "Read one channel: its delivery mode and its capability descriptor — the character limit, media rules and cost to check before composing a variant for it.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_channels_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The channel id returned by content_channels_list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "network",
                    "subjectType",
                    "deliveryMode",
                    "displayName",
                    "capabilities",
                    "connectorId",
                    "pausedAt",
                    "pauseReason",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Channel id — pass this to content_publications_schedule.",
                      "type": "string"
                    },
                    "network": {
                      "description": "Social network: linkedin, x, youtube, instagram or reddit.",
                      "type": "string"
                    },
                    "pausedAt": {
                      "description": "ISO-8601 time the connector stopped working, or null when healthy. A paused channel keeps its scheduled publications — they are frozen, not cancelled, and dispatch once it resumes.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "connectorId": {
                      "description": "Platform connector this channel publishes through, or null for a reminder channel that needs none. An id — this toolkit never holds social credentials; a token is fetched per call and discarded.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "description": "Human label for the channel.",
                      "type": "string"
                    },
                    "pauseReason": {
                      "description": "Why it paused: revoked (access was taken away), expired (the credential ran out), or the provider reason code from a failed publish. Null when healthy.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subjectType": {
                      "description": "Who publishes: member (a personal account) or organization (a company page). Phase 1 channels are all member accounts.",
                      "type": "string",
                      "enum": [
                        "member",
                        "organization"
                      ]
                    },
                    "capabilities": {
                      "description": "What the channel accepts and what it costs: maxTextLength, maxMedia, supportsVideo, supportsLink, costPerPostUsd, costPerLinkPostUsd, dailyPostCeiling, ceilingIsRuntimeData. Read maxTextLength before writing a per-channel text variant.",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "deliveryMode": {
                      "description": "How the post reaches the network: auto (this API publishes it) or reminder (the system prepares it and notifies a person, who publishes by hand). Every seeded channel is reminder.",
                      "type": "string",
                      "enum": [
                        "auto",
                        "reminder"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "content_channels_update",
        "summary": "Rename a channel, change its delivery mode, or correct its capability descriptor.",
        "description": "Rename a channel, change its delivery mode, or correct its capability descriptor. Channels themselves are seeded, not created: every product starts with one per network.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_channels_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The channel id returned by content_channels_list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "New human label for the channel. Omit to keep the current one.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "deliveryMode": {
                    "description": "Change how the post reaches the network. Only reminder can be scheduled in this release — no publishing adapter exists yet.",
                    "type": "string",
                    "enum": [
                      "auto",
                      "reminder"
                    ]
                  },
                  "capabilities": {
                    "description": "Override individual capability fields — a known ceiling beats the hand-filled constant. Merges over the existing descriptor; fields you omit keep their current values.",
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "network",
                    "subjectType",
                    "deliveryMode",
                    "displayName",
                    "capabilities",
                    "connectorId",
                    "pausedAt",
                    "pauseReason",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Channel id — pass this to content_publications_schedule.",
                      "type": "string"
                    },
                    "network": {
                      "description": "Social network: linkedin, x, youtube, instagram or reddit.",
                      "type": "string"
                    },
                    "pausedAt": {
                      "description": "ISO-8601 time the connector stopped working, or null when healthy. A paused channel keeps its scheduled publications — they are frozen, not cancelled, and dispatch once it resumes.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "connectorId": {
                      "description": "Platform connector this channel publishes through, or null for a reminder channel that needs none. An id — this toolkit never holds social credentials; a token is fetched per call and discarded.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "description": "Human label for the channel.",
                      "type": "string"
                    },
                    "pauseReason": {
                      "description": "Why it paused: revoked (access was taken away), expired (the credential ran out), or the provider reason code from a failed publish. Null when healthy.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subjectType": {
                      "description": "Who publishes: member (a personal account) or organization (a company page). Phase 1 channels are all member accounts.",
                      "type": "string",
                      "enum": [
                        "member",
                        "organization"
                      ]
                    },
                    "capabilities": {
                      "description": "What the channel accepts and what it costs: maxTextLength, maxMedia, supportsVideo, supportsLink, costPerPostUsd, costPerLinkPostUsd, dailyPostCeiling, ceilingIsRuntimeData. Read maxTextLength before writing a per-channel text variant.",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "deliveryMode": {
                      "description": "How the post reaches the network: auto (this API publishes it) or reminder (the system prepares it and notifies a person, who publishes by hand). Every seeded channel is reminder.",
                      "type": "string",
                      "enum": [
                        "auto",
                        "reminder"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/channels/{id}/bind": {
      "post": {
        "operationId": "content_channels_bind",
        "summary": "Bind a channel to a platform connector so posts can be published through it.",
        "description": "Bind a channel to a platform connector so posts can be published through it. Clears an existing pause — rebinding is how a revoked or expired connection is fixed. Pass deliveryMode \"auto\" to also switch the channel to automatic publishing; binding alone never does.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_channels_bind",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The channel id returned by content_channels_list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "connectorId": {
                    "description": "The platform connector to publish through — the id of a connector attached to this product, from the workspace connectors list. Networks with no publishing connector (instagram, LinkedIn company pages) are rejected.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "deliveryMode": {
                    "description": "Pass auto to make this API publish through the connector. Omit to keep the current mode: binding alone never switches a channel to automatic publishing.",
                    "type": "string",
                    "enum": [
                      "auto",
                      "reminder"
                    ]
                  }
                },
                "required": [
                  "connectorId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "network",
                    "subjectType",
                    "deliveryMode",
                    "displayName",
                    "capabilities",
                    "connectorId",
                    "pausedAt",
                    "pauseReason",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Channel id — pass this to content_publications_schedule.",
                      "type": "string"
                    },
                    "network": {
                      "description": "Social network: linkedin, x, youtube, instagram or reddit.",
                      "type": "string"
                    },
                    "pausedAt": {
                      "description": "ISO-8601 time the connector stopped working, or null when healthy. A paused channel keeps its scheduled publications — they are frozen, not cancelled, and dispatch once it resumes.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "connectorId": {
                      "description": "Platform connector this channel publishes through, or null for a reminder channel that needs none. An id — this toolkit never holds social credentials; a token is fetched per call and discarded.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "description": "Human label for the channel.",
                      "type": "string"
                    },
                    "pauseReason": {
                      "description": "Why it paused: revoked (access was taken away), expired (the credential ran out), or the provider reason code from a failed publish. Null when healthy.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subjectType": {
                      "description": "Who publishes: member (a personal account) or organization (a company page). Phase 1 channels are all member accounts.",
                      "type": "string",
                      "enum": [
                        "member",
                        "organization"
                      ]
                    },
                    "capabilities": {
                      "description": "What the channel accepts and what it costs: maxTextLength, maxMedia, supportsVideo, supportsLink, costPerPostUsd, costPerLinkPostUsd, dailyPostCeiling, ceilingIsRuntimeData. Read maxTextLength before writing a per-channel text variant.",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "deliveryMode": {
                      "description": "How the post reaches the network: auto (this API publishes it) or reminder (the system prepares it and notifies a person, who publishes by hand). Every seeded channel is reminder.",
                      "type": "string",
                      "enum": [
                        "auto",
                        "reminder"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/channels/{id}/resume": {
      "post": {
        "operationId": "content_channels_resume",
        "summary": "Resume a channel paused by a revoked or expired connection, once the connection works again.",
        "description": "Resume a channel paused by a revoked or expired connection, once the connection works again. Its frozen publications dispatch on the next scheduler tick — late, not cancelled.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_channels_resume",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The paused channel to resume, once its connector has been reconnected.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "network",
                    "subjectType",
                    "deliveryMode",
                    "displayName",
                    "capabilities",
                    "connectorId",
                    "pausedAt",
                    "pauseReason",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Channel id — pass this to content_publications_schedule.",
                      "type": "string"
                    },
                    "network": {
                      "description": "Social network: linkedin, x, youtube, instagram or reddit.",
                      "type": "string"
                    },
                    "pausedAt": {
                      "description": "ISO-8601 time the connector stopped working, or null when healthy. A paused channel keeps its scheduled publications — they are frozen, not cancelled, and dispatch once it resumes.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "connectorId": {
                      "description": "Platform connector this channel publishes through, or null for a reminder channel that needs none. An id — this toolkit never holds social credentials; a token is fetched per call and discarded.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "description": "Human label for the channel.",
                      "type": "string"
                    },
                    "pauseReason": {
                      "description": "Why it paused: revoked (access was taken away), expired (the credential ran out), or the provider reason code from a failed publish. Null when healthy.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subjectType": {
                      "description": "Who publishes: member (a personal account) or organization (a company page). Phase 1 channels are all member accounts.",
                      "type": "string",
                      "enum": [
                        "member",
                        "organization"
                      ]
                    },
                    "capabilities": {
                      "description": "What the channel accepts and what it costs: maxTextLength, maxMedia, supportsVideo, supportsLink, costPerPostUsd, costPerLinkPostUsd, dailyPostCeiling, ceilingIsRuntimeData. Read maxTextLength before writing a per-channel text variant.",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "deliveryMode": {
                      "description": "How the post reaches the network: auto (this API publishes it) or reminder (the system prepares it and notifies a person, who publishes by hand). Every seeded channel is reminder.",
                      "type": "string",
                      "enum": [
                        "auto",
                        "reminder"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/channels/{id}/unbind": {
      "post": {
        "operationId": "content_channels_unbind",
        "summary": "Detach a channel from its platform connector, and clear any pause.",
        "description": "Detach a channel from its platform connector, and clear any pause. Delivery mode is left as it is: an auto channel left without a connection fails its publications visibly rather than being silently downgraded to reminders.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_channels_unbind",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The channel id returned by content_channels_list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "network",
                    "subjectType",
                    "deliveryMode",
                    "displayName",
                    "capabilities",
                    "connectorId",
                    "pausedAt",
                    "pauseReason",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Channel id — pass this to content_publications_schedule.",
                      "type": "string"
                    },
                    "network": {
                      "description": "Social network: linkedin, x, youtube, instagram or reddit.",
                      "type": "string"
                    },
                    "pausedAt": {
                      "description": "ISO-8601 time the connector stopped working, or null when healthy. A paused channel keeps its scheduled publications — they are frozen, not cancelled, and dispatch once it resumes.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "connectorId": {
                      "description": "Platform connector this channel publishes through, or null for a reminder channel that needs none. An id — this toolkit never holds social credentials; a token is fetched per call and discarded.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "displayName": {
                      "description": "Human label for the channel.",
                      "type": "string"
                    },
                    "pauseReason": {
                      "description": "Why it paused: revoked (access was taken away), expired (the credential ran out), or the provider reason code from a failed publish. Null when healthy.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "subjectType": {
                      "description": "Who publishes: member (a personal account) or organization (a company page). Phase 1 channels are all member accounts.",
                      "type": "string",
                      "enum": [
                        "member",
                        "organization"
                      ]
                    },
                    "capabilities": {
                      "description": "What the channel accepts and what it costs: maxTextLength, maxMedia, supportsVideo, supportsLink, costPerPostUsd, costPerLinkPostUsd, dailyPostCeiling, ceilingIsRuntimeData. Read maxTextLength before writing a per-channel text variant.",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "deliveryMode": {
                      "description": "How the post reaches the network: auto (this API publishes it) or reminder (the system prepares it and notifies a person, who publishes by hand). Every seeded channel is reminder.",
                      "type": "string",
                      "enum": [
                        "auto",
                        "reminder"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/media": {
      "get": {
        "operationId": "content_media_list",
        "summary": "List media assets, newest first, optionally filtered by storage status.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_media_list",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Return only assets in this storage status.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "ready",
                "failed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of assets to return (1-100, default 50).",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many assets to skip, for paging.",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "assets",
                    "total"
                  ],
                  "properties": {
                    "total": {
                      "description": "Total number of matching assets, ignoring paging.",
                      "type": "integer"
                    },
                    "assets": {
                      "description": "The page of assets, newest first.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "key",
                          "mime",
                          "sizeBytes",
                          "status",
                          "source",
                          "sourceUrl",
                          "filename",
                          "error",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Media asset id. Use it to attach the asset to a post.",
                            "type": "string"
                          },
                          "key": {
                            "description": "Object key in the product bucket. Private — hand it to no one, it is not a URL.",
                            "type": "string"
                          },
                          "mime": {
                            "description": "Stored media type, or null while still pending.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "error": {
                            "description": "Why the asset is failed — a readable reason, or null when nothing went wrong.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "description": "How the bytes arrived: url (fetched by the toolkit) or upload (PUT by the app).",
                            "type": "string",
                            "enum": [
                              "url",
                              "upload"
                            ]
                          },
                          "status": {
                            "description": "Storage status: pending (the bytes are not in the bucket yet) -> ready (stored, attachable to a post) or failed (ingestion gave up; see error).",
                            "type": "string",
                            "enum": [
                              "pending",
                              "ready",
                              "failed"
                            ]
                          },
                          "filename": {
                            "description": "Original filename, kept for display only.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation time.",
                            "type": "string"
                          },
                          "sizeBytes": {
                            "description": "Stored size in bytes, or null while pending.",
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "sourceUrl": {
                            "description": "The URL the bytes were fetched from, if any.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "description": "ISO-8601 time of the last change.",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "content_media_upload",
        "summary": "Ingest media from a public http(s) URL: the toolkit fetches it and stores it in the product bucket.",
        "description": "Ingest media from a public http(s) URL: the toolkit fetches it and stores it in the product bucket. Images and video up to 512 MB. A fetch that fails returns the asset with status \"failed\" and a reason rather than an error.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_media_upload",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sourceUrl": {
                    "description": "Public http(s) URL the toolkit fetches server-side. Images and video only, up to 512 MB.",
                    "type": "string",
                    "format": "uri"
                  },
                  "filename": {
                    "description": "Name to store the file under. Defaults to the last path segment of the URL.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "sourceUrl"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "key",
                    "mime",
                    "sizeBytes",
                    "status",
                    "source",
                    "sourceUrl",
                    "filename",
                    "error",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Media asset id. Use it to attach the asset to a post.",
                      "type": "string"
                    },
                    "key": {
                      "description": "Object key in the product bucket. Private — hand it to no one, it is not a URL.",
                      "type": "string"
                    },
                    "mime": {
                      "description": "Stored media type, or null while still pending.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {
                      "description": "Why the asset is failed — a readable reason, or null when nothing went wrong.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "description": "How the bytes arrived: url (fetched by the toolkit) or upload (PUT by the app).",
                      "type": "string",
                      "enum": [
                        "url",
                        "upload"
                      ]
                    },
                    "status": {
                      "description": "Storage status: pending (the bytes are not in the bucket yet) -> ready (stored, attachable to a post) or failed (ingestion gave up; see error).",
                      "type": "string",
                      "enum": [
                        "pending",
                        "ready",
                        "failed"
                      ]
                    },
                    "filename": {
                      "description": "Original filename, kept for display only.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "sizeBytes": {
                      "description": "Stored size in bytes, or null while pending.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sourceUrl": {
                      "description": "The URL the bytes were fetched from, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/media/{id}": {
      "get": {
        "operationId": "content_media_get",
        "summary": "Read one media asset: its storage status, type and size.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_media_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The media asset id returned when it was created.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "key",
                    "mime",
                    "sizeBytes",
                    "status",
                    "source",
                    "sourceUrl",
                    "filename",
                    "error",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Media asset id. Use it to attach the asset to a post.",
                      "type": "string"
                    },
                    "key": {
                      "description": "Object key in the product bucket. Private — hand it to no one, it is not a URL.",
                      "type": "string"
                    },
                    "mime": {
                      "description": "Stored media type, or null while still pending.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {
                      "description": "Why the asset is failed — a readable reason, or null when nothing went wrong.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "description": "How the bytes arrived: url (fetched by the toolkit) or upload (PUT by the app).",
                      "type": "string",
                      "enum": [
                        "url",
                        "upload"
                      ]
                    },
                    "status": {
                      "description": "Storage status: pending (the bytes are not in the bucket yet) -> ready (stored, attachable to a post) or failed (ingestion gave up; see error).",
                      "type": "string",
                      "enum": [
                        "pending",
                        "ready",
                        "failed"
                      ]
                    },
                    "filename": {
                      "description": "Original filename, kept for display only.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "sizeBytes": {
                      "description": "Stored size in bytes, or null while pending.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sourceUrl": {
                      "description": "The URL the bytes were fetched from, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/media/{id}/finalize": {
      "post": {
        "operationId": "content_media_finalize",
        "summary": "Confirm a signed-URL upload.",
        "description": "Confirm a signed-URL upload. The bucket is asked what was actually stored, and the asset becomes ready. Fails while no object has been uploaded yet.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_media_finalize",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The media asset id returned when it was created.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "key",
                    "mime",
                    "sizeBytes",
                    "status",
                    "source",
                    "sourceUrl",
                    "filename",
                    "error",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Media asset id. Use it to attach the asset to a post.",
                      "type": "string"
                    },
                    "key": {
                      "description": "Object key in the product bucket. Private — hand it to no one, it is not a URL.",
                      "type": "string"
                    },
                    "mime": {
                      "description": "Stored media type, or null while still pending.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {
                      "description": "Why the asset is failed — a readable reason, or null when nothing went wrong.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "source": {
                      "description": "How the bytes arrived: url (fetched by the toolkit) or upload (PUT by the app).",
                      "type": "string",
                      "enum": [
                        "url",
                        "upload"
                      ]
                    },
                    "status": {
                      "description": "Storage status: pending (the bytes are not in the bucket yet) -> ready (stored, attachable to a post) or failed (ingestion gave up; see error).",
                      "type": "string",
                      "enum": [
                        "pending",
                        "ready",
                        "failed"
                      ]
                    },
                    "filename": {
                      "description": "Original filename, kept for display only.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "sizeBytes": {
                      "description": "Stored size in bytes, or null while pending.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sourceUrl": {
                      "description": "The URL the bytes were fetched from, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/media/upload-url": {
      "post": {
        "operationId": "content_media_create_upload_url",
        "summary": "Get a time-limited signed URL to PUT a file straight into the product bucket.",
        "description": "Get a time-limited signed URL to PUT a file straight into the product bucket. Creates a pending asset; call content_media_finalize once the upload finishes.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_media_create_upload_url",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "contentType": {
                    "description": "The media type the app will PUT, e.g. video/mp4. Must be image/* or video/*.",
                    "type": "string",
                    "minLength": 1
                  },
                  "filename": {
                    "description": "Name to store the file under, for display purposes.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "contentType"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "asset",
                    "uploadUrl",
                    "contentType",
                    "expiresAt"
                  ],
                  "properties": {
                    "asset": {
                      "description": "The pending asset row. It turns ready on finalize.",
                      "type": "object",
                      "required": [
                        "id",
                        "key",
                        "mime",
                        "sizeBytes",
                        "status",
                        "source",
                        "sourceUrl",
                        "filename",
                        "error",
                        "createdAt",
                        "updatedAt"
                      ],
                      "properties": {
                        "id": {
                          "description": "Media asset id. Use it to attach the asset to a post.",
                          "type": "string"
                        },
                        "key": {
                          "description": "Object key in the product bucket. Private — hand it to no one, it is not a URL.",
                          "type": "string"
                        },
                        "mime": {
                          "description": "Stored media type, or null while still pending.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "error": {
                          "description": "Why the asset is failed — a readable reason, or null when nothing went wrong.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "source": {
                          "description": "How the bytes arrived: url (fetched by the toolkit) or upload (PUT by the app).",
                          "type": "string",
                          "enum": [
                            "url",
                            "upload"
                          ]
                        },
                        "status": {
                          "description": "Storage status: pending (the bytes are not in the bucket yet) -> ready (stored, attachable to a post) or failed (ingestion gave up; see error).",
                          "type": "string",
                          "enum": [
                            "pending",
                            "ready",
                            "failed"
                          ]
                        },
                        "filename": {
                          "description": "Original filename, kept for display only.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "createdAt": {
                          "description": "ISO-8601 creation time.",
                          "type": "string"
                        },
                        "sizeBytes": {
                          "description": "Stored size in bytes, or null while pending.",
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "sourceUrl": {
                          "description": "The URL the bytes were fetched from, if any.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "updatedAt": {
                          "description": "ISO-8601 time of the last change.",
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "expiresAt": {
                      "description": "ISO-8601 time after which the upload URL stops working.",
                      "type": "string"
                    },
                    "uploadUrl": {
                      "description": "Time-limited signed PUT URL. Upload the bytes to it, then call the finalize tool.",
                      "type": "string"
                    },
                    "contentType": {
                      "description": "The Content-Type header the PUT must send — the signature covers it.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/metrics/channels/{id}": {
      "get": {
        "operationId": "content_metrics_channel_series",
        "summary": "Daily snapshots of a channel itself — follower count and channel-level reach over time.",
        "description": "Daily snapshots of a channel itself — follower count and channel-level reach over time. Sampled once a day while the channel is publishing; a channel with nothing published in the last 30 days stops being sampled, and one whose network reports no analytics is never sampled at all.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_metrics_channel_series",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The channel id, from content_channels_list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "ISO-8601 lower bound on capture time, inclusive. Omit for \"from the beginning\".",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "ISO-8601 upper bound on capture time, inclusive. Omit for \"up to now\".",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of snapshots to return, oldest first.",
            "schema": {
              "type": "integer",
              "default": 200,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channelId",
                    "network",
                    "analytics",
                    "points"
                  ],
                  "properties": {
                    "points": {
                      "description": "Daily snapshots, oldest first.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "capturedAt",
                          "metrics"
                        ],
                        "properties": {
                          "metrics": {
                            "description": "The snapshot as the adapter recorded it: the availability it reported, the cross-network metric set (a null field means the network does not report it — never zero), and the raw payload.",
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "capturedAt": {
                            "description": "ISO-8601 time this snapshot was taken.",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "network": {
                      "description": "The network the channel publishes to.",
                      "type": "string"
                    },
                    "analytics": {
                      "description": "What this network reports for this account. \"none\" means no snapshot will ever be taken — a personal Instagram profile has no API at all; \"basic\" means fewer numbers than a business account gets, so an absent metric is the network's silence, not a zero.",
                      "type": "string",
                      "enum": [
                        "full",
                        "basic",
                        "none"
                      ]
                    },
                    "channelId": {
                      "description": "The channel these snapshots belong to.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/metrics/posts/{id}": {
      "get": {
        "operationId": "content_metrics_post_series",
        "summary": "Metric snapshots of one published post on one channel, over time — how reach and engagement grew, not a single current number.",
        "description": "Metric snapshots of one published post on one channel, over time — how reach and engagement grew, not a single current number. Sampled hourly for the first day, then daily, then weekly, then never: a post stops growing and the polling stops with it. Empty until the first snapshot, and always empty where analytics is \"none\".",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_metrics_post_series",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The publication id, from content_publications_schedule or content_publications_list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "ISO-8601 lower bound on capture time, inclusive. Omit for \"from the beginning\".",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "ISO-8601 upper bound on capture time, inclusive. Omit for \"up to now\".",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of snapshots to return, oldest first.",
            "schema": {
              "type": "integer",
              "default": 200,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "publicationId",
                    "channelId",
                    "network",
                    "analytics",
                    "points"
                  ],
                  "properties": {
                    "points": {
                      "description": "Snapshots oldest first. Readings over time, not a current value: reach keeps growing for weeks. Empty means nothing has been captured yet.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "capturedAt",
                          "metrics"
                        ],
                        "properties": {
                          "metrics": {
                            "description": "The snapshot as the adapter recorded it: the availability it reported, the cross-network metric set (a null field means the network does not report it — never zero), and the raw payload.",
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "capturedAt": {
                            "description": "ISO-8601 time this snapshot was taken.",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "network": {
                      "description": "The network the channel publishes to.",
                      "type": "string"
                    },
                    "analytics": {
                      "description": "What this network reports for this account. \"none\" means no snapshot will ever be taken — a personal Instagram profile has no API at all; \"basic\" means fewer numbers than a business account gets, so an absent metric is the network's silence, not a zero.",
                      "type": "string",
                      "enum": [
                        "full",
                        "basic",
                        "none"
                      ]
                    },
                    "channelId": {
                      "description": "The channel it was published to.",
                      "type": "string"
                    },
                    "publicationId": {
                      "description": "The publication these snapshots belong to.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/posts": {
      "get": {
        "operationId": "content_posts_list",
        "summary": "List posts, newest first, optionally filtered by lifecycle status.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_list",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Return only posts in this status.",
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "pending_approval",
                "approved",
                "scheduled",
                "published",
                "failed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of posts to return (1-100, default 50).",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many posts to skip, for paging.",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "posts",
                    "total"
                  ],
                  "properties": {
                    "posts": {
                      "description": "The page of posts, newest first.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "text",
                          "media",
                          "author",
                          "status",
                          "currentVersion",
                          "approvedVersion",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Post id.",
                            "type": "string"
                          },
                          "text": {
                            "description": "The current text of the post, in markdown.",
                            "type": "string"
                          },
                          "media": {
                            "description": "Media references attached to the current version.",
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "author": {
                            "description": "Identity id of whoever composed the post.",
                            "type": "string"
                          },
                          "status": {
                            "description": "Post lifecycle status: draft (being written) -> pending_approval (submitted) -> approved (cleared to publish); scheduled/published/failed are set by the publishing pipeline.",
                            "type": "string",
                            "enum": [
                              "draft",
                              "pending_approval",
                              "approved",
                              "scheduled",
                              "published",
                              "failed"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation time.",
                            "type": "string"
                          },
                          "updatedAt": {
                            "description": "ISO-8601 time of the last change.",
                            "type": "string"
                          },
                          "currentVersion": {
                            "description": "Version number of the current text.",
                            "type": "integer"
                          },
                          "approvedVersion": {
                            "description": "The version an approval binds to, or null. Cleared on every edit: approving one text never covers another.",
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "total": {
                      "description": "Total number of matching posts, ignoring paging.",
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "content_posts_create",
        "summary": "Create a post.",
        "description": "Create a post. It starts as a draft at version 1; submit it for approval when the text is ready.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "description": "The post text, channel-independent, written in markdown — bold, italic, lists, links. Each network gets it flattened to the plain text that network accepts; content_publications_validate shows exactly what that looks like per channel. Per-channel variants come later, at publish time.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  },
                  "media": {
                    "description": "Media references attached to the post, in display order. Opaque strings — the toolkit does not upload or resolve them.",
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "text"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "text",
                    "media",
                    "author",
                    "status",
                    "currentVersion",
                    "approvedVersion",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Post id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The current text of the post, in markdown.",
                      "type": "string"
                    },
                    "media": {
                      "description": "Media references attached to the current version.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "author": {
                      "description": "Identity id of whoever composed the post.",
                      "type": "string"
                    },
                    "status": {
                      "description": "Post lifecycle status: draft (being written) -> pending_approval (submitted) -> approved (cleared to publish); scheduled/published/failed are set by the publishing pipeline.",
                      "type": "string",
                      "enum": [
                        "draft",
                        "pending_approval",
                        "approved",
                        "scheduled",
                        "published",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "currentVersion": {
                      "description": "Version number of the current text.",
                      "type": "integer"
                    },
                    "approvedVersion": {
                      "description": "The version an approval binds to, or null. Cleared on every edit: approving one text never covers another.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/posts/{id}": {
      "get": {
        "operationId": "content_posts_get",
        "summary": "Read one post: its current text, status and version numbers.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The post id returned by content_posts_create.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "text",
                    "media",
                    "author",
                    "status",
                    "currentVersion",
                    "approvedVersion",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Post id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The current text of the post, in markdown.",
                      "type": "string"
                    },
                    "media": {
                      "description": "Media references attached to the current version.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "author": {
                      "description": "Identity id of whoever composed the post.",
                      "type": "string"
                    },
                    "status": {
                      "description": "Post lifecycle status: draft (being written) -> pending_approval (submitted) -> approved (cleared to publish); scheduled/published/failed are set by the publishing pipeline.",
                      "type": "string",
                      "enum": [
                        "draft",
                        "pending_approval",
                        "approved",
                        "scheduled",
                        "published",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "currentVersion": {
                      "description": "Version number of the current text.",
                      "type": "integer"
                    },
                    "approvedVersion": {
                      "description": "The version an approval binds to, or null. Cleared on every edit: approving one text never covers another.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "content_posts_update",
        "summary": "Edit a post.",
        "description": "Edit a post. The edit is recorded as a new immutable version; an edit to an approved post returns it to pending_approval, because an approval binds to one specific text.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The post id returned by content_posts_create.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "text": {
                    "description": "Replacement text, in markdown. Omit to keep the current text.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  },
                  "media": {
                    "description": "Replacement media list (replaces, never merges). Omit to keep the current media.",
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "text",
                    "media",
                    "author",
                    "status",
                    "currentVersion",
                    "approvedVersion",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Post id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The current text of the post, in markdown.",
                      "type": "string"
                    },
                    "media": {
                      "description": "Media references attached to the current version.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "author": {
                      "description": "Identity id of whoever composed the post.",
                      "type": "string"
                    },
                    "status": {
                      "description": "Post lifecycle status: draft (being written) -> pending_approval (submitted) -> approved (cleared to publish); scheduled/published/failed are set by the publishing pipeline.",
                      "type": "string",
                      "enum": [
                        "draft",
                        "pending_approval",
                        "approved",
                        "scheduled",
                        "published",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "currentVersion": {
                      "description": "Version number of the current text.",
                      "type": "integer"
                    },
                    "approvedVersion": {
                      "description": "The version an approval binds to, or null. Cleared on every edit: approving one text never covers another.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/posts/{id}/approve": {
      "post": {
        "operationId": "content_posts_approve",
        "summary": "Approve a post awaiting approval.",
        "description": "Approve a post awaiting approval. The approval binds to the current version — a later edit revokes it.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_approve",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The post id returned by content_posts_create.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "text",
                    "media",
                    "author",
                    "status",
                    "currentVersion",
                    "approvedVersion",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Post id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The current text of the post, in markdown.",
                      "type": "string"
                    },
                    "media": {
                      "description": "Media references attached to the current version.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "author": {
                      "description": "Identity id of whoever composed the post.",
                      "type": "string"
                    },
                    "status": {
                      "description": "Post lifecycle status: draft (being written) -> pending_approval (submitted) -> approved (cleared to publish); scheduled/published/failed are set by the publishing pipeline.",
                      "type": "string",
                      "enum": [
                        "draft",
                        "pending_approval",
                        "approved",
                        "scheduled",
                        "published",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "currentVersion": {
                      "description": "Version number of the current text.",
                      "type": "integer"
                    },
                    "approvedVersion": {
                      "description": "The version an approval binds to, or null. Cleared on every edit: approving one text never covers another.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/posts/{id}/media/attach": {
      "post": {
        "operationId": "content_posts_attach_media",
        "summary": "Attach stored media assets to a post, appended in the given order.",
        "description": "Attach stored media assets to a post, appended in the given order. Only assets that are ready can be attached. This counts as an edit: the post gets a new version and an approved post returns to pending_approval.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_attach_media",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The post id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mediaIds": {
                    "description": "Media asset ids, in the order they should appear on the post.",
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "description": "The media asset id returned when it was created.",
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "mediaIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "text",
                    "media",
                    "author",
                    "status",
                    "currentVersion",
                    "approvedVersion",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Post id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The current text of the post, in markdown.",
                      "type": "string"
                    },
                    "media": {
                      "description": "Media references attached to the current version.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "author": {
                      "description": "Identity id of whoever composed the post.",
                      "type": "string"
                    },
                    "status": {
                      "description": "Post lifecycle status: draft (being written) -> pending_approval (submitted) -> approved (cleared to publish); scheduled/published/failed are set by the publishing pipeline.",
                      "type": "string",
                      "enum": [
                        "draft",
                        "pending_approval",
                        "approved",
                        "scheduled",
                        "published",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "currentVersion": {
                      "description": "Version number of the current text.",
                      "type": "integer"
                    },
                    "approvedVersion": {
                      "description": "The version an approval binds to, or null. Cleared on every edit: approving one text never covers another.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/posts/{id}/media/detach": {
      "post": {
        "operationId": "content_posts_detach_media",
        "summary": "Remove media assets from a post, keeping the order of the rest.",
        "description": "Remove media assets from a post, keeping the order of the rest. Like any edit, it produces a new version and returns an approved post to pending_approval.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_detach_media",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The post id.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mediaIds": {
                    "description": "Media asset ids to remove from the post.",
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "description": "The media asset id returned when it was created.",
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "mediaIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "text",
                    "media",
                    "author",
                    "status",
                    "currentVersion",
                    "approvedVersion",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Post id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The current text of the post, in markdown.",
                      "type": "string"
                    },
                    "media": {
                      "description": "Media references attached to the current version.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "author": {
                      "description": "Identity id of whoever composed the post.",
                      "type": "string"
                    },
                    "status": {
                      "description": "Post lifecycle status: draft (being written) -> pending_approval (submitted) -> approved (cleared to publish); scheduled/published/failed are set by the publishing pipeline.",
                      "type": "string",
                      "enum": [
                        "draft",
                        "pending_approval",
                        "approved",
                        "scheduled",
                        "published",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "currentVersion": {
                      "description": "Version number of the current text.",
                      "type": "integer"
                    },
                    "approvedVersion": {
                      "description": "The version an approval binds to, or null. Cleared on every edit: approving one text never covers another.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/posts/{id}/submit": {
      "post": {
        "operationId": "content_posts_submit",
        "summary": "Submit a draft for approval.",
        "description": "Submit a draft for approval. Only a draft can be submitted.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_submit",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The post id returned by content_posts_create.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "text",
                    "media",
                    "author",
                    "status",
                    "currentVersion",
                    "approvedVersion",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Post id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The current text of the post, in markdown.",
                      "type": "string"
                    },
                    "media": {
                      "description": "Media references attached to the current version.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "author": {
                      "description": "Identity id of whoever composed the post.",
                      "type": "string"
                    },
                    "status": {
                      "description": "Post lifecycle status: draft (being written) -> pending_approval (submitted) -> approved (cleared to publish); scheduled/published/failed are set by the publishing pipeline.",
                      "type": "string",
                      "enum": [
                        "draft",
                        "pending_approval",
                        "approved",
                        "scheduled",
                        "published",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "currentVersion": {
                      "description": "Version number of the current text.",
                      "type": "integer"
                    },
                    "approvedVersion": {
                      "description": "The version an approval binds to, or null. Cleared on every edit: approving one text never covers another.",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/posts/{id}/versions": {
      "get": {
        "operationId": "content_posts_versions",
        "summary": "List every version of a post, oldest first — the audit trail of what was written and by whom.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_posts_versions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The post id returned by content_posts_create.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "postId",
                    "versions"
                  ],
                  "properties": {
                    "postId": {
                      "description": "The post these versions belong to.",
                      "type": "string"
                    },
                    "versions": {
                      "description": "Every version, oldest first.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "postId",
                          "version",
                          "text",
                          "media",
                          "createdBy",
                          "createdAt"
                        ],
                        "properties": {
                          "text": {
                            "description": "The text as it stood at this version.",
                            "type": "string"
                          },
                          "media": {
                            "description": "Media references as they stood at this version.",
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "postId": {
                            "description": "Post the version belongs to.",
                            "type": "string"
                          },
                          "version": {
                            "description": "Version number, starting at 1.",
                            "type": "integer"
                          },
                          "createdAt": {
                            "description": "ISO-8601 time the version was recorded.",
                            "type": "string"
                          },
                          "createdBy": {
                            "description": "Identity id of whoever produced this version.",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/publications": {
      "get": {
        "operationId": "content_publications_list",
        "summary": "List publications — the queue and the timeline — newest slot first.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_list",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Return only publications in this state.",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "publishing",
                "published",
                "failed",
                "cancelled"
              ]
            }
          },
          {
            "name": "postId",
            "in": "query",
            "required": false,
            "description": "Return only publications of this post.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "channelId",
            "in": "query",
            "required": false,
            "description": "Return only publications to this channel.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number to return (1-100, default 50).",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "How many to skip, for paging.",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          },
          {
            "name": "scheduledFrom",
            "in": "query",
            "required": false,
            "description": "Return only publications scheduled at or after this ISO-8601 time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "scheduledTo",
            "in": "query",
            "required": false,
            "description": "Return only publications scheduled at or before this ISO-8601 time.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "publications",
                    "total"
                  ],
                  "properties": {
                    "total": {
                      "description": "Total number of matching publications, ignoring paging.",
                      "type": "integer"
                    },
                    "publications": {
                      "description": "The page of publications, newest slot first.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "postId",
                          "channelId",
                          "text",
                          "costUsd",
                          "costBasis",
                          "scheduledAt",
                          "state",
                          "attempts",
                          "idempotencyKey",
                          "externalId",
                          "externalUrl",
                          "reminderSentAt",
                          "reminderCount",
                          "publishedAt",
                          "lastError",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Publication id.",
                            "type": "string"
                          },
                          "text": {
                            "description": "The exact text that will be published to this channel — markdown already flattened to plain network text at schedule time. Not the markdown source; that stays on the post.",
                            "type": "string"
                          },
                          "state": {
                            "description": "pending (queued) -> publishing (the reminder was sent; a person is publishing by hand) -> published (confirmed) | failed | cancelled.",
                            "type": "string",
                            "enum": [
                              "pending",
                              "publishing",
                              "published",
                              "failed",
                              "cancelled"
                            ]
                          },
                          "postId": {
                            "description": "The post being published.",
                            "type": "string"
                          },
                          "costUsd": {
                            "description": "What publishing this costs in USD, computed when it was scheduled. On X a post carrying a link costs 13x a plain one. Null means the cost is not known — an auto channel refuses to dispatch it.",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "attempts": {
                            "description": "How many dispatch attempts have been made.",
                            "type": "integer"
                          },
                          "channelId": {
                            "description": "The channel it is published to.",
                            "type": "string"
                          },
                          "costBasis": {
                            "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation time.",
                            "type": "string"
                          },
                          "lastError": {
                            "description": "The most recent failure, if any.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "updatedAt": {
                            "description": "ISO-8601 time of the last change.",
                            "type": "string"
                          },
                          "externalId": {
                            "description": "The network's id for the published post, once known.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "externalUrl": {
                            "description": "URL of the published post, once known.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "publishedAt": {
                            "description": "ISO-8601 time it was confirmed published.",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "scheduledAt": {
                            "description": "ISO-8601 time the publication is due.",
                            "type": "string"
                          },
                          "reminderCount": {
                            "description": "How many reminders have been sent for this publication.",
                            "type": "integer"
                          },
                          "idempotencyKey": {
                            "description": "The key that makes a retry the same publication.",
                            "type": "string"
                          },
                          "reminderSentAt": {
                            "description": "ISO-8601 time the most recent reminder went out, or null if none has.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "content_publications_schedule",
        "summary": "Queue an approved post for publication to one channel at a given time.",
        "description": "Queue an approved post for publication to one channel at a given time. On a reminder channel this does not call the network: at the scheduled time a person is notified to publish by hand, and confirms afterwards with content_publications_confirm.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_schedule",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postId": {
                    "description": "The post to publish. It must already be approved — an unapproved text never publishes.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "channelId": {
                    "description": "The channel to publish to. Get its character limit from content_channels_get first.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "scheduledAt": {
                    "description": "ISO-8601 time to publish. In the past means \"as soon as the next tick runs\".",
                    "type": "string",
                    "format": "date-time"
                  },
                  "text": {
                    "description": "Per-channel variant of the text, in markdown. Omit to use the post text. It is rendered to plain network text before it is stored — call content_publications_validate first if you want to see the result.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  },
                  "idempotencyKey": {
                    "description": "Your own key for this publishing intent, unique within the product. Resending the same key returns the SAME publication instead of creating a second one — a duplicate in a client feed is the worst defect this product can ship. Omit it and one is derived from post, channel and time.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "postId",
                  "channelId",
                  "scheduledAt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "postId",
                    "channelId",
                    "text",
                    "costUsd",
                    "costBasis",
                    "scheduledAt",
                    "state",
                    "attempts",
                    "idempotencyKey",
                    "externalId",
                    "externalUrl",
                    "reminderSentAt",
                    "reminderCount",
                    "publishedAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Publication id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The exact text that will be published to this channel — markdown already flattened to plain network text at schedule time. Not the markdown source; that stays on the post.",
                      "type": "string"
                    },
                    "state": {
                      "description": "pending (queued) -> publishing (the reminder was sent; a person is publishing by hand) -> published (confirmed) | failed | cancelled.",
                      "type": "string",
                      "enum": [
                        "pending",
                        "publishing",
                        "published",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "postId": {
                      "description": "The post being published.",
                      "type": "string"
                    },
                    "costUsd": {
                      "description": "What publishing this costs in USD, computed when it was scheduled. On X a post carrying a link costs 13x a plain one. Null means the cost is not known — an auto channel refuses to dispatch it.",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "attempts": {
                      "description": "How many dispatch attempts have been made.",
                      "type": "integer"
                    },
                    "channelId": {
                      "description": "The channel it is published to.",
                      "type": "string"
                    },
                    "costBasis": {
                      "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "lastError": {
                      "description": "The most recent failure, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "externalId": {
                      "description": "The network's id for the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUrl": {
                      "description": "URL of the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publishedAt": {
                      "description": "ISO-8601 time it was confirmed published.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduledAt": {
                      "description": "ISO-8601 time the publication is due.",
                      "type": "string"
                    },
                    "reminderCount": {
                      "description": "How many reminders have been sent for this publication.",
                      "type": "integer"
                    },
                    "idempotencyKey": {
                      "description": "The key that makes a retry the same publication.",
                      "type": "string"
                    },
                    "reminderSentAt": {
                      "description": "ISO-8601 time the most recent reminder went out, or null if none has.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/publications/{id}": {
      "get": {
        "operationId": "content_publications_get",
        "summary": "Read one publication: its state, its slot, and where it ended up.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The publication id returned by content_publications_schedule.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "postId",
                    "channelId",
                    "text",
                    "costUsd",
                    "costBasis",
                    "scheduledAt",
                    "state",
                    "attempts",
                    "idempotencyKey",
                    "externalId",
                    "externalUrl",
                    "reminderSentAt",
                    "reminderCount",
                    "publishedAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Publication id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The exact text that will be published to this channel — markdown already flattened to plain network text at schedule time. Not the markdown source; that stays on the post.",
                      "type": "string"
                    },
                    "state": {
                      "description": "pending (queued) -> publishing (the reminder was sent; a person is publishing by hand) -> published (confirmed) | failed | cancelled.",
                      "type": "string",
                      "enum": [
                        "pending",
                        "publishing",
                        "published",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "postId": {
                      "description": "The post being published.",
                      "type": "string"
                    },
                    "costUsd": {
                      "description": "What publishing this costs in USD, computed when it was scheduled. On X a post carrying a link costs 13x a plain one. Null means the cost is not known — an auto channel refuses to dispatch it.",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "attempts": {
                      "description": "How many dispatch attempts have been made.",
                      "type": "integer"
                    },
                    "channelId": {
                      "description": "The channel it is published to.",
                      "type": "string"
                    },
                    "costBasis": {
                      "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "lastError": {
                      "description": "The most recent failure, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "externalId": {
                      "description": "The network's id for the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUrl": {
                      "description": "URL of the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publishedAt": {
                      "description": "ISO-8601 time it was confirmed published.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduledAt": {
                      "description": "ISO-8601 time the publication is due.",
                      "type": "string"
                    },
                    "reminderCount": {
                      "description": "How many reminders have been sent for this publication.",
                      "type": "integer"
                    },
                    "idempotencyKey": {
                      "description": "The key that makes a retry the same publication.",
                      "type": "string"
                    },
                    "reminderSentAt": {
                      "description": "ISO-8601 time the most recent reminder went out, or null if none has.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/publications/{id}/cancel": {
      "post": {
        "operationId": "content_publications_cancel",
        "summary": "Cancel a publication that has not finished.",
        "description": "Cancel a publication that has not finished. A publication whose reminder already went out can still be cancelled — until someone confirms it.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The publication id returned by content_publications_schedule.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "postId",
                    "channelId",
                    "text",
                    "costUsd",
                    "costBasis",
                    "scheduledAt",
                    "state",
                    "attempts",
                    "idempotencyKey",
                    "externalId",
                    "externalUrl",
                    "reminderSentAt",
                    "reminderCount",
                    "publishedAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Publication id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The exact text that will be published to this channel — markdown already flattened to plain network text at schedule time. Not the markdown source; that stays on the post.",
                      "type": "string"
                    },
                    "state": {
                      "description": "pending (queued) -> publishing (the reminder was sent; a person is publishing by hand) -> published (confirmed) | failed | cancelled.",
                      "type": "string",
                      "enum": [
                        "pending",
                        "publishing",
                        "published",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "postId": {
                      "description": "The post being published.",
                      "type": "string"
                    },
                    "costUsd": {
                      "description": "What publishing this costs in USD, computed when it was scheduled. On X a post carrying a link costs 13x a plain one. Null means the cost is not known — an auto channel refuses to dispatch it.",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "attempts": {
                      "description": "How many dispatch attempts have been made.",
                      "type": "integer"
                    },
                    "channelId": {
                      "description": "The channel it is published to.",
                      "type": "string"
                    },
                    "costBasis": {
                      "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "lastError": {
                      "description": "The most recent failure, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "externalId": {
                      "description": "The network's id for the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUrl": {
                      "description": "URL of the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publishedAt": {
                      "description": "ISO-8601 time it was confirmed published.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduledAt": {
                      "description": "ISO-8601 time the publication is due.",
                      "type": "string"
                    },
                    "reminderCount": {
                      "description": "How many reminders have been sent for this publication.",
                      "type": "integer"
                    },
                    "idempotencyKey": {
                      "description": "The key that makes a retry the same publication.",
                      "type": "string"
                    },
                    "reminderSentAt": {
                      "description": "ISO-8601 time the most recent reminder went out, or null if none has.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/publications/{id}/confirm": {
      "post": {
        "operationId": "content_publications_confirm",
        "summary": "Confirm that a person published the post by hand, optionally with the URL it landed at.",
        "description": "Confirm that a person published the post by hand, optionally with the URL it landed at. This closes the publication. It stays available after the fact — reminded, published, forgot to confirm, confirm later is a normal sequence.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_confirm",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The publication id returned by content_publications_schedule.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "externalUrl": {
                    "description": "URL of the post the person actually published. Worth supplying — it is what identifies the post later.",
                    "type": "string",
                    "format": "uri"
                  },
                  "externalId": {
                    "description": "The network's own id for the post, if known.",
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "postId",
                    "channelId",
                    "text",
                    "costUsd",
                    "costBasis",
                    "scheduledAt",
                    "state",
                    "attempts",
                    "idempotencyKey",
                    "externalId",
                    "externalUrl",
                    "reminderSentAt",
                    "reminderCount",
                    "publishedAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Publication id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The exact text that will be published to this channel — markdown already flattened to plain network text at schedule time. Not the markdown source; that stays on the post.",
                      "type": "string"
                    },
                    "state": {
                      "description": "pending (queued) -> publishing (the reminder was sent; a person is publishing by hand) -> published (confirmed) | failed | cancelled.",
                      "type": "string",
                      "enum": [
                        "pending",
                        "publishing",
                        "published",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "postId": {
                      "description": "The post being published.",
                      "type": "string"
                    },
                    "costUsd": {
                      "description": "What publishing this costs in USD, computed when it was scheduled. On X a post carrying a link costs 13x a plain one. Null means the cost is not known — an auto channel refuses to dispatch it.",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "attempts": {
                      "description": "How many dispatch attempts have been made.",
                      "type": "integer"
                    },
                    "channelId": {
                      "description": "The channel it is published to.",
                      "type": "string"
                    },
                    "costBasis": {
                      "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "lastError": {
                      "description": "The most recent failure, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "externalId": {
                      "description": "The network's id for the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUrl": {
                      "description": "URL of the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publishedAt": {
                      "description": "ISO-8601 time it was confirmed published.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduledAt": {
                      "description": "ISO-8601 time the publication is due.",
                      "type": "string"
                    },
                    "reminderCount": {
                      "description": "How many reminders have been sent for this publication.",
                      "type": "integer"
                    },
                    "idempotencyKey": {
                      "description": "The key that makes a retry the same publication.",
                      "type": "string"
                    },
                    "reminderSentAt": {
                      "description": "ISO-8601 time the most recent reminder went out, or null if none has.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/publications/{id}/remind": {
      "post": {
        "operationId": "content_publications_remind",
        "summary": "Send the publish reminder AGAIN.",
        "description": "Send the publish reminder AGAIN. Repeat reminders are never automatic: the system cannot double-publish, but a person can, so a second nudge only ever happens because someone asked for it.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_remind",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The publication id returned by content_publications_schedule.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "postId",
                    "channelId",
                    "text",
                    "costUsd",
                    "costBasis",
                    "scheduledAt",
                    "state",
                    "attempts",
                    "idempotencyKey",
                    "externalId",
                    "externalUrl",
                    "reminderSentAt",
                    "reminderCount",
                    "publishedAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Publication id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The exact text that will be published to this channel — markdown already flattened to plain network text at schedule time. Not the markdown source; that stays on the post.",
                      "type": "string"
                    },
                    "state": {
                      "description": "pending (queued) -> publishing (the reminder was sent; a person is publishing by hand) -> published (confirmed) | failed | cancelled.",
                      "type": "string",
                      "enum": [
                        "pending",
                        "publishing",
                        "published",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "postId": {
                      "description": "The post being published.",
                      "type": "string"
                    },
                    "costUsd": {
                      "description": "What publishing this costs in USD, computed when it was scheduled. On X a post carrying a link costs 13x a plain one. Null means the cost is not known — an auto channel refuses to dispatch it.",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "attempts": {
                      "description": "How many dispatch attempts have been made.",
                      "type": "integer"
                    },
                    "channelId": {
                      "description": "The channel it is published to.",
                      "type": "string"
                    },
                    "costBasis": {
                      "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "lastError": {
                      "description": "The most recent failure, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "externalId": {
                      "description": "The network's id for the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUrl": {
                      "description": "URL of the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publishedAt": {
                      "description": "ISO-8601 time it was confirmed published.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduledAt": {
                      "description": "ISO-8601 time the publication is due.",
                      "type": "string"
                    },
                    "reminderCount": {
                      "description": "How many reminders have been sent for this publication.",
                      "type": "integer"
                    },
                    "idempotencyKey": {
                      "description": "The key that makes a retry the same publication.",
                      "type": "string"
                    },
                    "reminderSentAt": {
                      "description": "ISO-8601 time the most recent reminder went out, or null if none has.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/publications/{id}/reschedule": {
      "post": {
        "operationId": "content_publications_reschedule",
        "summary": "Move a publication to a new time.",
        "description": "Move a publication to a new time. It returns to the queue, and the reminder for the old slot is spent — a new one goes out at the new time.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_reschedule",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The publication id returned by content_publications_schedule.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduledAt": {
                    "description": "New ISO-8601 time. The publication returns to the queue.",
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "scheduledAt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "postId",
                    "channelId",
                    "text",
                    "costUsd",
                    "costBasis",
                    "scheduledAt",
                    "state",
                    "attempts",
                    "idempotencyKey",
                    "externalId",
                    "externalUrl",
                    "reminderSentAt",
                    "reminderCount",
                    "publishedAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Publication id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The exact text that will be published to this channel — markdown already flattened to plain network text at schedule time. Not the markdown source; that stays on the post.",
                      "type": "string"
                    },
                    "state": {
                      "description": "pending (queued) -> publishing (the reminder was sent; a person is publishing by hand) -> published (confirmed) | failed | cancelled.",
                      "type": "string",
                      "enum": [
                        "pending",
                        "publishing",
                        "published",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "postId": {
                      "description": "The post being published.",
                      "type": "string"
                    },
                    "costUsd": {
                      "description": "What publishing this costs in USD, computed when it was scheduled. On X a post carrying a link costs 13x a plain one. Null means the cost is not known — an auto channel refuses to dispatch it.",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "attempts": {
                      "description": "How many dispatch attempts have been made.",
                      "type": "integer"
                    },
                    "channelId": {
                      "description": "The channel it is published to.",
                      "type": "string"
                    },
                    "costBasis": {
                      "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "lastError": {
                      "description": "The most recent failure, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "externalId": {
                      "description": "The network's id for the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUrl": {
                      "description": "URL of the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publishedAt": {
                      "description": "ISO-8601 time it was confirmed published.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduledAt": {
                      "description": "ISO-8601 time the publication is due.",
                      "type": "string"
                    },
                    "reminderCount": {
                      "description": "How many reminders have been sent for this publication.",
                      "type": "integer"
                    },
                    "idempotencyKey": {
                      "description": "The key that makes a retry the same publication.",
                      "type": "string"
                    },
                    "reminderSentAt": {
                      "description": "ISO-8601 time the most recent reminder went out, or null if none has.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/publications/publish": {
      "post": {
        "operationId": "content_publications_publish",
        "summary": "Publish NOW: the same queue, scheduled for this instant.",
        "description": "Publish NOW: the same queue, scheduled for this instant. There is no separate synchronous path — a fast path would differ exactly where it matters, on failure.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_publish",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postId": {
                    "description": "The post to publish. It must already be approved.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "channelId": {
                    "description": "The channel to publish to.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "text": {
                    "description": "Per-channel variant of the text, in markdown. Omit to use the post text. It is rendered to plain network text before it is stored — call content_publications_validate first if you want to see the result.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  },
                  "idempotencyKey": {
                    "description": "Your own key for this publishing intent, unique within the product. Resending the same key returns the SAME publication instead of creating a second one — a duplicate in a client feed is the worst defect this product can ship. Omit it and one is derived from post, channel and time.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "postId",
                  "channelId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "postId",
                    "channelId",
                    "text",
                    "costUsd",
                    "costBasis",
                    "scheduledAt",
                    "state",
                    "attempts",
                    "idempotencyKey",
                    "externalId",
                    "externalUrl",
                    "reminderSentAt",
                    "reminderCount",
                    "publishedAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Publication id.",
                      "type": "string"
                    },
                    "text": {
                      "description": "The exact text that will be published to this channel — markdown already flattened to plain network text at schedule time. Not the markdown source; that stays on the post.",
                      "type": "string"
                    },
                    "state": {
                      "description": "pending (queued) -> publishing (the reminder was sent; a person is publishing by hand) -> published (confirmed) | failed | cancelled.",
                      "type": "string",
                      "enum": [
                        "pending",
                        "publishing",
                        "published",
                        "failed",
                        "cancelled"
                      ]
                    },
                    "postId": {
                      "description": "The post being published.",
                      "type": "string"
                    },
                    "costUsd": {
                      "description": "What publishing this costs in USD, computed when it was scheduled. On X a post carrying a link costs 13x a plain one. Null means the cost is not known — an auto channel refuses to dispatch it.",
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "attempts": {
                      "description": "How many dispatch attempts have been made.",
                      "type": "integer"
                    },
                    "channelId": {
                      "description": "The channel it is published to.",
                      "type": "string"
                    },
                    "costBasis": {
                      "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation time.",
                      "type": "string"
                    },
                    "lastError": {
                      "description": "The most recent failure, if any.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "description": "ISO-8601 time of the last change.",
                      "type": "string"
                    },
                    "externalId": {
                      "description": "The network's id for the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "externalUrl": {
                      "description": "URL of the published post, once known.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "publishedAt": {
                      "description": "ISO-8601 time it was confirmed published.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduledAt": {
                      "description": "ISO-8601 time the publication is due.",
                      "type": "string"
                    },
                    "reminderCount": {
                      "description": "How many reminders have been sent for this publication.",
                      "type": "integer"
                    },
                    "idempotencyKey": {
                      "description": "The key that makes a retry the same publication.",
                      "type": "string"
                    },
                    "reminderSentAt": {
                      "description": "ISO-8601 time the most recent reminder went out, or null if none has.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/content/publications/validate": {
      "post": {
        "operationId": "content_publications_validate",
        "summary": "Dry run: check a post against one or more channels WITHOUT scheduling anything.",
        "description": "Dry run: check a post against one or more channels WITHOUT scheduling anything. Returns everything that would go wrong — text too long, media not stored yet, attachments a network will not take, a link it will not linkify — and what publishing would cost. On X a post carrying a link costs $0.20 against $0.015 for a plain one, so call this before you schedule.",
        "tags": [
          "Content"
        ],
        "x-mcp-tool": "content_publications_validate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "postId": {
                    "description": "The post to check. It does not have to be approved yet — this never publishes.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "channels": {
                    "description": "One entry per channel you are considering. Check them all in one call.",
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "required": [
                        "channelId"
                      ],
                      "properties": {
                        "text": {
                          "description": "The per-channel variant you intend to schedule, in markdown. Omit to check the post text as written.",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 50000
                        },
                        "channelId": {
                          "description": "A channel to check this post against.",
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "scheduledAt": {
                    "description": "The slot you intend to use, ISO-8601. Only the daily ceiling depends on it; omit for \"now\".",
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "postId",
                  "channels"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "postId",
                    "channels"
                  ],
                  "properties": {
                    "postId": {
                      "description": "The post that was checked.",
                      "type": "string"
                    },
                    "channels": {
                      "description": "One result per requested channel, in the order they were given.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "channelId",
                          "network",
                          "displayName",
                          "text",
                          "renderedText",
                          "issues",
                          "costUsd",
                          "costBasis",
                          "ceiling"
                        ],
                        "properties": {
                          "text": {
                            "description": "The markdown that was checked, exactly as it was given or stored.",
                            "type": "string"
                          },
                          "issues": {
                            "description": "Everything wrong, all at once. Any entry with severity \"error\" means scheduling this would be refused — there is no separate flag to disagree with the list.",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "code",
                                "severity",
                                "message"
                              ],
                              "properties": {
                                "code": {
                                  "description": "Stable machine code: text_empty, text_too_long, too_many_media, link_not_supported, media_missing, media_not_ready, media_not_supported, cost_unknown, daily_ceiling_exceeded.",
                                  "type": "string"
                                },
                                "field": {
                                  "description": "Which input the issue is about, when it is about one.",
                                  "type": "string"
                                },
                                "message": {
                                  "description": "What is wrong, in a sentence you can show a person.",
                                  "type": "string"
                                },
                                "severity": {
                                  "description": "`error` means scheduling would be refused or the publication would not go out. `warning` is advisory.",
                                  "type": "string",
                                  "enum": [
                                    "error",
                                    "warning"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "ceiling": {
                            "description": "The daily ceiling that was checked, or null when nothing knows one.",
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "limit",
                                  "used",
                                  "source"
                                ],
                                "properties": {
                                  "used": {
                                    "description": "How many publications this channel already has in that day, queued or done.",
                                    "type": "integer"
                                  },
                                  "limit": {
                                    "description": "Published posts this channel allows per day, or null when no figure is known.",
                                    "anyOf": [
                                      {
                                        "type": "integer"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "source": {
                                    "description": "Where the limit came from: `channel` an operator override, `adapter` a live figure from the network, `catalog` the built-in constant (INV-053).",
                                    "type": "string",
                                    "enum": [
                                      "channel",
                                      "adapter",
                                      "catalog"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "costUsd": {
                            "description": "What this publication would cost in USD. On X a post carrying a link costs 13x a plain one ($0.20 against $0.015). Null means the cost cannot be computed, which blocks publishing.",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "network": {
                            "description": "The network behind that channel.",
                            "type": "string"
                          },
                          "channelId": {
                            "description": "The channel this result is for.",
                            "type": "string"
                          },
                          "costBasis": {
                            "description": "Which rate produced costUsd: \"plain\", \"link\" or \"free\".",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayName": {
                            "description": "The channel as a person sees it.",
                            "type": "string"
                          },
                          "renderedText": {
                            "description": "The text that would actually be published to this channel: the markdown flattened to plain network text — emphasis as styled characters, lists as bullets, links as \"text (url)\". Scheduling stores this string, so what you read here is what goes out, character for character. Length and cost are judged on it, not on the markdown.",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/alerts": {
      "post": {
        "operationId": "deployment_alert_create",
        "summary": "Create a threshold alert rule for a service or managed service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_alert_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "targetKind": {
                    "type": "string",
                    "enum": [
                      "service",
                      "managed-service"
                    ]
                  },
                  "targetId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "metric": {
                    "type": "string",
                    "enum": [
                      "cpu",
                      "memory",
                      "net_in",
                      "net_out",
                      "disk"
                    ]
                  },
                  "comparator": {
                    "type": "string",
                    "enum": [
                      "gt",
                      "lt"
                    ]
                  },
                  "threshold": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "enabled": {
                    "type": "boolean",
                    "default": true
                  }
                },
                "required": [
                  "targetKind",
                  "targetId",
                  "metric",
                  "comparator",
                  "threshold"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "targetKind",
                    "targetId",
                    "metric",
                    "comparator",
                    "threshold",
                    "enabled",
                    "state",
                    "lastEvaluatedAt",
                    "lastStateChangeAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "firing"
                      ]
                    },
                    "metric": {
                      "type": "string",
                      "enum": [
                        "cpu",
                        "memory",
                        "net_in",
                        "net_out",
                        "disk"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "targetId": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "threshold": {
                      "type": "number"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "comparator": {
                      "type": "string",
                      "enum": [
                        "gt",
                        "lt"
                      ]
                    },
                    "targetKind": {
                      "type": "string",
                      "enum": [
                        "service",
                        "managed-service"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastEvaluatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastStateChangeAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/alerts/{id}": {
      "delete": {
        "operationId": "deployment_alert_delete",
        "summary": "Delete an alert rule",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_alert_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "deployment_alert_update",
        "summary": "Update an alert rule (threshold, comparator, enabled)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_alert_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comparator": {
                    "type": "string",
                    "enum": [
                      "gt",
                      "lt"
                    ]
                  },
                  "threshold": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "targetKind",
                    "targetId",
                    "metric",
                    "comparator",
                    "threshold",
                    "enabled",
                    "state",
                    "lastEvaluatedAt",
                    "lastStateChangeAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "firing"
                      ]
                    },
                    "metric": {
                      "type": "string",
                      "enum": [
                        "cpu",
                        "memory",
                        "net_in",
                        "net_out",
                        "disk"
                      ]
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "targetId": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "threshold": {
                      "type": "number"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "comparator": {
                      "type": "string",
                      "enum": [
                        "gt",
                        "lt"
                      ]
                    },
                    "targetKind": {
                      "type": "string",
                      "enum": [
                        "service",
                        "managed-service"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastEvaluatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastStateChangeAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/analytics/query": {
      "post": {
        "operationId": "deployment_analytics_query",
        "summary": "Ask a natural-language question about THIS product's deployment data (deployments, deploy events, environments, services, domains, managed services) and get a computed answer.",
        "description": "Ask a natural-language question about THIS product's deployment data (deployments, deploy events, environments, services, domains, managed services) and get a computed answer. Returns the generated SQL, the result rows, and a natural-language answer. Read-only; scoped to the current product.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_analytics_query",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "q": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "q"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "answer",
                    "sql",
                    "rows",
                    "truncated",
                    "explanation"
                  ],
                  "properties": {
                    "sql": {
                      "type": "string"
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": {}
                      }
                    },
                    "answer": {
                      "type": "string"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "explanation": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/builds/{id}": {
      "get": {
        "operationId": "deployment_build_get",
        "summary": "Get a single build by deployment id",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_build_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "status",
                    "cloudBuildId",
                    "commitSha",
                    "imageRef",
                    "startedAt",
                    "builtAt",
                    "finishedAt",
                    "lastErrorMessage",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "Initializing",
                        "Building",
                        "Deploying",
                        "Active",
                        "Replaced",
                        "Crashed",
                        "Completed",
                        "Failed",
                        "Removed"
                      ]
                    },
                    "builtAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageRef": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "commitSha": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "startedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "finishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cloudBuildId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/databases": {
      "post": {
        "operationId": "deployment_cloud_sql_database_create",
        "summary": "Create a logical database (with its own role) on the managed Postgres instance.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_database_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "instanceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40,
                    "pattern": "^[a-z][a-z0-9-]*$"
                  }
                },
                "required": [
                  "instanceId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "instanceId",
                    "dbName",
                    "roleName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "dbName": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "roleName": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "instanceId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/databases/{databaseId}": {
      "delete": {
        "operationId": "deployment_cloud_sql_database_delete",
        "summary": "Delete a logical managed Postgres database (detaches from all services first).",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_database_delete",
        "parameters": [
          {
            "name": "databaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "deployment_cloud_sql_database_get",
        "summary": "Get a logical managed Postgres database by id.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_database_get",
        "parameters": [
          {
            "name": "databaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "instanceId",
                    "dbName",
                    "roleName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "dbName": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "roleName": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "instanceId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/databases/attach": {
      "post": {
        "operationId": "deployment_cloud_sql_database_attach",
        "summary": "Attach a managed Postgres database to a service in an environment; injects DATABASE_URL (and PG* vars) as a secret.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_database_attach",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "databaseId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "serviceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "environmentId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "databaseId",
                  "serviceId",
                  "environmentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "databaseId",
                    "serviceId",
                    "environmentId",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "serviceId": {
                      "type": "string"
                    },
                    "databaseId": {
                      "type": "string"
                    },
                    "environmentId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/databases/detach": {
      "post": {
        "operationId": "deployment_cloud_sql_database_detach",
        "summary": "Detach a managed Postgres database from a service; removes the injected connection secrets.",
        "description": "Detach a managed Postgres database from a service; removes the injected connection secrets. Does not delete the database.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_database_detach",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "attachmentId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "attachmentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/instances": {
      "get": {
        "operationId": "deployment_cloud_sql_instance_list",
        "summary": "List the product's managed Postgres (Cloud SQL) instance(s).",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_instance_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "label",
                      "name",
                      "region",
                      "tier",
                      "pgVersion",
                      "privateIp",
                      "connectionName",
                      "status",
                      "backupsEnabled",
                      "pitrEnabled",
                      "backupConfigObservedAt",
                      "lastErrorMessage",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "tier": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "region": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "pgVersion": {
                        "type": "string"
                      },
                      "privateIp": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "productId": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "pitrEnabled": {
                        "type": [
                          "boolean",
                          "null"
                        ]
                      },
                      "backupsEnabled": {
                        "type": [
                          "boolean",
                          "null"
                        ]
                      },
                      "connectionName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastErrorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "backupConfigObservedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_cloud_sql_instance_create",
        "summary": "Provision the product's managed Postgres instance on Google Cloud SQL — fully managed by Google Cloud, with automated backups and point-in-time recovery, a dedicated instance, and easy resize.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_instance_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40,
                    "pattern": "^[a-z][a-z0-9-]*$"
                  },
                  "tier": {
                    "type": "string",
                    "enum": [
                      "db-custom-1-3840",
                      "db-custom-2-7680",
                      "db-custom-4-15360"
                    ],
                    "default": "db-custom-1-3840"
                  },
                  "pgVersion": {
                    "type": "string",
                    "enum": [
                      "16",
                      "17",
                      "18"
                    ],
                    "default": "18"
                  }
                },
                "required": [
                  "label"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "label",
                    "name",
                    "region",
                    "tier",
                    "pgVersion",
                    "privateIp",
                    "connectionName",
                    "status",
                    "backupsEnabled",
                    "pitrEnabled",
                    "backupConfigObservedAt",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "pgVersion": {
                      "type": "string"
                    },
                    "privateIp": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "pitrEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "backupsEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "connectionName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "backupConfigObservedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/instances/{instanceId}": {
      "delete": {
        "operationId": "deployment_cloud_sql_instance_delete",
        "summary": "Delete the managed Postgres (Cloud SQL) instance (must have no databases).",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_instance_delete",
        "parameters": [
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "deployment_cloud_sql_instance_get",
        "summary": "Get the product's managed Postgres (Cloud SQL) instance and its status.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_instance_get",
        "parameters": [
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "label",
                    "name",
                    "region",
                    "tier",
                    "pgVersion",
                    "privateIp",
                    "connectionName",
                    "status",
                    "backupsEnabled",
                    "pitrEnabled",
                    "backupConfigObservedAt",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "pgVersion": {
                      "type": "string"
                    },
                    "privateIp": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "pitrEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "backupsEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "connectionName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "backupConfigObservedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/instances/{instanceId}/backups": {
      "get": {
        "operationId": "deployment_cloud_sql_instance_backup_list",
        "summary": "List backup runs for the managed Postgres (Cloud SQL) instance.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_instance_backup_list",
        "parameters": [
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "status",
                      "type",
                      "startTime",
                      "endTime",
                      "error",
                      "description"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string"
                      },
                      "error": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "endTime": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "startTime": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_cloud_sql_instance_backup",
        "summary": "Take an on-demand backup of the managed Postgres (Cloud SQL) instance.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_instance_backup",
        "parameters": [
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "label",
                    "name",
                    "region",
                    "tier",
                    "pgVersion",
                    "privateIp",
                    "connectionName",
                    "status",
                    "backupsEnabled",
                    "pitrEnabled",
                    "backupConfigObservedAt",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "pgVersion": {
                      "type": "string"
                    },
                    "privateIp": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "pitrEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "backupsEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "connectionName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "backupConfigObservedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/instances/{instanceId}/databases": {
      "get": {
        "operationId": "deployment_cloud_sql_database_list",
        "summary": "List the logical managed Postgres databases on an instance.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_database_list",
        "parameters": [
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "instanceId",
                      "dbName",
                      "roleName",
                      "status",
                      "lastErrorMessage",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "dbName": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "roleName": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "productId": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "instanceId": {
                        "type": "string"
                      },
                      "lastErrorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/instances/{instanceId}/logs": {
      "get": {
        "operationId": "deployment_cloud_sql_logs",
        "summary": "Snapshot the last N Postgres log lines for a managed Postgres (Cloud SQL) instance.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_logs",
        "parameters": [
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tail",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "lines"
                  ],
                  "properties": {
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/instances/{instanceId}/resize": {
      "patch": {
        "operationId": "deployment_cloud_sql_instance_resize",
        "summary": "Resize the managed Postgres (Cloud SQL) instance to a different tier (CPU/RAM).",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_instance_resize",
        "parameters": [
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tier": {
                    "type": "string",
                    "enum": [
                      "db-custom-1-3840",
                      "db-custom-2-7680",
                      "db-custom-4-15360"
                    ]
                  }
                },
                "required": [
                  "tier"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "label",
                    "name",
                    "region",
                    "tier",
                    "pgVersion",
                    "privateIp",
                    "connectionName",
                    "status",
                    "backupsEnabled",
                    "pitrEnabled",
                    "backupConfigObservedAt",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "pgVersion": {
                      "type": "string"
                    },
                    "privateIp": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "pitrEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "backupsEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "connectionName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "backupConfigObservedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/instances/{instanceId}/restore": {
      "post": {
        "operationId": "deployment_cloud_sql_instance_restore",
        "summary": "Restore the managed Postgres (Cloud SQL) instance IN-PLACE from a backup run (destructive — overwrites current data).",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_instance_restore",
        "parameters": [
          {
            "name": "instanceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "backupRunId": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "backupRunId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "label",
                    "name",
                    "region",
                    "tier",
                    "pgVersion",
                    "privateIp",
                    "connectionName",
                    "status",
                    "backupsEnabled",
                    "pitrEnabled",
                    "backupConfigObservedAt",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "pgVersion": {
                      "type": "string"
                    },
                    "privateIp": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "pitrEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "backupsEnabled": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "connectionName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "backupConfigObservedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/cloud-sql/instances/backfill-log-flags": {
      "post": {
        "operationId": "deployment_cloud_sql_backfill_log_flags",
        "summary": "Apply this product's managed Postgres (Cloud SQL) log flags to existing instance(s), idempotently (safe to re-run; zero downtime).",
        "description": "Apply this product's managed Postgres (Cloud SQL) log flags to existing instance(s), idempotently (safe to re-run; zero downtime). Optionally target one instanceId.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_cloud_sql_backfill_log_flags",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "instanceId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "scanned",
                    "patched",
                    "skippedNoDrift",
                    "skippedNotReady",
                    "skippedRestartRequired",
                    "restartRequired",
                    "failed"
                  ],
                  "properties": {
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "error"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "error": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "patched": {
                      "type": "number"
                    },
                    "scanned": {
                      "type": "number"
                    },
                    "skippedNoDrift": {
                      "type": "number"
                    },
                    "restartRequired": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "flags"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "flags": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "skippedNotReady": {
                      "type": "number"
                    },
                    "skippedRestartRequired": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/deployments/{id}": {
      "get": {
        "operationId": "deployment_deployment_get",
        "summary": "Get a single deployment by id",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_deployment_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "status",
                    "imageRef",
                    "configSnapshot",
                    "cloudBuildId",
                    "commitSha",
                    "startedAt",
                    "builtAt",
                    "deployedAt",
                    "finishedAt",
                    "lastErrorMessage",
                    "rolledBackFromDeploymentId",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "Initializing",
                        "Building",
                        "Deploying",
                        "Active",
                        "Replaced",
                        "Crashed",
                        "Completed",
                        "Failed",
                        "Removed",
                        "Sleeping",
                        "Stopped",
                        "WakeFailed"
                      ]
                    },
                    "builtAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageRef": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "commitSha": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "startedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deployedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "finishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cloudBuildId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "configSnapshot": {
                      "type": "object",
                      "required": [
                        "variables"
                      ],
                      "properties": {
                        "source": {},
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "key",
                              "value"
                            ],
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "rolledBackFromDeploymentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/domains/{domainId}/routes": {
      "get": {
        "operationId": "deployment_domain_routes_list",
        "summary": "List path-routes for a domain",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_routes_list",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "domainId",
                      "serviceId",
                      "pathPrefix",
                      "isDefault",
                      "priority",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "domainId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "priority": {
                        "type": "integer"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "isDefault": {
                        "type": "boolean"
                      },
                      "serviceId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "pathPrefix": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_domain_routes_add",
        "summary": "Add a path-route to a custom domain",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_routes_add",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pathPrefix": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^\\/[A-Za-z0-9/_-]*$"
                  },
                  "serviceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "isDefault": {
                    "type": "boolean",
                    "default": false
                  },
                  "priority": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "required": [
                  "pathPrefix",
                  "serviceId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "domainId",
                    "serviceId",
                    "pathPrefix",
                    "isDefault",
                    "priority",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "domainId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "priority": {
                      "type": "integer"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "pathPrefix": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/domains/{domainId}/routes/{routeId}": {
      "delete": {
        "operationId": "deployment_domain_routes_remove",
        "summary": "Remove a path-route (default route cannot be removed)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_routes_remove",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "routeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "deployment_domain_routes_update",
        "summary": "Update a path-route",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_routes_update",
        "parameters": [
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "routeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pathPrefix": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^\\/[A-Za-z0-9/_-]*$"
                  },
                  "serviceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "priority": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 1000
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "domainId",
                    "serviceId",
                    "pathPrefix",
                    "isDefault",
                    "priority",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "domainId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "priority": {
                      "type": "integer"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "isDefault": {
                      "type": "boolean"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "pathPrefix": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/domains/{id}": {
      "delete": {
        "operationId": "deployment_domain_remove",
        "summary": "Remove a custom domain (auto-domains are removed via service.delete)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_remove",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "deployment_domain_get",
        "summary": "Get a domain by id (includes DNS instructions for custom domains awaiting verification)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "hostname",
                    "kind",
                    "verificationStatus",
                    "verificationToken",
                    "tlsStatus",
                    "wwwTlsStatus",
                    "tlsCertificateExpiresAt",
                    "lastVerificationCheckAt",
                    "lastVerificationError",
                    "dnsInstructions",
                    "routingStatus",
                    "lastProbeAt",
                    "lastProbeError",
                    "routingRecordType",
                    "redirectWww",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "custom"
                      ]
                    },
                    "hostname": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "tlsStatus": {
                      "type": "string",
                      "enum": [
                        "none",
                        "pending",
                        "issuing",
                        "active",
                        "failed"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "lastProbeAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "redirectWww": {
                      "type": "boolean"
                    },
                    "wwwTlsStatus": {
                      "type": "string",
                      "enum": [
                        "none",
                        "pending",
                        "issuing",
                        "active",
                        "failed"
                      ]
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "routingStatus": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "propagating",
                        "active",
                        "failed"
                      ]
                    },
                    "lastProbeError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dnsInstructions": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "routing",
                            "txt"
                          ],
                          "properties": {
                            "txt": {
                              "type": "object",
                              "required": [
                                "name",
                                "value"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            "routing": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "recordType",
                                  "name",
                                  "value"
                                ],
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "recordType": {
                                    "type": "string",
                                    "enum": [
                                      "A",
                                      "CNAME"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "acmeChallenge": {
                              "type": "object",
                              "required": [
                                "recordType",
                                "name",
                                "value"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                },
                                "recordType": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "CNAME"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            "routingUnavailable": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "routingRecordType": {
                      "type": "string",
                      "enum": [
                        "A",
                        "CNAME"
                      ]
                    },
                    "verificationToken": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verificationStatus": {
                      "type": "string",
                      "enum": [
                        "pending_dns",
                        "verified",
                        "dns_failed"
                      ]
                    },
                    "lastVerificationError": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "reason",
                                "checkedAt",
                                "code"
                              ],
                              "properties": {
                                "code": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "reason": {
                                  "type": "string",
                                  "const": "transient"
                                },
                                "checkedAt": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "reason",
                                "checkedAt"
                              ],
                              "properties": {
                                "txt": {
                                  "type": "object",
                                  "required": [
                                    "got",
                                    "want"
                                  ],
                                  "properties": {
                                    "got": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "want": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "host": {
                                  "type": "object",
                                  "required": [
                                    "got",
                                    "want"
                                  ],
                                  "properties": {
                                    "got": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "want": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "reason": {
                                  "type": "string",
                                  "const": "mismatch"
                                },
                                "checkedAt": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastVerificationCheckAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tlsCertificateExpiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/domains/{id}/redirect-www": {
      "patch": {
        "operationId": "deployment_domain_redirect_www",
        "summary": "Toggle the www→apex 301 redirect for an apex custom domain",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_redirect_www",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "enabled"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "hostname",
                    "kind",
                    "verificationStatus",
                    "verificationToken",
                    "tlsStatus",
                    "wwwTlsStatus",
                    "tlsCertificateExpiresAt",
                    "lastVerificationCheckAt",
                    "lastVerificationError",
                    "dnsInstructions",
                    "routingStatus",
                    "lastProbeAt",
                    "lastProbeError",
                    "routingRecordType",
                    "redirectWww",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "custom"
                      ]
                    },
                    "hostname": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "tlsStatus": {
                      "type": "string",
                      "enum": [
                        "none",
                        "pending",
                        "issuing",
                        "active",
                        "failed"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "lastProbeAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "redirectWww": {
                      "type": "boolean"
                    },
                    "wwwTlsStatus": {
                      "type": "string",
                      "enum": [
                        "none",
                        "pending",
                        "issuing",
                        "active",
                        "failed"
                      ]
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "routingStatus": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "propagating",
                        "active",
                        "failed"
                      ]
                    },
                    "lastProbeError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dnsInstructions": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "routing",
                            "txt"
                          ],
                          "properties": {
                            "txt": {
                              "type": "object",
                              "required": [
                                "name",
                                "value"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            "routing": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "recordType",
                                  "name",
                                  "value"
                                ],
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "recordType": {
                                    "type": "string",
                                    "enum": [
                                      "A",
                                      "CNAME"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "acmeChallenge": {
                              "type": "object",
                              "required": [
                                "recordType",
                                "name",
                                "value"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                },
                                "recordType": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "CNAME"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            "routingUnavailable": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "routingRecordType": {
                      "type": "string",
                      "enum": [
                        "A",
                        "CNAME"
                      ]
                    },
                    "verificationToken": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verificationStatus": {
                      "type": "string",
                      "enum": [
                        "pending_dns",
                        "verified",
                        "dns_failed"
                      ]
                    },
                    "lastVerificationError": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "reason",
                                "checkedAt",
                                "code"
                              ],
                              "properties": {
                                "code": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "reason": {
                                  "type": "string",
                                  "const": "transient"
                                },
                                "checkedAt": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "reason",
                                "checkedAt"
                              ],
                              "properties": {
                                "txt": {
                                  "type": "object",
                                  "required": [
                                    "got",
                                    "want"
                                  ],
                                  "properties": {
                                    "got": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "want": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "host": {
                                  "type": "object",
                                  "required": [
                                    "got",
                                    "want"
                                  ],
                                  "properties": {
                                    "got": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "want": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "reason": {
                                  "type": "string",
                                  "const": "mismatch"
                                },
                                "checkedAt": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastVerificationCheckAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tlsCertificateExpiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/domains/{id}/verify": {
      "post": {
        "operationId": "deployment_domain_verify",
        "summary": "Force an out-of-band DNS verification check for a custom domain",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_verify",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "hostname",
                    "kind",
                    "verificationStatus",
                    "verificationToken",
                    "tlsStatus",
                    "wwwTlsStatus",
                    "tlsCertificateExpiresAt",
                    "lastVerificationCheckAt",
                    "lastVerificationError",
                    "dnsInstructions",
                    "routingStatus",
                    "lastProbeAt",
                    "lastProbeError",
                    "routingRecordType",
                    "redirectWww",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "custom"
                      ]
                    },
                    "hostname": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "tlsStatus": {
                      "type": "string",
                      "enum": [
                        "none",
                        "pending",
                        "issuing",
                        "active",
                        "failed"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "lastProbeAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "redirectWww": {
                      "type": "boolean"
                    },
                    "wwwTlsStatus": {
                      "type": "string",
                      "enum": [
                        "none",
                        "pending",
                        "issuing",
                        "active",
                        "failed"
                      ]
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "routingStatus": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "propagating",
                        "active",
                        "failed"
                      ]
                    },
                    "lastProbeError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dnsInstructions": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "routing",
                            "txt"
                          ],
                          "properties": {
                            "txt": {
                              "type": "object",
                              "required": [
                                "name",
                                "value"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            "routing": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "recordType",
                                  "name",
                                  "value"
                                ],
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "recordType": {
                                    "type": "string",
                                    "enum": [
                                      "A",
                                      "CNAME"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "acmeChallenge": {
                              "type": "object",
                              "required": [
                                "recordType",
                                "name",
                                "value"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                },
                                "recordType": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "CNAME"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            "routingUnavailable": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "routingRecordType": {
                      "type": "string",
                      "enum": [
                        "A",
                        "CNAME"
                      ]
                    },
                    "verificationToken": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verificationStatus": {
                      "type": "string",
                      "enum": [
                        "pending_dns",
                        "verified",
                        "dns_failed"
                      ]
                    },
                    "lastVerificationError": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "reason",
                                "checkedAt",
                                "code"
                              ],
                              "properties": {
                                "code": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "reason": {
                                  "type": "string",
                                  "const": "transient"
                                },
                                "checkedAt": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "reason",
                                "checkedAt"
                              ],
                              "properties": {
                                "txt": {
                                  "type": "object",
                                  "required": [
                                    "got",
                                    "want"
                                  ],
                                  "properties": {
                                    "got": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "want": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "host": {
                                  "type": "object",
                                  "required": [
                                    "got",
                                    "want"
                                  ],
                                  "properties": {
                                    "got": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "want": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "reason": {
                                  "type": "string",
                                  "const": "mismatch"
                                },
                                "checkedAt": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastVerificationCheckAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tlsCertificateExpiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments": {
      "get": {
        "operationId": "deployment_environment_list",
        "summary": "List environments for the current product.",
        "description": "List environments for the current product. Optionally filter by type (persistent or pr-preview).",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_environment_list",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "persistent",
                "pr-preview"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "slug",
                      "isProduction",
                      "type",
                      "status",
                      "lastErrorMessage",
                      "baseEnvironmentId",
                      "prNumber",
                      "prBranch",
                      "expiresAt",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "persistent",
                          "pr-preview"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "provisioning",
                          "ready",
                          "provisioning_failed",
                          "deprovisioning",
                          "deprovisioning_failed"
                        ]
                      },
                      "prBranch": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "prNumber": {
                        "anyOf": [
                          {
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "expiresAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isProduction": {
                        "type": "boolean"
                      },
                      "lastErrorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "baseEnvironmentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_environment_create",
        "summary": "Create a new environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_environment_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "isProduction",
                    "type",
                    "status",
                    "lastErrorMessage",
                    "baseEnvironmentId",
                    "prNumber",
                    "prBranch",
                    "expiresAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "persistent",
                        "pr-preview"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "provisioning_failed",
                        "deprovisioning",
                        "deprovisioning_failed"
                      ]
                    },
                    "prBranch": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "prNumber": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isProduction": {
                      "type": "boolean"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "baseEnvironmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/alert-events": {
      "get": {
        "operationId": "deployment_alert_events_list",
        "summary": "List recent alert firing/resolved events in an environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_alert_events_list",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "ruleId",
                      "targetKind",
                      "targetId",
                      "metric",
                      "type",
                      "value",
                      "threshold",
                      "createdAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "firing",
                          "resolved"
                        ]
                      },
                      "value": {
                        "type": "number"
                      },
                      "metric": {
                        "type": "string",
                        "enum": [
                          "cpu",
                          "memory",
                          "net_in",
                          "net_out",
                          "disk"
                        ]
                      },
                      "ruleId": {
                        "type": "string"
                      },
                      "targetId": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "productId": {
                        "type": "string"
                      },
                      "threshold": {
                        "type": "number"
                      },
                      "targetKind": {
                        "type": "string",
                        "enum": [
                          "service",
                          "managed-service"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/alerts": {
      "get": {
        "operationId": "deployment_alert_list",
        "summary": "List alert rules in an environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_alert_list",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "environmentId",
                      "targetKind",
                      "targetId",
                      "metric",
                      "comparator",
                      "threshold",
                      "enabled",
                      "state",
                      "lastEvaluatedAt",
                      "lastStateChangeAt",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "ok",
                          "firing"
                        ]
                      },
                      "metric": {
                        "type": "string",
                        "enum": [
                          "cpu",
                          "memory",
                          "net_in",
                          "net_out",
                          "disk"
                        ]
                      },
                      "enabled": {
                        "type": "boolean"
                      },
                      "targetId": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "productId": {
                        "type": "string"
                      },
                      "threshold": {
                        "type": "number"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "comparator": {
                        "type": "string",
                        "enum": [
                          "gt",
                          "lt"
                        ]
                      },
                      "targetKind": {
                        "type": "string",
                        "enum": [
                          "service",
                          "managed-service"
                        ]
                      },
                      "environmentId": {
                        "type": "string"
                      },
                      "lastEvaluatedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastStateChangeAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/canvas": {
      "get": {
        "operationId": "deployment_canvas_get",
        "summary": "Get canvas state (nodes + services) for an environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_canvas_get",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "environmentId",
                    "nodes",
                    "services",
                    "edges"
                  ],
                  "properties": {
                    "edges": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "fromKind",
                          "fromNodeId",
                          "toKind",
                          "toNodeId",
                          "label",
                          "kind"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "cloud-sql",
                              "reference",
                              "host"
                            ]
                          },
                          "label": {
                            "type": "string"
                          },
                          "toKind": {
                            "type": "string",
                            "enum": [
                              "service",
                              "managed-service",
                              "cloud-sql"
                            ]
                          },
                          "fromKind": {
                            "type": "string",
                            "const": "service"
                          },
                          "toNodeId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "fromNodeId": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nodes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "nodeKind",
                          "nodeId",
                          "x",
                          "y",
                          "width",
                          "height",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "x": {
                            "type": "number"
                          },
                          "y": {
                            "type": "number"
                          },
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "width": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "height": {
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "nodeId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "nodeKind": {
                            "type": "string",
                            "enum": [
                              "service",
                              "volume",
                              "managed-service",
                              "cloud-sql"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "services": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "environmentId",
                          "name",
                          "slug",
                          "source",
                          "containerPort",
                          "replicas",
                          "lastReplicasRunning",
                          "probes",
                          "dependsOn",
                          "scaleToZero",
                          "idleMinutes",
                          "sleepState",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "mode": {
                            "type": "string",
                            "default": "persistent"
                          },
                          "name": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "probes": {
                            "type": "object",
                            "properties": {
                              "liveness": {
                                "type": "object",
                                "required": [
                                  "path"
                                ],
                                "properties": {
                                  "path": {
                                    "type": "string",
                                    "minLength": 1,
                                    "pattern": "^\\/"
                                  },
                                  "port": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 65535
                                  },
                                  "periodSeconds": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3600
                                  },
                                  "timeoutSeconds": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3600
                                  },
                                  "failureThreshold": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "successThreshold": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "initialDelaySeconds": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 3600
                                  }
                                },
                                "additionalProperties": false
                              },
                              "readiness": {
                                "type": "object",
                                "required": [
                                  "path"
                                ],
                                "properties": {
                                  "path": {
                                    "type": "string",
                                    "minLength": 1,
                                    "pattern": "^\\/"
                                  },
                                  "port": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 65535
                                  },
                                  "periodSeconds": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3600
                                  },
                                  "timeoutSeconds": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 3600
                                  },
                                  "failureThreshold": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "successThreshold": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 100
                                  },
                                  "initialDelaySeconds": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 3600
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          },
                          "source": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "type",
                                  "branch"
                                ],
                                "properties": {
                                  "url": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string",
                                    "pattern": "^[^/].*$|^$"
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "git"
                                  },
                                  "branch": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "connectorId": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "repoFullName": {
                                    "type": "string",
                                    "pattern": "^[^/]+\\/[^/]+$"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "type",
                                  "registry",
                                  "tag"
                                ],
                                "properties": {
                                  "tag": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "image"
                                  },
                                  "registry": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "type"
                                ],
                                "properties": {
                                  "spa": {
                                    "type": "boolean"
                                  },
                                  "repo": {
                                    "type": "object",
                                    "required": [
                                      "branch"
                                    ],
                                    "properties": {
                                      "url": {
                                        "type": "string"
                                      },
                                      "path": {
                                        "type": "string",
                                        "pattern": "^[^/].*$|^$"
                                      },
                                      "branch": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "connectorId": {
                                        "type": "string",
                                        "format": "uuid"
                                      },
                                      "repoFullName": {
                                        "type": "string",
                                        "pattern": "^[^/]+\\/[^/]+$"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "type": {
                                    "type": "string",
                                    "const": "static"
                                  },
                                  "build": {
                                    "type": "object",
                                    "properties": {
                                      "command": {
                                        "type": "string",
                                        "minLength": 1
                                      },
                                      "outputDir": {
                                        "type": "string",
                                        "minLength": 1
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "markdown": {
                                    "type": "boolean"
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "command": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "default": null
                          },
                          "lastRun": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "id",
                                  "status",
                                  "startedAt",
                                  "finishedAt"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "status": {
                                    "type": "string"
                                  },
                                  "startedAt": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "finishedAt": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "tracing": {
                            "type": "string",
                            "default": "off"
                          },
                          "replicas": {
                            "type": "integer"
                          },
                          "schedule": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "default": null
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "dependsOn": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "nextRunAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "default": null
                          },
                          "resources": {
                            "type": "object",
                            "properties": {
                              "limits": {
                                "type": "object",
                                "properties": {
                                  "cpu": {
                                    "type": "string"
                                  },
                                  "memory": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "additionalProperties": false
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "autoDeploy": {
                            "type": "boolean",
                            "default": true
                          },
                          "sleepState": {
                            "type": "string",
                            "enum": [
                              "awake",
                              "sleeping",
                              "waking",
                              "stopped",
                              "wake_failed"
                            ]
                          },
                          "idleMinutes": {
                            "type": "integer"
                          },
                          "scaleToZero": {
                            "type": "boolean"
                          },
                          "containerPort": {
                            "type": "integer"
                          },
                          "environmentId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "jobTimeoutSec": {
                            "type": "integer",
                            "default": 3600
                          },
                          "jobConcurrency": {
                            "type": "string",
                            "default": "forbid"
                          },
                          "buildMachineType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "scheduleSuspended": {
                            "type": "boolean",
                            "default": false
                          },
                          "suspendedByBilling": {
                            "type": "boolean"
                          },
                          "lastReplicasRunning": {
                            "type": "integer"
                          },
                          "scaleToZeroEligibility": {
                            "type": "object",
                            "required": [
                              "eligible",
                              "reasons"
                            ],
                            "properties": {
                              "reasons": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "eligible": {
                                "type": "boolean"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/canvas/nodes/{nodeId}": {
      "put": {
        "operationId": "deployment_canvas_move_node",
        "summary": "Update position/size of a canvas node",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_canvas_move_node",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "nodeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "x": {
                    "type": "number"
                  },
                  "y": {
                    "type": "number"
                  },
                  "width": {
                    "type": "number"
                  },
                  "height": {
                    "type": "number"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "nodeKind",
                    "nodeId",
                    "x",
                    "y",
                    "width",
                    "height",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    },
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "width": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "height": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "nodeId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "nodeKind": {
                      "type": "string",
                      "enum": [
                        "service",
                        "volume",
                        "managed-service",
                        "cloud-sql"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/domains": {
      "get": {
        "operationId": "deployment_domain_list",
        "summary": "List domains for an environment (auto + custom)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_list",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "environmentId",
                      "hostname",
                      "kind",
                      "verificationStatus",
                      "verificationToken",
                      "tlsStatus",
                      "wwwTlsStatus",
                      "tlsCertificateExpiresAt",
                      "lastVerificationCheckAt",
                      "lastVerificationError",
                      "dnsInstructions",
                      "routingStatus",
                      "lastProbeAt",
                      "lastProbeError",
                      "routingRecordType",
                      "redirectWww",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "custom"
                        ]
                      },
                      "hostname": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "tlsStatus": {
                        "type": "string",
                        "enum": [
                          "none",
                          "pending",
                          "issuing",
                          "active",
                          "failed"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "lastProbeAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "redirectWww": {
                        "type": "boolean"
                      },
                      "wwwTlsStatus": {
                        "type": "string",
                        "enum": [
                          "none",
                          "pending",
                          "issuing",
                          "active",
                          "failed"
                        ]
                      },
                      "environmentId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "routingStatus": {
                        "type": "string",
                        "enum": [
                          "provisioning",
                          "propagating",
                          "active",
                          "failed"
                        ]
                      },
                      "lastProbeError": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "dnsInstructions": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "routing",
                              "txt"
                            ],
                            "properties": {
                              "txt": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "value"
                                ],
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              "routing": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "recordType",
                                    "name",
                                    "value"
                                  ],
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "recordType": {
                                      "type": "string",
                                      "enum": [
                                        "A",
                                        "CNAME"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "acmeChallenge": {
                                "type": "object",
                                "required": [
                                  "recordType",
                                  "name",
                                  "value"
                                ],
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "recordType": {
                                    "type": "string",
                                    "enum": [
                                      "A",
                                      "CNAME"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "routingUnavailable": {
                                "type": "boolean"
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "routingRecordType": {
                        "type": "string",
                        "enum": [
                          "A",
                          "CNAME"
                        ]
                      },
                      "verificationToken": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "verificationStatus": {
                        "type": "string",
                        "enum": [
                          "pending_dns",
                          "verified",
                          "dns_failed"
                        ]
                      },
                      "lastVerificationError": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "reason",
                                  "checkedAt",
                                  "code"
                                ],
                                "properties": {
                                  "code": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "reason": {
                                    "type": "string",
                                    "const": "transient"
                                  },
                                  "checkedAt": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "reason",
                                  "checkedAt"
                                ],
                                "properties": {
                                  "txt": {
                                    "type": "object",
                                    "required": [
                                      "got",
                                      "want"
                                    ],
                                    "properties": {
                                      "got": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "want": {
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "host": {
                                    "type": "object",
                                    "required": [
                                      "got",
                                      "want"
                                    ],
                                    "properties": {
                                      "got": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "want": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "reason": {
                                    "type": "string",
                                    "const": "mismatch"
                                  },
                                  "checkedAt": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lastVerificationCheckAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tlsCertificateExpiresAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_domain_add",
        "summary": "Register a custom domain for an environment; returns CNAME+TXT DNS instructions",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_add",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hostname": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 253,
                    "pattern": "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$"
                  },
                  "defaultServiceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "pathPrefix": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "pattern": "^\\/[A-Za-z0-9/_-]*$"
                  },
                  "redirectWww": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "hostname",
                  "defaultServiceId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "hostname",
                    "kind",
                    "verificationStatus",
                    "verificationToken",
                    "tlsStatus",
                    "wwwTlsStatus",
                    "tlsCertificateExpiresAt",
                    "lastVerificationCheckAt",
                    "lastVerificationError",
                    "dnsInstructions",
                    "routingStatus",
                    "lastProbeAt",
                    "lastProbeError",
                    "routingRecordType",
                    "redirectWww",
                    "createdAt",
                    "updatedAt",
                    "routes"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "auto",
                        "custom"
                      ]
                    },
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "domainId",
                          "serviceId",
                          "pathPrefix",
                          "isDefault",
                          "priority",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "domainId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "priority": {
                            "type": "integer"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "isDefault": {
                            "type": "boolean"
                          },
                          "serviceId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "pathPrefix": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "hostname": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "tlsStatus": {
                      "type": "string",
                      "enum": [
                        "none",
                        "pending",
                        "issuing",
                        "active",
                        "failed"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "lastProbeAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "redirectWww": {
                      "type": "boolean"
                    },
                    "wwwTlsStatus": {
                      "type": "string",
                      "enum": [
                        "none",
                        "pending",
                        "issuing",
                        "active",
                        "failed"
                      ]
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "routingStatus": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "propagating",
                        "active",
                        "failed"
                      ]
                    },
                    "lastProbeError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dnsInstructions": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "routing",
                            "txt"
                          ],
                          "properties": {
                            "txt": {
                              "type": "object",
                              "required": [
                                "name",
                                "value"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            "routing": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "recordType",
                                  "name",
                                  "value"
                                ],
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "recordType": {
                                    "type": "string",
                                    "enum": [
                                      "A",
                                      "CNAME"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "acmeChallenge": {
                              "type": "object",
                              "required": [
                                "recordType",
                                "name",
                                "value"
                              ],
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                },
                                "recordType": {
                                  "type": "string",
                                  "enum": [
                                    "A",
                                    "CNAME"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            },
                            "routingUnavailable": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "routingRecordType": {
                      "type": "string",
                      "enum": [
                        "A",
                        "CNAME"
                      ]
                    },
                    "verificationToken": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verificationStatus": {
                      "type": "string",
                      "enum": [
                        "pending_dns",
                        "verified",
                        "dns_failed"
                      ]
                    },
                    "lastVerificationError": {
                      "anyOf": [
                        {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "reason",
                                "checkedAt",
                                "code"
                              ],
                              "properties": {
                                "code": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "reason": {
                                  "type": "string",
                                  "const": "transient"
                                },
                                "checkedAt": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "reason",
                                "checkedAt"
                              ],
                              "properties": {
                                "txt": {
                                  "type": "object",
                                  "required": [
                                    "got",
                                    "want"
                                  ],
                                  "properties": {
                                    "got": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "want": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "host": {
                                  "type": "object",
                                  "required": [
                                    "got",
                                    "want"
                                  ],
                                  "properties": {
                                    "got": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    },
                                    "want": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "reason": {
                                  "type": "string",
                                  "const": "mismatch"
                                },
                                "checkedAt": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "lastVerificationCheckAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "tlsCertificateExpiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/events": {
      "get": {
        "operationId": "deployment_events_list_by_environment",
        "summary": "List deploy events for an environment, newest first",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_events_list_by_environment",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "deployment.queued",
                "deployment.build.started",
                "deployment.build.succeeded",
                "deployment.build.failed",
                "deployment.deploying",
                "deployment.variable.ignored",
                "deployment.healthcheck.passed",
                "deployment.healthcheck.failed",
                "deployment.healthy",
                "deployment.failed",
                "deployment.replaced",
                "deployment.sourcemaps.uploaded",
                "deployment.sourcemaps.upload-failed",
                "deployment.requeue-failed",
                "deployment.release.started",
                "deployment.release.log",
                "deployment.release.succeeded",
                "deployment.release.failed",
                "replica.restarted",
                "service.scaled",
                "service.restarted",
                "service.restart-failed",
                "domain.verified",
                "domain.tls.issued",
                "domain.tls.failed",
                "domain.www-tls.issued",
                "domain.www-tls.failed",
                "domain.routing.active",
                "domain.routing.failed",
                "domain.removed",
                "domain.governance.mirror-failed",
                "service.slept",
                "service.woke",
                "service.wake_failed",
                "service.sleep-enabled",
                "service.sleep-disabled",
                "service.sleep-enable-failed",
                "cloud-sql.instance.stopped",
                "cloud-sql.instance.started",
                "cloud-sql.instance.stop-failed",
                "cloud-sql.instance.start-failed",
                "suspension.workload-stopped",
                "suspension.workload-restored",
                "managed-service.restarted",
                "managed-service.port-leak-healed"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "serviceId",
                      "environmentId",
                      "deploymentId",
                      "domainId",
                      "type",
                      "payload",
                      "createdAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "deployment.queued",
                          "deployment.build.started",
                          "deployment.build.succeeded",
                          "deployment.build.failed",
                          "deployment.deploying",
                          "deployment.variable.ignored",
                          "deployment.healthcheck.passed",
                          "deployment.healthcheck.failed",
                          "deployment.healthy",
                          "deployment.failed",
                          "deployment.replaced",
                          "deployment.sourcemaps.uploaded",
                          "deployment.sourcemaps.upload-failed",
                          "deployment.requeue-failed",
                          "deployment.release.started",
                          "deployment.release.log",
                          "deployment.release.succeeded",
                          "deployment.release.failed",
                          "replica.restarted",
                          "service.scaled",
                          "service.restarted",
                          "service.restart-failed",
                          "domain.verified",
                          "domain.tls.issued",
                          "domain.tls.failed",
                          "domain.www-tls.issued",
                          "domain.www-tls.failed",
                          "domain.routing.active",
                          "domain.routing.failed",
                          "domain.removed",
                          "domain.governance.mirror-failed",
                          "service.slept",
                          "service.woke",
                          "service.wake_failed",
                          "service.sleep-enabled",
                          "service.sleep-disabled",
                          "service.sleep-enable-failed",
                          "cloud-sql.instance.stopped",
                          "cloud-sql.instance.started",
                          "cloud-sql.instance.stop-failed",
                          "cloud-sql.instance.start-failed",
                          "suspension.workload-stopped",
                          "suspension.workload-restored",
                          "managed-service.restarted",
                          "managed-service.port-leak-healed"
                        ]
                      },
                      "payload": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "domainId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "productId": {
                        "type": "string"
                      },
                      "serviceId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "deploymentId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "environmentId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/managed-services": {
      "get": {
        "operationId": "deployment_managed_service_list",
        "summary": "List managed services in an environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_list",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "environmentId",
                      "name",
                      "slug",
                      "engine",
                      "version",
                      "storageGiB",
                      "databaseName",
                      "status",
                      "lastErrorMessage",
                      "createdAt",
                      "updatedAt",
                      "lastBackupAt",
                      "backupPolicy"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "engine": {
                        "type": "string",
                        "enum": [
                          "postgres",
                          "redis",
                          "mysql",
                          "mongodb"
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "version": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "productId": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "storageGiB": {
                        "type": "number"
                      },
                      "backupPolicy": {
                        "type": "object",
                        "required": [
                          "cron",
                          "timezone",
                          "retentionDays",
                          "manualBackupsExpire",
                          "scheduleSummary"
                        ],
                        "properties": {
                          "cron": {
                            "type": "string"
                          },
                          "timezone": {
                            "type": "string"
                          },
                          "retentionDays": {
                            "type": "number"
                          },
                          "scheduleSummary": {
                            "type": "string"
                          },
                          "manualBackupsExpire": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      },
                      "databaseName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastBackupAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "environmentId": {
                        "type": "string"
                      },
                      "lastErrorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_managed_service_provision",
        "summary": "Provision a managed service (e.g.",
        "description": "Provision a managed service (e.g. Postgres, Redis) inside an environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_provision",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 32
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40,
                    "pattern": "^[a-z][a-z0-9-]*$"
                  },
                  "engine": {
                    "type": "string",
                    "enum": [
                      "postgres",
                      "redis",
                      "mysql",
                      "mongodb"
                    ]
                  },
                  "version": {
                    "type": "string"
                  },
                  "storageGiB": {
                    "type": "integer",
                    "default": 5,
                    "minimum": 1,
                    "maximum": 1024
                  },
                  "databaseName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 63,
                    "pattern": "^[a-z_][a-z0-9_]*$"
                  }
                },
                "required": [
                  "name",
                  "engine"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/services": {
      "get": {
        "operationId": "deployment_service_list",
        "summary": "List services within an environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_list",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "environmentId",
                      "name",
                      "slug",
                      "source",
                      "containerPort",
                      "replicas",
                      "lastReplicasRunning",
                      "probes",
                      "dependsOn",
                      "scaleToZero",
                      "idleMinutes",
                      "sleepState",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "mode": {
                        "type": "string",
                        "default": "persistent"
                      },
                      "name": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "probes": {
                        "type": "object",
                        "properties": {
                          "liveness": {
                            "type": "object",
                            "required": [
                              "path"
                            ],
                            "properties": {
                              "path": {
                                "type": "string",
                                "minLength": 1,
                                "pattern": "^\\/"
                              },
                              "port": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 65535
                              },
                              "periodSeconds": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3600
                              },
                              "timeoutSeconds": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3600
                              },
                              "failureThreshold": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "successThreshold": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "initialDelaySeconds": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 3600
                              }
                            },
                            "additionalProperties": false
                          },
                          "readiness": {
                            "type": "object",
                            "required": [
                              "path"
                            ],
                            "properties": {
                              "path": {
                                "type": "string",
                                "minLength": 1,
                                "pattern": "^\\/"
                              },
                              "port": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 65535
                              },
                              "periodSeconds": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3600
                              },
                              "timeoutSeconds": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 3600
                              },
                              "failureThreshold": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "successThreshold": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 100
                              },
                              "initialDelaySeconds": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 3600
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      },
                      "source": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "type",
                              "branch"
                            ],
                            "properties": {
                              "url": {
                                "type": "string"
                              },
                              "path": {
                                "type": "string",
                                "pattern": "^[^/].*$|^$"
                              },
                              "type": {
                                "type": "string",
                                "const": "git"
                              },
                              "branch": {
                                "type": "string",
                                "minLength": 1
                              },
                              "connectorId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "repoFullName": {
                                "type": "string",
                                "pattern": "^[^/]+\\/[^/]+$"
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "type",
                              "registry",
                              "tag"
                            ],
                            "properties": {
                              "tag": {
                                "type": "string",
                                "minLength": 1
                              },
                              "type": {
                                "type": "string",
                                "const": "image"
                              },
                              "registry": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "required": [
                              "type"
                            ],
                            "properties": {
                              "spa": {
                                "type": "boolean"
                              },
                              "repo": {
                                "type": "object",
                                "required": [
                                  "branch"
                                ],
                                "properties": {
                                  "url": {
                                    "type": "string"
                                  },
                                  "path": {
                                    "type": "string",
                                    "pattern": "^[^/].*$|^$"
                                  },
                                  "branch": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "connectorId": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "repoFullName": {
                                    "type": "string",
                                    "pattern": "^[^/]+\\/[^/]+$"
                                  }
                                },
                                "additionalProperties": false
                              },
                              "type": {
                                "type": "string",
                                "const": "static"
                              },
                              "build": {
                                "type": "object",
                                "properties": {
                                  "command": {
                                    "type": "string",
                                    "minLength": 1
                                  },
                                  "outputDir": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "additionalProperties": false
                              },
                              "markdown": {
                                "type": "boolean"
                              }
                            },
                            "additionalProperties": false
                          }
                        ]
                      },
                      "command": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null
                      },
                      "lastRun": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "id",
                              "status",
                              "startedAt",
                              "finishedAt"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "status": {
                                "type": "string"
                              },
                              "startedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "finishedAt": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "tracing": {
                        "type": "string",
                        "default": "off"
                      },
                      "replicas": {
                        "type": "integer"
                      },
                      "schedule": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "dependsOn": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "nextRunAt": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "default": null
                      },
                      "resources": {
                        "type": "object",
                        "properties": {
                          "limits": {
                            "type": "object",
                            "properties": {
                              "cpu": {
                                "type": "string"
                              },
                              "memory": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "additionalProperties": false
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "autoDeploy": {
                        "type": "boolean",
                        "default": true
                      },
                      "sleepState": {
                        "type": "string",
                        "enum": [
                          "awake",
                          "sleeping",
                          "waking",
                          "stopped",
                          "wake_failed"
                        ]
                      },
                      "idleMinutes": {
                        "type": "integer"
                      },
                      "scaleToZero": {
                        "type": "boolean"
                      },
                      "containerPort": {
                        "type": "integer"
                      },
                      "environmentId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "jobTimeoutSec": {
                        "type": "integer",
                        "default": 3600
                      },
                      "jobConcurrency": {
                        "type": "string",
                        "default": "forbid"
                      },
                      "buildMachineType": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "scheduleSuspended": {
                        "type": "boolean",
                        "default": false
                      },
                      "suspendedByBilling": {
                        "type": "boolean"
                      },
                      "lastReplicasRunning": {
                        "type": "integer"
                      },
                      "scaleToZeroEligibility": {
                        "type": "object",
                        "required": [
                          "eligible",
                          "reasons"
                        ],
                        "properties": {
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "eligible": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_service_create",
        "summary": "Create a service inside an environment.",
        "description": "Create a service inside an environment. mode:'persistent' (the default) is a container kept running; mode:'scheduled' is a job that runs a command and exits. A scheduled service takes schedule (a five-field UTC cron expression — minute hour day-of-month month day-of-week — or null for a job that only ever runs on demand), command (the shell command one run executes), jobTimeoutSec, and jobConcurrency ('forbid' | 'allow' | 'replace'), and accepts no containerPort, replicas or scaleToZero. mode is immutable after create.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_create",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "branch"
                        ],
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string",
                            "pattern": "^[^/].*$|^$"
                          },
                          "type": {
                            "type": "string",
                            "const": "git"
                          },
                          "branch": {
                            "type": "string",
                            "minLength": 1
                          },
                          "connectorId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "repoFullName": {
                            "type": "string",
                            "pattern": "^[^/]+\\/[^/]+$"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "registry",
                          "tag"
                        ],
                        "properties": {
                          "tag": {
                            "type": "string",
                            "minLength": 1
                          },
                          "type": {
                            "type": "string",
                            "const": "image"
                          },
                          "registry": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "spa": {
                            "type": "boolean"
                          },
                          "repo": {
                            "type": "object",
                            "required": [
                              "branch"
                            ],
                            "properties": {
                              "url": {
                                "type": "string"
                              },
                              "path": {
                                "type": "string",
                                "pattern": "^[^/].*$|^$"
                              },
                              "branch": {
                                "type": "string",
                                "minLength": 1
                              },
                              "connectorId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "repoFullName": {
                                "type": "string",
                                "pattern": "^[^/]+\\/[^/]+$"
                              }
                            },
                            "additionalProperties": false
                          },
                          "type": {
                            "type": "string",
                            "const": "static"
                          },
                          "build": {
                            "type": "object",
                            "properties": {
                              "command": {
                                "type": "string",
                                "minLength": 1
                              },
                              "outputDir": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "additionalProperties": false
                          },
                          "markdown": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "containerPort": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535
                  },
                  "replicas": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50
                  },
                  "probes": {
                    "type": "object",
                    "default": {},
                    "properties": {
                      "liveness": {
                        "type": "object",
                        "required": [
                          "path"
                        ],
                        "properties": {
                          "path": {
                            "type": "string",
                            "minLength": 1,
                            "pattern": "^\\/"
                          },
                          "port": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 65535
                          },
                          "periodSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3600
                          },
                          "timeoutSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3600
                          },
                          "failureThreshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "successThreshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "initialDelaySeconds": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 3600
                          }
                        },
                        "additionalProperties": false
                      },
                      "readiness": {
                        "type": "object",
                        "required": [
                          "path"
                        ],
                        "properties": {
                          "path": {
                            "type": "string",
                            "minLength": 1,
                            "pattern": "^\\/"
                          },
                          "port": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 65535
                          },
                          "periodSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3600
                          },
                          "timeoutSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3600
                          },
                          "failureThreshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "successThreshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "initialDelaySeconds": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 3600
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "resources": {
                    "type": "object",
                    "properties": {
                      "limits": {
                        "type": "object",
                        "properties": {
                          "cpu": {
                            "type": "string"
                          },
                          "memory": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "tracing": {
                    "description": "OTel SDK to inject into this service's pods: 'off' (none), 'node' or 'python'. Read when a deploy builds the workload — takes effect on the next deploy, running pods are untouched.",
                    "type": "string",
                    "enum": [
                      "off",
                      "node",
                      "python"
                    ],
                    "default": "off"
                  },
                  "canvas": {
                    "type": "object",
                    "required": [
                      "x",
                      "y"
                    ],
                    "properties": {
                      "x": {
                        "type": "number"
                      },
                      "y": {
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  },
                  "mode": {
                    "description": "'persistent' (a long-running Deployment behind a Service — the default) or 'scheduled' (a k8s CronJob: no port, no replicas, no route). Immutable after create.",
                    "type": "string",
                    "enum": [
                      "persistent",
                      "scheduled"
                    ],
                    "default": "persistent"
                  },
                  "schedule": {
                    "description": "Five-field UTC cron expression (minute hour day-of-month month day-of-week), or null for a scheduled service with no schedule yet.",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "command": {
                    "description": "Shell command a scheduled run executes (`/bin/sh -c <command>`). Scheduled services only; omit it to run the image entrypoint. `null` clears a command that was set and returns the run to the image entrypoint.",
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 4096
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "jobTimeoutSec": {
                    "description": "Wall-clock budget for one run, in seconds (60..86400). Becomes the Job activeDeadlineSeconds — an overrunning run is killed, not left going.",
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400
                  },
                  "jobConcurrency": {
                    "description": "What happens when a run is still going at the next tick: 'forbid' (skip the tick), 'allow' (run in parallel) or 'replace' (kill the running one).",
                    "type": "string",
                    "enum": [
                      "forbid",
                      "allow",
                      "replace"
                    ]
                  }
                },
                "required": [
                  "name",
                  "source"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "name",
                    "slug",
                    "source",
                    "containerPort",
                    "replicas",
                    "lastReplicasRunning",
                    "probes",
                    "dependsOn",
                    "scaleToZero",
                    "idleMinutes",
                    "sleepState",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "mode": {
                      "type": "string",
                      "default": "persistent"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "probes": {
                      "type": "object",
                      "properties": {
                        "liveness": {
                          "type": "object",
                          "required": [
                            "path"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^\\/"
                            },
                            "port": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 65535
                            },
                            "periodSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "failureThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "successThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "initialDelaySeconds": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 3600
                            }
                          },
                          "additionalProperties": false
                        },
                        "readiness": {
                          "type": "object",
                          "required": [
                            "path"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^\\/"
                            },
                            "port": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 65535
                            },
                            "periodSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "failureThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "successThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "initialDelaySeconds": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 3600
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "branch"
                          ],
                          "properties": {
                            "url": {
                              "type": "string"
                            },
                            "path": {
                              "type": "string",
                              "pattern": "^[^/].*$|^$"
                            },
                            "type": {
                              "type": "string",
                              "const": "git"
                            },
                            "branch": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectorId": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "repoFullName": {
                              "type": "string",
                              "pattern": "^[^/]+\\/[^/]+$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "registry",
                            "tag"
                          ],
                          "properties": {
                            "tag": {
                              "type": "string",
                              "minLength": 1
                            },
                            "type": {
                              "type": "string",
                              "const": "image"
                            },
                            "registry": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "type"
                          ],
                          "properties": {
                            "spa": {
                              "type": "boolean"
                            },
                            "repo": {
                              "type": "object",
                              "required": [
                                "branch"
                              ],
                              "properties": {
                                "url": {
                                  "type": "string"
                                },
                                "path": {
                                  "type": "string",
                                  "pattern": "^[^/].*$|^$"
                                },
                                "branch": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "connectorId": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "repoFullName": {
                                  "type": "string",
                                  "pattern": "^[^/]+\\/[^/]+$"
                                }
                              },
                              "additionalProperties": false
                            },
                            "type": {
                              "type": "string",
                              "const": "static"
                            },
                            "build": {
                              "type": "object",
                              "properties": {
                                "command": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "outputDir": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            "markdown": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "command": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "lastRun": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "status",
                            "startedAt",
                            "finishedAt"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "startedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "finishedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tracing": {
                      "type": "string",
                      "default": "off"
                    },
                    "replicas": {
                      "type": "integer"
                    },
                    "schedule": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "dependsOn": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "nextRunAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "resources": {
                      "type": "object",
                      "properties": {
                        "limits": {
                          "type": "object",
                          "properties": {
                            "cpu": {
                              "type": "string"
                            },
                            "memory": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "autoDeploy": {
                      "type": "boolean",
                      "default": true
                    },
                    "sleepState": {
                      "type": "string",
                      "enum": [
                        "awake",
                        "sleeping",
                        "waking",
                        "stopped",
                        "wake_failed"
                      ]
                    },
                    "idleMinutes": {
                      "type": "integer"
                    },
                    "scaleToZero": {
                      "type": "boolean"
                    },
                    "containerPort": {
                      "type": "integer"
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "jobTimeoutSec": {
                      "type": "integer",
                      "default": 3600
                    },
                    "jobConcurrency": {
                      "type": "string",
                      "default": "forbid"
                    },
                    "buildMachineType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduleSuspended": {
                      "type": "boolean",
                      "default": false
                    },
                    "suspendedByBilling": {
                      "type": "boolean"
                    },
                    "lastReplicasRunning": {
                      "type": "integer"
                    },
                    "scaleToZeroEligibility": {
                      "type": "object",
                      "required": [
                        "eligible",
                        "reasons"
                      ],
                      "properties": {
                        "reasons": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "eligible": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/variables": {
      "get": {
        "operationId": "deployment_variable_list_env",
        "summary": "List environment-scope (shared) variables",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_list_env",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "serviceId",
                      "environmentId",
                      "key",
                      "isSecret",
                      "value",
                      "scope",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "key": {
                        "type": "string"
                      },
                      "scope": {
                        "type": "string",
                        "enum": [
                          "service",
                          "environment",
                          "product"
                        ]
                      },
                      "value": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isSecret": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "serviceId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "environmentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/variables/{key}": {
      "delete": {
        "operationId": "deployment_variable_unset_env",
        "summary": "Delete an environment-scope variable by key",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_unset_env",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "deployment_variable_set_env",
        "summary": "Create or update an environment-scope shared variable",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_set_env",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Z_][A-Z0-9_]*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "maxLength": 262144
                  },
                  "isSecret": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "value"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "environmentId",
                    "key",
                    "isSecret",
                    "value",
                    "scope",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "key": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string",
                      "enum": [
                        "service",
                        "environment",
                        "product"
                      ]
                    },
                    "value": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isSecret": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "environmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{environmentId}/volumes": {
      "get": {
        "operationId": "deployment_volume_list",
        "summary": "List volumes in environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_volume_list",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "environmentId",
                      "name",
                      "slug",
                      "sizeGb",
                      "mountPath",
                      "attachedServiceId",
                      "status",
                      "lastErrorMessage",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "sizeGb": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "provisioning",
                          "ready",
                          "detached",
                          "failed"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "mountPath": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "environmentId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "lastErrorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "attachedServiceId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_volume_create",
        "summary": "Create a volume",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_volume_create",
        "parameters": [
          {
            "name": "environmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  },
                  "sizeGb": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1024
                  },
                  "mountPath": {
                    "type": "string",
                    "pattern": "^\\/[^\\0]+$"
                  },
                  "attachedServiceId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "name",
                  "sizeGb",
                  "mountPath"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "name",
                    "slug",
                    "sizeGb",
                    "mountPath",
                    "attachedServiceId",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "sizeGb": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "detached",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "mountPath": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "attachedServiceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{id}": {
      "delete": {
        "operationId": "deployment_environment_delete",
        "summary": "Delete an environment (production cannot be deleted)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_environment_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "deployment_environment_get",
        "summary": "Get a single environment by id",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_environment_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "isProduction",
                    "type",
                    "status",
                    "lastErrorMessage",
                    "baseEnvironmentId",
                    "prNumber",
                    "prBranch",
                    "expiresAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "persistent",
                        "pr-preview"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "provisioning_failed",
                        "deprovisioning",
                        "deprovisioning_failed"
                      ]
                    },
                    "prBranch": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "prNumber": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isProduction": {
                      "type": "boolean"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "baseEnvironmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "deployment_environment_update",
        "summary": "Update an environment (name is the only updatable field)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_environment_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "isProduction",
                    "type",
                    "status",
                    "lastErrorMessage",
                    "baseEnvironmentId",
                    "prNumber",
                    "prBranch",
                    "expiresAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "persistent",
                        "pr-preview"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "provisioning_failed",
                        "deprovisioning",
                        "deprovisioning_failed"
                      ]
                    },
                    "prBranch": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "prNumber": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isProduction": {
                      "type": "boolean"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "baseEnvironmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/{id}/reconcile": {
      "post": {
        "operationId": "deployment_environment_reconcile",
        "summary": "Re-emit the provision or deprovision workflow for an environment, with optional force-finalizer-strip on deprovision",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_environment_reconcile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "force": {
                    "type": "boolean"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "isProduction",
                    "type",
                    "status",
                    "lastErrorMessage",
                    "baseEnvironmentId",
                    "prNumber",
                    "prBranch",
                    "expiresAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "persistent",
                        "pr-preview"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "provisioning_failed",
                        "deprovisioning",
                        "deprovisioning_failed"
                      ]
                    },
                    "prBranch": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "prNumber": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isProduction": {
                      "type": "boolean"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "baseEnvironmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/environments/fork": {
      "post": {
        "operationId": "deployment_environment_fork",
        "summary": "Fork an environment: deep-clone services, variables (not secrets), domains, and volumes from a base environment",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_environment_fork",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "baseEnvironmentId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "slug": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 40
                  }
                },
                "required": [
                  "baseEnvironmentId",
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "isProduction",
                    "type",
                    "status",
                    "lastErrorMessage",
                    "baseEnvironmentId",
                    "prNumber",
                    "prBranch",
                    "expiresAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "persistent",
                        "pr-preview"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "provisioning_failed",
                        "deprovisioning",
                        "deprovisioning_failed"
                      ]
                    },
                    "prBranch": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "prNumber": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isProduction": {
                      "type": "boolean"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "baseEnvironmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/governance/domains": {
      "get": {
        "operationId": "deployment_domain_allowed_list",
        "summary": "List Governance-approved base domains the product may add subdomains of",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_allowed_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "domains"
                  ],
                  "properties": {
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "domainId",
                          "domain",
                          "mode"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "external",
                              "managed"
                            ]
                          },
                          "domain": {
                            "type": "string"
                          },
                          "domainId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-service-types": {
      "get": {
        "operationId": "deployment_managed_service_types",
        "summary": "List available managed service engines and versions",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_types",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "engines"
                  ],
                  "properties": {
                    "engines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "engine",
                          "displayName",
                          "versions",
                          "defaultVersion",
                          "managedVarKeys"
                        ],
                        "properties": {
                          "engine": {
                            "type": "string",
                            "enum": [
                              "postgres",
                              "redis",
                              "mysql",
                              "mongodb"
                            ]
                          },
                          "versions": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "defaultVersion": {
                            "type": "string"
                          },
                          "managedVarKeys": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}": {
      "delete": {
        "operationId": "deployment_managed_service_delete",
        "summary": "Delete a managed service (soft-delete, triggers deprovisioning)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "deployment_managed_service_get",
        "summary": "Get a managed service by id",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/backup": {
      "post": {
        "operationId": "deployment_managed_service_backup",
        "summary": "Create a backup snapshot of a managed service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_backup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/backups": {
      "get": {
        "operationId": "deployment_managed_service_backup_list",
        "summary": "List backup snapshots for a managed service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_backup_list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "pvcName",
                      "createdAt",
                      "readyToUse",
                      "restoreSize"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "pvcName": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "readyToUse": {
                        "type": "boolean"
                      },
                      "restoreSize": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/connect-info": {
      "get": {
        "operationId": "deployment_managed_service_connect_info",
        "summary": "Get connection info and variable reference syntax for a managed service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_connect_info",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "slug",
                    "engine",
                    "vars"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "vars": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "refSyntax",
                          "isSecret"
                        ],
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "isSecret": {
                            "type": "boolean"
                          },
                          "refSyntax": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/logs": {
      "get": {
        "operationId": "deployment_managed_service_logs",
        "summary": "Get pod logs for a managed service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_logs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tail",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "lines"
                  ],
                  "properties": {
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/reconcile": {
      "post": {
        "operationId": "deployment_managed_service_reconcile",
        "summary": "Retry provisioning of a managed service that failed",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_reconcile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/resize": {
      "post": {
        "operationId": "deployment_managed_service_resize",
        "summary": "Increase storage size of a managed service (cannot shrink)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_resize",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "storageGiB": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1024
                  }
                },
                "required": [
                  "storageGiB"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/restore": {
      "post": {
        "operationId": "deployment_managed_service_restore",
        "summary": "Restore a managed service from a backup snapshot",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_restore",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "snapshotName": {
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "snapshotName"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/start": {
      "post": {
        "operationId": "deployment_managed_service_start",
        "summary": "Start a stopped managed service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_start",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/managed-services/{id}/stop": {
      "post": {
        "operationId": "deployment_managed_service_stop",
        "summary": "Stop a running managed service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_managed_service_stop",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "environmentId",
                    "name",
                    "slug",
                    "engine",
                    "version",
                    "storageGiB",
                    "databaseName",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt",
                    "lastBackupAt",
                    "backupPolicy"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "engine": {
                      "type": "string",
                      "enum": [
                        "postgres",
                        "redis",
                        "mysql",
                        "mongodb"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "storageGiB": {
                      "type": "number"
                    },
                    "backupPolicy": {
                      "type": "object",
                      "required": [
                        "cron",
                        "timezone",
                        "retentionDays",
                        "manualBackupsExpire",
                        "scheduleSummary"
                      ],
                      "properties": {
                        "cron": {
                          "type": "string"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "retentionDays": {
                          "type": "number"
                        },
                        "scheduleSummary": {
                          "type": "string"
                        },
                        "manualBackupsExpire": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "databaseName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastBackupAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environmentId": {
                      "type": "string"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/metrics": {
      "get": {
        "operationId": "deployment_metrics_get",
        "summary": "Get metric time series for a service or managed service over a fixed window (15m/1h/6h/24h/7d).",
        "description": "Get metric time series for a service or managed service over a fixed window (15m/1h/6h/24h/7d). Services return resource metrics (cpu, memory, net_in, net_out) plus HTTP metrics (rps, p50, p95, p99, error_rate); managed services return cpu, memory, net_in, net_out, disk.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_metrics_get",
        "parameters": [
          {
            "name": "targetKind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "service",
                "managed-service"
              ]
            }
          },
          {
            "name": "targetId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "15m",
                "1h",
                "6h",
                "24h",
                "7d"
              ],
              "default": "24h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "targetKind",
                    "targetId",
                    "window",
                    "stepSeconds",
                    "series",
                    "capacity"
                  ],
                  "properties": {
                    "series": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "metric",
                          "unit",
                          "points"
                        ],
                        "properties": {
                          "unit": {
                            "type": "string",
                            "enum": [
                              "cores",
                              "bytes",
                              "bytes_per_s",
                              "requests_per_s",
                              "milliseconds",
                              "percent"
                            ]
                          },
                          "metric": {
                            "type": "string",
                            "enum": [
                              "cpu",
                              "memory",
                              "net_in",
                              "net_out",
                              "disk",
                              "rps",
                              "p50",
                              "p95",
                              "p99",
                              "error_rate"
                            ]
                          },
                          "points": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "t",
                                "v"
                              ],
                              "properties": {
                                "t": {
                                  "type": "number"
                                },
                                "v": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "window": {
                      "type": "string",
                      "enum": [
                        "15m",
                        "1h",
                        "6h",
                        "24h",
                        "7d"
                      ]
                    },
                    "capacity": {
                      "type": "object",
                      "required": [
                        "cpuCores",
                        "memoryBytes"
                      ],
                      "properties": {
                        "cpuCores": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "memoryBytes": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "targetId": {
                      "type": "string"
                    },
                    "targetKind": {
                      "type": "string",
                      "enum": [
                        "service",
                        "managed-service"
                      ]
                    },
                    "stepSeconds": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/preview-environments": {
      "get": {
        "operationId": "deployment_preview_environment_list",
        "summary": "List all preview environments",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_preview_environment_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "slug",
                      "isProduction",
                      "type",
                      "status",
                      "lastErrorMessage",
                      "baseEnvironmentId",
                      "prNumber",
                      "prBranch",
                      "expiresAt",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "name": {
                        "type": "string"
                      },
                      "slug": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "persistent",
                          "pr-preview"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "provisioning",
                          "ready",
                          "provisioning_failed",
                          "deprovisioning",
                          "deprovisioning_failed"
                        ]
                      },
                      "prBranch": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "prNumber": {
                        "anyOf": [
                          {
                            "type": "integer"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "expiresAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isProduction": {
                        "type": "boolean"
                      },
                      "lastErrorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "baseEnvironmentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_preview_environment_create",
        "summary": "Create a preview environment from an open PR",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_preview_environment_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "baseEnvironmentId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "prNumber": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "prBranch": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "baseEnvironmentId",
                  "prNumber"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "isProduction",
                    "type",
                    "status",
                    "lastErrorMessage",
                    "baseEnvironmentId",
                    "prNumber",
                    "prBranch",
                    "expiresAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "persistent",
                        "pr-preview"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "provisioning_failed",
                        "deprovisioning",
                        "deprovisioning_failed"
                      ]
                    },
                    "prBranch": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "prNumber": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isProduction": {
                      "type": "boolean"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "baseEnvironmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/preview-environments/{id}": {
      "delete": {
        "operationId": "deployment_preview_environment_delete",
        "summary": "Delete a preview environment immediately",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_preview_environment_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/preview-policies/{baseEnvironmentId}": {
      "get": {
        "operationId": "deployment_preview_policy_get",
        "summary": "Get preview policy for a base environment (returns defaults if none configured)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_preview_policy_get",
        "parameters": [
          {
            "name": "baseEnvironmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "baseEnvironmentId",
                    "enabled",
                    "maxPreviews",
                    "ttlHours",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "ttlHours": {
                      "type": "number"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "maxPreviews": {
                      "type": "number"
                    },
                    "baseEnvironmentId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "deployment_preview_policy_set",
        "summary": "Configure preview policy for a base environment (enabled, maxPreviews, ttlHours)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_preview_policy_set",
        "parameters": [
          {
            "name": "baseEnvironmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "type": "boolean"
                  },
                  "maxPreviews": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 50
                  },
                  "ttlHours": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 720
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "baseEnvironmentId",
                    "enabled",
                    "maxPreviews",
                    "ttlHours",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "ttlHours": {
                      "type": "number"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "maxPreviews": {
                      "type": "number"
                    },
                    "baseEnvironmentId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/product/suspension": {
      "get": {
        "operationId": "deployment_suspension_get",
        "summary": "Get the product's billing-suspension state (stage, reason, grace deadline) and whether enforcement is active",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_suspension_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "stage",
                    "reason",
                    "graceDeadline",
                    "changedAt",
                    "enforcementEnabled"
                  ],
                  "properties": {
                    "stage": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "warned",
                            "production_grace",
                            "stopped",
                            "cleared"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "changedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "graceDeadline": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enforcementEnabled": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/product/variables": {
      "get": {
        "operationId": "deployment_variable_list_product",
        "summary": "List product-scope (global) variables",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_list_product",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "serviceId",
                      "environmentId",
                      "key",
                      "isSecret",
                      "value",
                      "scope",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "key": {
                        "type": "string"
                      },
                      "scope": {
                        "type": "string",
                        "enum": [
                          "service",
                          "environment",
                          "product"
                        ]
                      },
                      "value": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isSecret": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "serviceId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "environmentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/product/variables/{key}": {
      "delete": {
        "operationId": "deployment_variable_unset_product",
        "summary": "Delete a product-scope variable by key",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_unset_product",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "deployment_variable_set_product",
        "summary": "Create or update a product-scope global variable",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_set_product",
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Z_][A-Z0-9_]*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "maxLength": 262144
                  },
                  "isSecret": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "value"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "environmentId",
                    "key",
                    "isSecret",
                    "value",
                    "scope",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "key": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string",
                      "enum": [
                        "service",
                        "environment",
                        "product"
                      ]
                    },
                    "value": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isSecret": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "environmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{id}": {
      "delete": {
        "operationId": "deployment_service_delete",
        "summary": "Delete a service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "deployment_service_get",
        "summary": "Get a single service by id.",
        "description": "Get a single service by id. A scheduled service (mode:'scheduled') also reports nextRunAt and lastRun — when it fires next and how its most recent run ended.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "name",
                    "slug",
                    "source",
                    "containerPort",
                    "replicas",
                    "lastReplicasRunning",
                    "probes",
                    "dependsOn",
                    "scaleToZero",
                    "idleMinutes",
                    "sleepState",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "mode": {
                      "type": "string",
                      "default": "persistent"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "probes": {
                      "type": "object",
                      "properties": {
                        "liveness": {
                          "type": "object",
                          "required": [
                            "path"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^\\/"
                            },
                            "port": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 65535
                            },
                            "periodSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "failureThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "successThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "initialDelaySeconds": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 3600
                            }
                          },
                          "additionalProperties": false
                        },
                        "readiness": {
                          "type": "object",
                          "required": [
                            "path"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^\\/"
                            },
                            "port": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 65535
                            },
                            "periodSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "failureThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "successThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "initialDelaySeconds": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 3600
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "branch"
                          ],
                          "properties": {
                            "url": {
                              "type": "string"
                            },
                            "path": {
                              "type": "string",
                              "pattern": "^[^/].*$|^$"
                            },
                            "type": {
                              "type": "string",
                              "const": "git"
                            },
                            "branch": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectorId": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "repoFullName": {
                              "type": "string",
                              "pattern": "^[^/]+\\/[^/]+$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "registry",
                            "tag"
                          ],
                          "properties": {
                            "tag": {
                              "type": "string",
                              "minLength": 1
                            },
                            "type": {
                              "type": "string",
                              "const": "image"
                            },
                            "registry": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "type"
                          ],
                          "properties": {
                            "spa": {
                              "type": "boolean"
                            },
                            "repo": {
                              "type": "object",
                              "required": [
                                "branch"
                              ],
                              "properties": {
                                "url": {
                                  "type": "string"
                                },
                                "path": {
                                  "type": "string",
                                  "pattern": "^[^/].*$|^$"
                                },
                                "branch": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "connectorId": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "repoFullName": {
                                  "type": "string",
                                  "pattern": "^[^/]+\\/[^/]+$"
                                }
                              },
                              "additionalProperties": false
                            },
                            "type": {
                              "type": "string",
                              "const": "static"
                            },
                            "build": {
                              "type": "object",
                              "properties": {
                                "command": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "outputDir": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            "markdown": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "command": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "lastRun": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "status",
                            "startedAt",
                            "finishedAt"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "startedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "finishedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tracing": {
                      "type": "string",
                      "default": "off"
                    },
                    "replicas": {
                      "type": "integer"
                    },
                    "schedule": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "dependsOn": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "nextRunAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "resources": {
                      "type": "object",
                      "properties": {
                        "limits": {
                          "type": "object",
                          "properties": {
                            "cpu": {
                              "type": "string"
                            },
                            "memory": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "autoDeploy": {
                      "type": "boolean",
                      "default": true
                    },
                    "sleepState": {
                      "type": "string",
                      "enum": [
                        "awake",
                        "sleeping",
                        "waking",
                        "stopped",
                        "wake_failed"
                      ]
                    },
                    "idleMinutes": {
                      "type": "integer"
                    },
                    "scaleToZero": {
                      "type": "boolean"
                    },
                    "containerPort": {
                      "type": "integer"
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "jobTimeoutSec": {
                      "type": "integer",
                      "default": 3600
                    },
                    "jobConcurrency": {
                      "type": "string",
                      "default": "forbid"
                    },
                    "buildMachineType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduleSuspended": {
                      "type": "boolean",
                      "default": false
                    },
                    "suspendedByBilling": {
                      "type": "boolean"
                    },
                    "lastReplicasRunning": {
                      "type": "integer"
                    },
                    "scaleToZeroEligibility": {
                      "type": "object",
                      "required": [
                        "eligible",
                        "reasons"
                      ],
                      "properties": {
                        "reasons": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "eligible": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "deployment_service_update",
        "summary": "Update service fields.",
        "description": "Update service fields. mode is immutable. On a scheduled service (mode:'scheduled') you may change schedule (five-field UTC cron, or null to leave it on demand only), command, jobTimeoutSec, jobConcurrency ('forbid' | 'allow' | 'replace'), and scheduleSuspended, which pauses or resumes the schedule without losing it.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "branch"
                        ],
                        "properties": {
                          "url": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string",
                            "pattern": "^[^/].*$|^$"
                          },
                          "type": {
                            "type": "string",
                            "const": "git"
                          },
                          "branch": {
                            "type": "string",
                            "minLength": 1
                          },
                          "connectorId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "repoFullName": {
                            "type": "string",
                            "pattern": "^[^/]+\\/[^/]+$"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type",
                          "registry",
                          "tag"
                        ],
                        "properties": {
                          "tag": {
                            "type": "string",
                            "minLength": 1
                          },
                          "type": {
                            "type": "string",
                            "const": "image"
                          },
                          "registry": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "type"
                        ],
                        "properties": {
                          "spa": {
                            "type": "boolean"
                          },
                          "repo": {
                            "type": "object",
                            "required": [
                              "branch"
                            ],
                            "properties": {
                              "url": {
                                "type": "string"
                              },
                              "path": {
                                "type": "string",
                                "pattern": "^[^/].*$|^$"
                              },
                              "branch": {
                                "type": "string",
                                "minLength": 1
                              },
                              "connectorId": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "repoFullName": {
                                "type": "string",
                                "pattern": "^[^/]+\\/[^/]+$"
                              }
                            },
                            "additionalProperties": false
                          },
                          "type": {
                            "type": "string",
                            "const": "static"
                          },
                          "build": {
                            "type": "object",
                            "properties": {
                              "command": {
                                "type": "string",
                                "minLength": 1
                              },
                              "outputDir": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "additionalProperties": false
                          },
                          "markdown": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "containerPort": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 65535
                  },
                  "replicas": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50
                  },
                  "probes": {
                    "type": "object",
                    "properties": {
                      "liveness": {
                        "type": "object",
                        "required": [
                          "path"
                        ],
                        "properties": {
                          "path": {
                            "type": "string",
                            "minLength": 1,
                            "pattern": "^\\/"
                          },
                          "port": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 65535
                          },
                          "periodSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3600
                          },
                          "timeoutSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3600
                          },
                          "failureThreshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "successThreshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "initialDelaySeconds": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 3600
                          }
                        },
                        "additionalProperties": false
                      },
                      "readiness": {
                        "type": "object",
                        "required": [
                          "path"
                        ],
                        "properties": {
                          "path": {
                            "type": "string",
                            "minLength": 1,
                            "pattern": "^\\/"
                          },
                          "port": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 65535
                          },
                          "periodSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3600
                          },
                          "timeoutSeconds": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 3600
                          },
                          "failureThreshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "successThreshold": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 100
                          },
                          "initialDelaySeconds": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 3600
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "resources": {
                    "type": "object",
                    "properties": {
                      "limits": {
                        "type": "object",
                        "properties": {
                          "cpu": {
                            "type": "string"
                          },
                          "memory": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  },
                  "scaleToZero": {
                    "type": "boolean"
                  },
                  "idleMinutes": {
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 60
                  },
                  "buildMachineType": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "E2_MEDIUM",
                          "E2_HIGHCPU_8"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "tracing": {
                    "description": "OTel SDK to inject into this service's pods: 'off' (none), 'node' or 'python'. Read when a deploy builds the workload — takes effect on the next deploy, running pods are untouched.",
                    "type": "string",
                    "enum": [
                      "off",
                      "node",
                      "python"
                    ]
                  },
                  "autoDeploy": {
                    "description": "Whether a push to this service's repo+branch queues a deploy. Default true. Turning it off suppresses push-triggered deploys only — manual and API-triggered deploys still work. Applies to git and static sources alike; the UI toggle is currently git-only, so a static service is switched through this field.",
                    "type": "boolean"
                  },
                  "schedule": {
                    "description": "Five-field UTC cron expression (minute hour day-of-month month day-of-week), or null for a scheduled service with no schedule yet.",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "scheduleSuspended": {
                    "description": "Pause or resume a scheduled service without losing its schedule.",
                    "type": "boolean"
                  },
                  "command": {
                    "description": "Shell command a scheduled run executes (`/bin/sh -c <command>`). Scheduled services only; omit it to run the image entrypoint. `null` clears a command that was set and returns the run to the image entrypoint.",
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 4096
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "jobTimeoutSec": {
                    "description": "Wall-clock budget for one run, in seconds (60..86400). Becomes the Job activeDeadlineSeconds — an overrunning run is killed, not left going.",
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 86400
                  },
                  "jobConcurrency": {
                    "description": "What happens when a run is still going at the next tick: 'forbid' (skip the tick), 'allow' (run in parallel) or 'replace' (kill the running one).",
                    "type": "string",
                    "enum": [
                      "forbid",
                      "allow",
                      "replace"
                    ]
                  },
                  "mode": {
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "name",
                    "slug",
                    "source",
                    "containerPort",
                    "replicas",
                    "lastReplicasRunning",
                    "probes",
                    "dependsOn",
                    "scaleToZero",
                    "idleMinutes",
                    "sleepState",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "mode": {
                      "type": "string",
                      "default": "persistent"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "probes": {
                      "type": "object",
                      "properties": {
                        "liveness": {
                          "type": "object",
                          "required": [
                            "path"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^\\/"
                            },
                            "port": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 65535
                            },
                            "periodSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "failureThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "successThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "initialDelaySeconds": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 3600
                            }
                          },
                          "additionalProperties": false
                        },
                        "readiness": {
                          "type": "object",
                          "required": [
                            "path"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^\\/"
                            },
                            "port": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 65535
                            },
                            "periodSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "failureThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "successThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "initialDelaySeconds": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 3600
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "branch"
                          ],
                          "properties": {
                            "url": {
                              "type": "string"
                            },
                            "path": {
                              "type": "string",
                              "pattern": "^[^/].*$|^$"
                            },
                            "type": {
                              "type": "string",
                              "const": "git"
                            },
                            "branch": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectorId": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "repoFullName": {
                              "type": "string",
                              "pattern": "^[^/]+\\/[^/]+$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "registry",
                            "tag"
                          ],
                          "properties": {
                            "tag": {
                              "type": "string",
                              "minLength": 1
                            },
                            "type": {
                              "type": "string",
                              "const": "image"
                            },
                            "registry": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "type"
                          ],
                          "properties": {
                            "spa": {
                              "type": "boolean"
                            },
                            "repo": {
                              "type": "object",
                              "required": [
                                "branch"
                              ],
                              "properties": {
                                "url": {
                                  "type": "string"
                                },
                                "path": {
                                  "type": "string",
                                  "pattern": "^[^/].*$|^$"
                                },
                                "branch": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "connectorId": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "repoFullName": {
                                  "type": "string",
                                  "pattern": "^[^/]+\\/[^/]+$"
                                }
                              },
                              "additionalProperties": false
                            },
                            "type": {
                              "type": "string",
                              "const": "static"
                            },
                            "build": {
                              "type": "object",
                              "properties": {
                                "command": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "outputDir": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            "markdown": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "command": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "lastRun": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "status",
                            "startedAt",
                            "finishedAt"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "startedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "finishedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tracing": {
                      "type": "string",
                      "default": "off"
                    },
                    "replicas": {
                      "type": "integer"
                    },
                    "schedule": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "dependsOn": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "nextRunAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "resources": {
                      "type": "object",
                      "properties": {
                        "limits": {
                          "type": "object",
                          "properties": {
                            "cpu": {
                              "type": "string"
                            },
                            "memory": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "autoDeploy": {
                      "type": "boolean",
                      "default": true
                    },
                    "sleepState": {
                      "type": "string",
                      "enum": [
                        "awake",
                        "sleeping",
                        "waking",
                        "stopped",
                        "wake_failed"
                      ]
                    },
                    "idleMinutes": {
                      "type": "integer"
                    },
                    "scaleToZero": {
                      "type": "boolean"
                    },
                    "containerPort": {
                      "type": "integer"
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "jobTimeoutSec": {
                      "type": "integer",
                      "default": 3600
                    },
                    "jobConcurrency": {
                      "type": "string",
                      "default": "forbid"
                    },
                    "buildMachineType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduleSuspended": {
                      "type": "boolean",
                      "default": false
                    },
                    "suspendedByBilling": {
                      "type": "boolean"
                    },
                    "lastReplicasRunning": {
                      "type": "integer"
                    },
                    "scaleToZeroEligibility": {
                      "type": "object",
                      "required": [
                        "eligible",
                        "reasons"
                      ],
                      "properties": {
                        "reasons": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "eligible": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{id}/restart": {
      "post": {
        "operationId": "deployment_service_restart",
        "summary": "Trigger a rolling restart of a service without changing the deployed image",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_restart",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{id}/scale": {
      "post": {
        "operationId": "deployment_service_scale",
        "summary": "Scale a service to N replicas without redeploy (min 0 = stop)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_scale",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "replicas": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50
                  }
                },
                "required": [
                  "replicas"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "name",
                    "slug",
                    "source",
                    "containerPort",
                    "replicas",
                    "lastReplicasRunning",
                    "probes",
                    "dependsOn",
                    "scaleToZero",
                    "idleMinutes",
                    "sleepState",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "mode": {
                      "type": "string",
                      "default": "persistent"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "probes": {
                      "type": "object",
                      "properties": {
                        "liveness": {
                          "type": "object",
                          "required": [
                            "path"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^\\/"
                            },
                            "port": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 65535
                            },
                            "periodSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "failureThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "successThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "initialDelaySeconds": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 3600
                            }
                          },
                          "additionalProperties": false
                        },
                        "readiness": {
                          "type": "object",
                          "required": [
                            "path"
                          ],
                          "properties": {
                            "path": {
                              "type": "string",
                              "minLength": 1,
                              "pattern": "^\\/"
                            },
                            "port": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 65535
                            },
                            "periodSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "timeoutSeconds": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 3600
                            },
                            "failureThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "successThreshold": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 100
                            },
                            "initialDelaySeconds": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 3600
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "source": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "branch"
                          ],
                          "properties": {
                            "url": {
                              "type": "string"
                            },
                            "path": {
                              "type": "string",
                              "pattern": "^[^/].*$|^$"
                            },
                            "type": {
                              "type": "string",
                              "const": "git"
                            },
                            "branch": {
                              "type": "string",
                              "minLength": 1
                            },
                            "connectorId": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "repoFullName": {
                              "type": "string",
                              "pattern": "^[^/]+\\/[^/]+$"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "type",
                            "registry",
                            "tag"
                          ],
                          "properties": {
                            "tag": {
                              "type": "string",
                              "minLength": 1
                            },
                            "type": {
                              "type": "string",
                              "const": "image"
                            },
                            "registry": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "type"
                          ],
                          "properties": {
                            "spa": {
                              "type": "boolean"
                            },
                            "repo": {
                              "type": "object",
                              "required": [
                                "branch"
                              ],
                              "properties": {
                                "url": {
                                  "type": "string"
                                },
                                "path": {
                                  "type": "string",
                                  "pattern": "^[^/].*$|^$"
                                },
                                "branch": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "connectorId": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "repoFullName": {
                                  "type": "string",
                                  "pattern": "^[^/]+\\/[^/]+$"
                                }
                              },
                              "additionalProperties": false
                            },
                            "type": {
                              "type": "string",
                              "const": "static"
                            },
                            "build": {
                              "type": "object",
                              "properties": {
                                "command": {
                                  "type": "string",
                                  "minLength": 1
                                },
                                "outputDir": {
                                  "type": "string",
                                  "minLength": 1
                                }
                              },
                              "additionalProperties": false
                            },
                            "markdown": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "command": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "lastRun": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "id",
                            "status",
                            "startedAt",
                            "finishedAt"
                          ],
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "status": {
                              "type": "string"
                            },
                            "startedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "finishedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "tracing": {
                      "type": "string",
                      "default": "off"
                    },
                    "replicas": {
                      "type": "integer"
                    },
                    "schedule": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "dependsOn": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "nextRunAt": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "default": null
                    },
                    "resources": {
                      "type": "object",
                      "properties": {
                        "limits": {
                          "type": "object",
                          "properties": {
                            "cpu": {
                              "type": "string"
                            },
                            "memory": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "autoDeploy": {
                      "type": "boolean",
                      "default": true
                    },
                    "sleepState": {
                      "type": "string",
                      "enum": [
                        "awake",
                        "sleeping",
                        "waking",
                        "stopped",
                        "wake_failed"
                      ]
                    },
                    "idleMinutes": {
                      "type": "integer"
                    },
                    "scaleToZero": {
                      "type": "boolean"
                    },
                    "containerPort": {
                      "type": "integer"
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "jobTimeoutSec": {
                      "type": "integer",
                      "default": 3600
                    },
                    "jobConcurrency": {
                      "type": "string",
                      "default": "forbid"
                    },
                    "buildMachineType": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "scheduleSuspended": {
                      "type": "boolean",
                      "default": false
                    },
                    "suspendedByBilling": {
                      "type": "boolean"
                    },
                    "lastReplicasRunning": {
                      "type": "integer"
                    },
                    "scaleToZeroEligibility": {
                      "type": "object",
                      "required": [
                        "eligible",
                        "reasons"
                      ],
                      "properties": {
                        "reasons": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "eligible": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{id}/wake": {
      "post": {
        "operationId": "deployment_service_wake",
        "summary": "Wake a sleeping (scale-to-zero) service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_wake",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/builds": {
      "get": {
        "operationId": "deployment_build_list",
        "summary": "List builds for a service, newest first",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_build_list",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "serviceId",
                      "status",
                      "cloudBuildId",
                      "commitSha",
                      "imageRef",
                      "startedAt",
                      "builtAt",
                      "finishedAt",
                      "lastErrorMessage",
                      "createdAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "Initializing",
                          "Building",
                          "Deploying",
                          "Active",
                          "Replaced",
                          "Crashed",
                          "Completed",
                          "Failed",
                          "Removed"
                        ]
                      },
                      "builtAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "imageRef": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "commitSha": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "serviceId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "startedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "finishedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "cloudBuildId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastErrorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/cancel": {
      "post": {
        "operationId": "deployment_deployment_cancel",
        "summary": "Cancel a non-terminal deployment, releasing the in-progress lock so the service can deploy again",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_deployment_cancel",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deploymentId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "deploymentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "status",
                    "imageRef",
                    "configSnapshot",
                    "cloudBuildId",
                    "commitSha",
                    "startedAt",
                    "builtAt",
                    "deployedAt",
                    "finishedAt",
                    "lastErrorMessage",
                    "rolledBackFromDeploymentId",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "Initializing",
                        "Building",
                        "Deploying",
                        "Active",
                        "Replaced",
                        "Crashed",
                        "Completed",
                        "Failed",
                        "Removed",
                        "Sleeping",
                        "Stopped",
                        "WakeFailed"
                      ]
                    },
                    "builtAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageRef": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "commitSha": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "startedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deployedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "finishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cloudBuildId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "configSnapshot": {
                      "type": "object",
                      "required": [
                        "variables"
                      ],
                      "properties": {
                        "source": {},
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "key",
                              "value"
                            ],
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "rolledBackFromDeploymentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/deployments": {
      "get": {
        "operationId": "deployment_deployment_list",
        "summary": "List deployments for a service (newest first)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_deployment_list",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "serviceId",
                      "status",
                      "imageRef",
                      "configSnapshot",
                      "cloudBuildId",
                      "commitSha",
                      "startedAt",
                      "builtAt",
                      "deployedAt",
                      "finishedAt",
                      "lastErrorMessage",
                      "rolledBackFromDeploymentId",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "Initializing",
                          "Building",
                          "Deploying",
                          "Active",
                          "Replaced",
                          "Crashed",
                          "Completed",
                          "Failed",
                          "Removed",
                          "Sleeping",
                          "Stopped",
                          "WakeFailed"
                        ]
                      },
                      "builtAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "imageRef": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "commitSha": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "serviceId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "startedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "deployedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "finishedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "cloudBuildId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "configSnapshot": {
                        "type": "object",
                        "required": [
                          "variables"
                        ],
                        "properties": {
                          "source": {},
                          "variables": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "key",
                                "value"
                              ],
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "value": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          }
                        },
                        "additionalProperties": false
                      },
                      "lastErrorMessage": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "rolledBackFromDeploymentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/deployments/{deploymentId}/build-logs": {
      "get": {
        "operationId": "deployment_build_logs",
        "summary": "Snapshot build logs for a deployment (Cloud Logging proxy)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_build_logs",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "deploymentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tail",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 2000,
              "minimum": 1,
              "maximum": 2000
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "lines",
                    "cursor",
                    "complete"
                  ],
                  "properties": {
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "ts",
                          "text"
                        ],
                        "properties": {
                          "ts": {
                            "type": "string"
                          },
                          "text": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "complete": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/domains": {
      "get": {
        "operationId": "deployment_domain_list_by_service",
        "summary": "List domains routed to a service (backward-compat)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_domain_list_by_service",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "environmentId",
                      "hostname",
                      "kind",
                      "verificationStatus",
                      "verificationToken",
                      "tlsStatus",
                      "wwwTlsStatus",
                      "tlsCertificateExpiresAt",
                      "lastVerificationCheckAt",
                      "lastVerificationError",
                      "dnsInstructions",
                      "routingStatus",
                      "lastProbeAt",
                      "lastProbeError",
                      "routingRecordType",
                      "redirectWww",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "auto",
                          "custom"
                        ]
                      },
                      "hostname": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "tlsStatus": {
                        "type": "string",
                        "enum": [
                          "none",
                          "pending",
                          "issuing",
                          "active",
                          "failed"
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "lastProbeAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "redirectWww": {
                        "type": "boolean"
                      },
                      "wwwTlsStatus": {
                        "type": "string",
                        "enum": [
                          "none",
                          "pending",
                          "issuing",
                          "active",
                          "failed"
                        ]
                      },
                      "environmentId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "routingStatus": {
                        "type": "string",
                        "enum": [
                          "provisioning",
                          "propagating",
                          "active",
                          "failed"
                        ]
                      },
                      "lastProbeError": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "dnsInstructions": {
                        "anyOf": [
                          {
                            "type": "object",
                            "required": [
                              "routing",
                              "txt"
                            ],
                            "properties": {
                              "txt": {
                                "type": "object",
                                "required": [
                                  "name",
                                  "value"
                                ],
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              "routing": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "recordType",
                                    "name",
                                    "value"
                                  ],
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": "string"
                                    },
                                    "recordType": {
                                      "type": "string",
                                      "enum": [
                                        "A",
                                        "CNAME"
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              "acmeChallenge": {
                                "type": "object",
                                "required": [
                                  "recordType",
                                  "name",
                                  "value"
                                ],
                                "properties": {
                                  "name": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "recordType": {
                                    "type": "string",
                                    "enum": [
                                      "A",
                                      "CNAME"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "routingUnavailable": {
                                "type": "boolean"
                              }
                            },
                            "additionalProperties": false
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "routingRecordType": {
                        "type": "string",
                        "enum": [
                          "A",
                          "CNAME"
                        ]
                      },
                      "verificationToken": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "verificationStatus": {
                        "type": "string",
                        "enum": [
                          "pending_dns",
                          "verified",
                          "dns_failed"
                        ]
                      },
                      "lastVerificationError": {
                        "anyOf": [
                          {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "reason",
                                  "checkedAt",
                                  "code"
                                ],
                                "properties": {
                                  "code": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "reason": {
                                    "type": "string",
                                    "const": "transient"
                                  },
                                  "checkedAt": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "reason",
                                  "checkedAt"
                                ],
                                "properties": {
                                  "txt": {
                                    "type": "object",
                                    "required": [
                                      "got",
                                      "want"
                                    ],
                                    "properties": {
                                      "got": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "want": {
                                        "type": "string"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "host": {
                                    "type": "object",
                                    "required": [
                                      "got",
                                      "want"
                                    ],
                                    "properties": {
                                      "got": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      },
                                      "want": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  "reason": {
                                    "type": "string",
                                    "const": "mismatch"
                                  },
                                  "checkedAt": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lastVerificationCheckAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tlsCertificateExpiresAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/events": {
      "get": {
        "operationId": "deployment_events_list_by_service",
        "summary": "List deploy events for a service, newest first",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_events_list_by_service",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "deployment.queued",
                "deployment.build.started",
                "deployment.build.succeeded",
                "deployment.build.failed",
                "deployment.deploying",
                "deployment.variable.ignored",
                "deployment.healthcheck.passed",
                "deployment.healthcheck.failed",
                "deployment.healthy",
                "deployment.failed",
                "deployment.replaced",
                "deployment.sourcemaps.uploaded",
                "deployment.sourcemaps.upload-failed",
                "deployment.requeue-failed",
                "deployment.release.started",
                "deployment.release.log",
                "deployment.release.succeeded",
                "deployment.release.failed",
                "replica.restarted",
                "service.scaled",
                "service.restarted",
                "service.restart-failed",
                "domain.verified",
                "domain.tls.issued",
                "domain.tls.failed",
                "domain.www-tls.issued",
                "domain.www-tls.failed",
                "domain.routing.active",
                "domain.routing.failed",
                "domain.removed",
                "domain.governance.mirror-failed",
                "service.slept",
                "service.woke",
                "service.wake_failed",
                "service.sleep-enabled",
                "service.sleep-disabled",
                "service.sleep-enable-failed",
                "cloud-sql.instance.stopped",
                "cloud-sql.instance.started",
                "cloud-sql.instance.stop-failed",
                "cloud-sql.instance.start-failed",
                "suspension.workload-stopped",
                "suspension.workload-restored",
                "managed-service.restarted",
                "managed-service.port-leak-healed"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "name": "deploymentId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "serviceId",
                      "environmentId",
                      "deploymentId",
                      "domainId",
                      "type",
                      "payload",
                      "createdAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "deployment.queued",
                          "deployment.build.started",
                          "deployment.build.succeeded",
                          "deployment.build.failed",
                          "deployment.deploying",
                          "deployment.variable.ignored",
                          "deployment.healthcheck.passed",
                          "deployment.healthcheck.failed",
                          "deployment.healthy",
                          "deployment.failed",
                          "deployment.replaced",
                          "deployment.sourcemaps.uploaded",
                          "deployment.sourcemaps.upload-failed",
                          "deployment.requeue-failed",
                          "deployment.release.started",
                          "deployment.release.log",
                          "deployment.release.succeeded",
                          "deployment.release.failed",
                          "replica.restarted",
                          "service.scaled",
                          "service.restarted",
                          "service.restart-failed",
                          "domain.verified",
                          "domain.tls.issued",
                          "domain.tls.failed",
                          "domain.www-tls.issued",
                          "domain.www-tls.failed",
                          "domain.routing.active",
                          "domain.routing.failed",
                          "domain.removed",
                          "domain.governance.mirror-failed",
                          "service.slept",
                          "service.woke",
                          "service.wake_failed",
                          "service.sleep-enabled",
                          "service.sleep-disabled",
                          "service.sleep-enable-failed",
                          "cloud-sql.instance.stopped",
                          "cloud-sql.instance.started",
                          "cloud-sql.instance.stop-failed",
                          "cloud-sql.instance.start-failed",
                          "suspension.workload-stopped",
                          "suspension.workload-restored",
                          "managed-service.restarted",
                          "managed-service.port-leak-healed"
                        ]
                      },
                      "payload": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "domainId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "productId": {
                        "type": "string"
                      },
                      "serviceId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "deploymentId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "environmentId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/exec": {
      "post": {
        "operationId": "deployment_service_exec",
        "summary": "Run a command against a service.",
        "description": "Run a command against a service. mode:\"exec\" (default) execs non-interactively into the first running pod (debugging); mode:\"job\" runs a one-off Job of the service's current image with its env (migrations). Returns stdout/stderr + exit code as text. command is run via /bin/sh -c.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_exec",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "command": {
                    "type": "string",
                    "minLength": 1
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "exec",
                      "job"
                    ],
                    "default": "exec"
                  },
                  "timeoutSec": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1800
                  }
                },
                "required": [
                  "command"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "mode",
                    "exitCode",
                    "timedOut",
                    "target",
                    "stdout",
                    "stderr",
                    "output",
                    "truncated"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "exec",
                        "job"
                      ]
                    },
                    "output": {
                      "type": "string"
                    },
                    "stderr": {
                      "type": "string"
                    },
                    "stdout": {
                      "type": "string"
                    },
                    "target": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "podName",
                            "container"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "pod"
                            },
                            "podName": {
                              "type": "string"
                            },
                            "container": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "required": [
                            "kind",
                            "jobName"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "job"
                            },
                            "jobName": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "exitCode": {
                      "type": "integer"
                    },
                    "timedOut": {
                      "type": "boolean"
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/logs": {
      "get": {
        "operationId": "deployment_service_logs",
        "summary": "Snapshot the last N runtime log lines for a service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_logs",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tail",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "lines"
                  ],
                  "properties": {
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "sleepState": {
                      "type": "string",
                      "enum": [
                        "awake",
                        "sleeping",
                        "waking",
                        "stopped",
                        "wake_failed"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/redeploy": {
      "post": {
        "operationId": "deployment_service_redeploy",
        "summary": "Roll out a new deployment for a service from its current source and variables (runs asynchronously; poll the deployment for status)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_redeploy",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "status",
                    "imageRef",
                    "configSnapshot",
                    "cloudBuildId",
                    "commitSha",
                    "startedAt",
                    "builtAt",
                    "deployedAt",
                    "finishedAt",
                    "lastErrorMessage",
                    "rolledBackFromDeploymentId",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "Initializing",
                        "Building",
                        "Deploying",
                        "Active",
                        "Replaced",
                        "Crashed",
                        "Completed",
                        "Failed",
                        "Removed",
                        "Sleeping",
                        "Stopped",
                        "WakeFailed"
                      ]
                    },
                    "builtAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageRef": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "commitSha": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "startedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deployedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "finishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cloudBuildId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "configSnapshot": {
                      "type": "object",
                      "required": [
                        "variables"
                      ],
                      "properties": {
                        "source": {},
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "key",
                              "value"
                            ],
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "rolledBackFromDeploymentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/rollback": {
      "post": {
        "operationId": "deployment_service_rollback",
        "summary": "Roll back a service to a previous deployment by re-deploying its imageRef",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_service_rollback",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "deploymentId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "deploymentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "status",
                    "imageRef",
                    "configSnapshot",
                    "cloudBuildId",
                    "commitSha",
                    "startedAt",
                    "builtAt",
                    "deployedAt",
                    "finishedAt",
                    "lastErrorMessage",
                    "rolledBackFromDeploymentId",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "Initializing",
                        "Building",
                        "Deploying",
                        "Active",
                        "Replaced",
                        "Crashed",
                        "Completed",
                        "Failed",
                        "Removed",
                        "Sleeping",
                        "Stopped",
                        "WakeFailed"
                      ]
                    },
                    "builtAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageRef": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "commitSha": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "startedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "deployedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "finishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "cloudBuildId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "configSnapshot": {
                      "type": "object",
                      "required": [
                        "variables"
                      ],
                      "properties": {
                        "source": {},
                        "variables": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "key",
                              "value"
                            ],
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "rolledBackFromDeploymentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/runs": {
      "get": {
        "operationId": "deployment_job_runs_list",
        "summary": "List the runs of a scheduled service (job), newest first.",
        "description": "List the runs of a scheduled service (job), newest first. Returns a page of runs plus nextCursor; pass that back as cursor for the next page. A run with status \"Skipped\" is a tick that never fired — concurrency held it back — and has no logs or exit code.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_job_runs_list",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "serviceId",
                          "environmentId",
                          "deploymentId",
                          "trigger",
                          "triggeredBy",
                          "status",
                          "exitCode",
                          "startedAt",
                          "finishedAt",
                          "imageDigest",
                          "failureReason",
                          "k8sJobName",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "Running",
                              "Succeeded",
                              "Failed",
                              "TimedOut",
                              "Skipped"
                            ]
                          },
                          "trigger": {
                            "type": "string",
                            "enum": [
                              "schedule",
                              "manual"
                            ]
                          },
                          "exitCode": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "serviceId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "startedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "finishedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "k8sJobName": {
                            "type": "string"
                          },
                          "imageDigest": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "triggeredBy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "deploymentId": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "environmentId": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "failureReason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_job_run",
        "summary": "Run a scheduled service (job) now, regardless of its schedule or concurrency; returns the run",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_job_run",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "environmentId",
                    "deploymentId",
                    "trigger",
                    "triggeredBy",
                    "status",
                    "exitCode",
                    "startedAt",
                    "finishedAt",
                    "imageDigest",
                    "failureReason",
                    "k8sJobName",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "Running",
                        "Succeeded",
                        "Failed",
                        "TimedOut",
                        "Skipped"
                      ]
                    },
                    "trigger": {
                      "type": "string",
                      "enum": [
                        "schedule",
                        "manual"
                      ]
                    },
                    "exitCode": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "startedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "finishedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "k8sJobName": {
                      "type": "string"
                    },
                    "imageDigest": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "triggeredBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "deploymentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "failureReason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/runs/{runId}/logs": {
      "get": {
        "operationId": "deployment_job_run_logs",
        "summary": "Read the output of one job run: the stored tail (up to 256 KiB) once the run has finished, or a live tail while it is still running.",
        "description": "Read the output of one job run: the stored tail (up to 256 KiB) once the run has finished, or a live tail while it is still running. `live` says which one you got — a caller that polls should stop once it turns false.",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_job_run_logs",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "logs",
                    "live"
                  ],
                  "properties": {
                    "live": {
                      "type": "boolean"
                    },
                    "logs": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "Running",
                        "Succeeded",
                        "Failed",
                        "TimedOut",
                        "Skipped"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/ssh-command": {
      "get": {
        "operationId": "deployment_ssh_command",
        "summary": "Get the ssh command string to connect to a service",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_ssh_command",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "host",
                    "username",
                    "command"
                  ],
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "command": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/variables": {
      "get": {
        "operationId": "deployment_variable_list",
        "summary": "List variables for a service (secret values are returned as null)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_list",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "serviceId",
                      "environmentId",
                      "key",
                      "isSecret",
                      "value",
                      "scope",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "key": {
                        "type": "string"
                      },
                      "scope": {
                        "type": "string",
                        "enum": [
                          "service",
                          "environment",
                          "product"
                        ]
                      },
                      "value": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "isSecret": {
                        "type": "boolean"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "serviceId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "environmentId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/services/{serviceId}/variables/{key}": {
      "delete": {
        "operationId": "deployment_variable_unset",
        "summary": "Delete a variable from a service by key",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_unset",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "deployment_variable_set",
        "summary": "Create or update a variable on a service.",
        "description": "Create or update a variable on a service. Pass `isSecret: true` to encrypt the value via KMS — this transition is irreversible (a row that is already secret cannot be downgraded to plain).",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_variable_set",
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Z_][A-Z0-9_]*$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "value": {
                    "type": "string",
                    "maxLength": 262144
                  },
                  "isSecret": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "value"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "serviceId",
                    "environmentId",
                    "key",
                    "isSecret",
                    "value",
                    "scope",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "key": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string",
                      "enum": [
                        "service",
                        "environment",
                        "product"
                      ]
                    },
                    "value": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isSecret": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "serviceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "environmentId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/ssh-keys": {
      "get": {
        "operationId": "deployment_ssh_key_list",
        "summary": "List SSH public keys registered in the current workspace",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_ssh_key_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "productId",
                      "ownerIdentityId",
                      "scope",
                      "name",
                      "fingerprintSha256",
                      "algo",
                      "createdAt",
                      "lastUsedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "algo": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "scope": {
                        "type": "string",
                        "enum": [
                          "workspace",
                          "personal"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "productId": {
                        "type": "string"
                      },
                      "lastUsedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ownerIdentityId": {
                        "type": "string"
                      },
                      "fingerprintSha256": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "deployment_ssh_key_register",
        "summary": "Register an SSH public key for the current workspace",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_ssh_key_register",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Human label for the key, e.g. \"my-laptop\"",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "publicKey": {
                    "description": "OpenSSH public key line (ssh-ed25519 / ssh-rsa ...)",
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "name",
                  "publicKey"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "ownerIdentityId",
                    "scope",
                    "name",
                    "fingerprintSha256",
                    "algo",
                    "createdAt",
                    "lastUsedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "algo": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string",
                      "enum": [
                        "workspace",
                        "personal"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "lastUsedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ownerIdentityId": {
                      "type": "string"
                    },
                    "fingerprintSha256": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/ssh-keys/{id}": {
      "delete": {
        "operationId": "deployment_ssh_key_delete",
        "summary": "Delete a registered SSH public key",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_ssh_key_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/vcs/branches": {
      "get": {
        "operationId": "deployment_vcs_branch_list",
        "summary": "List branches for a repository on a GitHub connection",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_vcs_branch_list",
        "parameters": [
          {
            "name": "connectorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "repoFullName",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^/]+\\/[^/]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "name",
                      "commitSha"
                    ],
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "commitSha": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/vcs/connections": {
      "get": {
        "operationId": "deployment_vcs_connection_list",
        "summary": "List the GitHub connections available to the current product",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_vcs_connection_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "connectorId",
                      "installationId",
                      "accountLogin",
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "connectorId": {
                        "type": "string"
                      },
                      "accountLogin": {
                        "type": "string"
                      },
                      "installationId": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/vcs/repos": {
      "get": {
        "operationId": "deployment_vcs_repo_list",
        "summary": "List repositories accessible to a GitHub connection (optionally filtered by search)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_vcs_repo_list",
        "parameters": [
          {
            "name": "connectorId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "fullName",
                      "private",
                      "defaultBranch"
                    ],
                    "properties": {
                      "private": {
                        "type": "boolean"
                      },
                      "fullName": {
                        "type": "string"
                      },
                      "defaultBranch": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/volumes/{id}": {
      "delete": {
        "operationId": "deployment_volume_delete",
        "summary": "Permanently delete a detached volume",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_volume_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "deployment_volume_get",
        "summary": "Get a volume",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_volume_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "name",
                    "slug",
                    "sizeGb",
                    "mountPath",
                    "attachedServiceId",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "sizeGb": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "detached",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "mountPath": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "attachedServiceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/volumes/{id}/detach": {
      "post": {
        "operationId": "deployment_volume_detach",
        "summary": "Detach a volume from its service (data preserved)",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_volume_detach",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "name",
                    "slug",
                    "sizeGb",
                    "mountPath",
                    "attachedServiceId",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "sizeGb": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "detached",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "mountPath": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "attachedServiceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deployment/volumes/{id}/resize": {
      "post": {
        "operationId": "deployment_volume_resize",
        "summary": "Increase a volume size",
        "tags": [
          "Deployment"
        ],
        "x-mcp-tool": "deployment_volume_resize",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sizeGb": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1024
                  }
                },
                "required": [
                  "sizeGb"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "environmentId",
                    "name",
                    "slug",
                    "sizeGb",
                    "mountPath",
                    "attachedServiceId",
                    "status",
                    "lastErrorMessage",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "sizeGb": {
                      "type": "integer"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "provisioning",
                        "ready",
                        "detached",
                        "failed"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "mountPath": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "environmentId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "lastErrorMessage": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "attachedServiceId": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/api-keys": {
      "get": {
        "operationId": "mail_apikey_list",
        "summary": "List active API keys (prefix + metadata only, never the secret)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_apikey_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "scope",
                      "domainId",
                      "prefix",
                      "createdAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "scope": {
                        "type": "string"
                      },
                      "prefix": {
                        "type": "string"
                      },
                      "domainId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mail_apikey_create",
        "summary": "Issue a scoped sending API key; the full secret is returned only once",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_apikey_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Human-readable label for the key",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "scope": {
                    "description": "Permission scope: 'full_access' or 'sending_access'",
                    "type": "string",
                    "enum": [
                      "full_access",
                      "sending_access"
                    ]
                  },
                  "domainId": {
                    "description": "Optional Domain id this key is locked to",
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "name",
                  "scope"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "scope",
                    "domainId",
                    "prefix",
                    "createdAt",
                    "key"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "domainId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/api-keys/{id}": {
      "delete": {
        "operationId": "mail_apikey_delete",
        "summary": "Revoke an API key by id",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_apikey_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "UUID of the API key to revoke",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "revoked"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "revoked": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/audiences": {
      "get": {
        "operationId": "mail_audience_list",
        "summary": "List audiences for the current product",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_audience_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mail_audience_create",
        "summary": "Create an audience (a named bucket of contacts) for the current product",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_audience_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Human label for the audience",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/audiences/{audienceId}/contacts": {
      "get": {
        "operationId": "mail_contact_list",
        "summary": "List contacts in an audience",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_contact_list",
        "parameters": [
          {
            "name": "audience_id",
            "in": "query",
            "required": true,
            "description": "Audience to list contacts from",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "unsubscribed",
            "in": "query",
            "required": false,
            "description": "Filter by unsubscribed flag",
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor from a prior page",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max items per page (1–100, default 50)",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "audienceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "audienceId",
                          "email",
                          "unsubscribed",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "audienceId": {
                            "type": "string"
                          },
                          "properties": {
                            "anyOf": [
                              {},
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "unsubscribed": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mail_contact_create",
        "summary": "Add a contact to an audience",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_contact_create",
        "parameters": [
          {
            "name": "audienceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "audience_id": {
                    "description": "Audience the contact belongs to",
                    "type": "string",
                    "format": "uuid"
                  },
                  "email": {
                    "description": "Contact email address",
                    "type": "string"
                  },
                  "properties": {
                    "description": "Custom key/value properties (e.g. first_name, last_name)",
                    "type": "object",
                    "default": {},
                    "additionalProperties": {}
                  },
                  "unsubscribed": {
                    "description": "Marketing opt-out flag",
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": [
                  "audience_id",
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "audienceId",
                    "email",
                    "unsubscribed",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "properties": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unsubscribed": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/audiences/{audienceId}/contacts/{id}": {
      "delete": {
        "operationId": "mail_contact_delete",
        "summary": "Delete a contact from an audience",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_contact_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Contact id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "audienceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "audience_id": {
                    "description": "Audience id",
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "audience_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "mail_contact_get",
        "summary": "Get a single contact by id",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_contact_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Contact id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "audienceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-catalog-body-params": [
          {
            "name": "audience_id",
            "in": "body",
            "type": "string (uuid)",
            "required": true,
            "description": "Audience id",
            "schema": {
              "description": "Audience id",
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "audienceId",
                    "email",
                    "unsubscribed",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "properties": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unsubscribed": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "mail_contact_update",
        "summary": "Update a contact (properties or unsubscribed flag)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_contact_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Contact id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "audienceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "audience_id": {
                    "description": "Audience id",
                    "type": "string",
                    "format": "uuid"
                  },
                  "properties": {
                    "description": "Replace the custom properties object",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "unsubscribed": {
                    "description": "Set the marketing opt-out flag",
                    "type": "boolean"
                  }
                },
                "required": [
                  "audience_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "audienceId",
                    "email",
                    "unsubscribed",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "properties": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "unsubscribed": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/audiences/{id}": {
      "delete": {
        "operationId": "mail_audience_delete",
        "summary": "Delete an audience and all its contacts (cascade)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_audience_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Audience id to delete",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "mail_audience_get",
        "summary": "Get a single audience by id",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_audience_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Audience id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "mail_audience_update",
        "summary": "Rename an audience",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_audience_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Audience id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "New name",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/broadcasts": {
      "get": {
        "operationId": "mail_broadcast_list",
        "summary": "List broadcasts for the product (cursor-paginated)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_broadcast_list",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "nextCursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "productId",
                          "audienceId",
                          "name",
                          "status",
                          "from",
                          "replyTo",
                          "subject",
                          "html",
                          "text",
                          "templateId",
                          "headers",
                          "recipientCount",
                          "queuedAt",
                          "sentAt",
                          "lastError",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "from": {
                            "type": "string"
                          },
                          "html": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "text": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sentAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status": {
                            "type": "string"
                          },
                          "headers": {
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "replyTo": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "subject": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "queuedAt": {
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "date-time"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "lastError": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productId": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "variables": {
                            "anyOf": [
                              {},
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "audienceId": {
                            "type": "string"
                          },
                          "templateId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "recipientCount": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mail_broadcast_create",
        "summary": "Create a draft broadcast (inline content or a template reference) targeting an audience",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_broadcast_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "audienceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "from": {
                    "type": "string",
                    "minLength": 3
                  },
                  "replyTo": {
                    "type": "array",
                    "default": [],
                    "items": {
                      "type": "string"
                    }
                  },
                  "headers": {
                    "type": "object",
                    "default": {},
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "subject": {
                    "type": "string",
                    "minLength": 1
                  },
                  "html": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "template": {
                    "type": "object",
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "variables": {
                        "type": "object",
                        "default": {},
                        "additionalProperties": {
                          "type": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": [
                  "name",
                  "audienceId",
                  "from"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "audienceId",
                    "name",
                    "status",
                    "from",
                    "replyTo",
                    "subject",
                    "html",
                    "text",
                    "templateId",
                    "headers",
                    "recipientCount",
                    "queuedAt",
                    "sentAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "html": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "replyTo": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "queuedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lastError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "variables": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipientCount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/broadcasts/{id}": {
      "delete": {
        "operationId": "mail_broadcast_delete",
        "summary": "Delete a draft broadcast",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_broadcast_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "mail_broadcast_get",
        "summary": "Get one broadcast by id",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_broadcast_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "audienceId",
                    "name",
                    "status",
                    "from",
                    "replyTo",
                    "subject",
                    "html",
                    "text",
                    "templateId",
                    "headers",
                    "recipientCount",
                    "queuedAt",
                    "sentAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "html": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "replyTo": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "queuedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lastError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "variables": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipientCount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "mail_broadcast_update",
        "summary": "Edit a draft broadcast",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_broadcast_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "audienceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "from": {
                    "type": "string",
                    "minLength": 3
                  },
                  "replyTo": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "subject": {
                    "type": "string",
                    "minLength": 1
                  },
                  "html": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "template": {
                    "type": "object",
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "variables": {
                        "type": "object",
                        "default": {},
                        "additionalProperties": {
                          "type": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "audienceId",
                    "name",
                    "status",
                    "from",
                    "replyTo",
                    "subject",
                    "html",
                    "text",
                    "templateId",
                    "headers",
                    "recipientCount",
                    "queuedAt",
                    "sentAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "html": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "replyTo": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "queuedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lastError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "variables": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipientCount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/broadcasts/{id}/cancel": {
      "post": {
        "operationId": "mail_broadcast_cancel",
        "summary": "Cancel a draft or queued broadcast",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_broadcast_cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "audienceId",
                    "name",
                    "status",
                    "from",
                    "replyTo",
                    "subject",
                    "html",
                    "text",
                    "templateId",
                    "headers",
                    "recipientCount",
                    "queuedAt",
                    "sentAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "html": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "replyTo": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "queuedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lastError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "variables": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipientCount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/broadcasts/{id}/queue": {
      "post": {
        "operationId": "mail_broadcast_queue",
        "summary": "Queue a draft broadcast — fans out one email per eligible contact",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_broadcast_queue",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "audienceId",
                    "name",
                    "status",
                    "from",
                    "replyTo",
                    "subject",
                    "html",
                    "text",
                    "templateId",
                    "headers",
                    "recipientCount",
                    "queuedAt",
                    "sentAt",
                    "lastError",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "html": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sentAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "headers": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "replyTo": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "queuedAt": {
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "date-time"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "lastError": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "variables": {
                      "anyOf": [
                        {},
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "audienceId": {
                      "type": "string"
                    },
                    "templateId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "recipientCount": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/broadcasts/{id}/stats": {
      "get": {
        "operationId": "mail_broadcast_stats",
        "summary": "Per-broadcast analytics: recipients/suppressed/failed + delivered/opened/clicked/bounced",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_broadcast_stats",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "recipients",
                    "suppressed",
                    "failed",
                    "delivered",
                    "opened",
                    "clicked",
                    "bounced"
                  ],
                  "properties": {
                    "failed": {
                      "type": "number"
                    },
                    "opened": {
                      "type": "number"
                    },
                    "bounced": {
                      "type": "number"
                    },
                    "clicked": {
                      "type": "number"
                    },
                    "delivered": {
                      "type": "number"
                    },
                    "recipients": {
                      "type": "number"
                    },
                    "suppressed": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/domains": {
      "get": {
        "operationId": "mail_domain_list",
        "summary": "List sending domains for the current product",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_domain_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "region",
                      "status",
                      "customReturnPath",
                      "openTracking",
                      "clickTracking",
                      "trackingSubdomain",
                      "tls",
                      "records",
                      "verificationStartedAt",
                      "lastVerificationCheckAt",
                      "verifiedAt",
                      "createdAt",
                      "updatedAt",
                      "apex",
                      "mode",
                      "governanceDomainId",
                      "governanceBindingId",
                      "bindingStatus",
                      "active",
                      "instructions"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "tls": {
                        "type": "string"
                      },
                      "apex": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "mode": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "name": {
                        "type": "string"
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "region": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "records": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "type",
                            "name",
                            "value",
                            "purpose",
                            "required"
                          ],
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "purpose": {
                              "type": "string"
                            },
                            "priority": {
                              "type": "number"
                            },
                            "required": {
                              "type": "boolean"
                            },
                            "resolved": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "verifiedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "instructions": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "openTracking": {
                        "type": "boolean"
                      },
                      "bindingStatus": {
                        "type": "string"
                      },
                      "clickTracking": {
                        "type": "boolean"
                      },
                      "customReturnPath": {
                        "type": "string"
                      },
                      "trackingSubdomain": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "governanceDomainId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "governanceBindingId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "verificationStartedAt": {
                        "type": "string"
                      },
                      "lastVerificationCheckAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mail_domain_create",
        "summary": "Register a sending domain (SES Easy DKIM) and return the DNS records to publish",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_domain_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "The sending domain to register, e.g. \"example.com\"",
                    "type": "string",
                    "minLength": 1
                  },
                  "region": {
                    "description": "AWS region for the SES identity (data residency); immutable after create",
                    "type": "string",
                    "default": "eu-north-1"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "region",
                    "status",
                    "customReturnPath",
                    "openTracking",
                    "clickTracking",
                    "trackingSubdomain",
                    "tls",
                    "records",
                    "verificationStartedAt",
                    "lastVerificationCheckAt",
                    "verifiedAt",
                    "createdAt",
                    "updatedAt",
                    "apex",
                    "mode",
                    "governanceDomainId",
                    "governanceBindingId",
                    "bindingStatus",
                    "active",
                    "instructions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "tls": {
                      "type": "string"
                    },
                    "apex": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "name",
                          "value",
                          "purpose",
                          "required"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "purpose": {
                            "type": "string"
                          },
                          "priority": {
                            "type": "number"
                          },
                          "required": {
                            "type": "boolean"
                          },
                          "resolved": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "verifiedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "instructions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "openTracking": {
                      "type": "boolean"
                    },
                    "bindingStatus": {
                      "type": "string"
                    },
                    "clickTracking": {
                      "type": "boolean"
                    },
                    "customReturnPath": {
                      "type": "string"
                    },
                    "trackingSubdomain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "governanceDomainId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "governanceBindingId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verificationStartedAt": {
                      "type": "string"
                    },
                    "lastVerificationCheckAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/domains/{id}": {
      "delete": {
        "operationId": "mail_domain_delete",
        "summary": "Delete a sending domain and its SES identity",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_domain_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Domain id to delete",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "mail_domain_get",
        "summary": "Get a sending domain with its DNS records and per-record verification status",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_domain_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Domain id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "region",
                    "status",
                    "customReturnPath",
                    "openTracking",
                    "clickTracking",
                    "trackingSubdomain",
                    "tls",
                    "records",
                    "verificationStartedAt",
                    "lastVerificationCheckAt",
                    "verifiedAt",
                    "createdAt",
                    "updatedAt",
                    "apex",
                    "mode",
                    "governanceDomainId",
                    "governanceBindingId",
                    "bindingStatus",
                    "active",
                    "instructions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "tls": {
                      "type": "string"
                    },
                    "apex": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "name",
                          "value",
                          "purpose",
                          "required"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "purpose": {
                            "type": "string"
                          },
                          "priority": {
                            "type": "number"
                          },
                          "required": {
                            "type": "boolean"
                          },
                          "resolved": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "verifiedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "instructions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "openTracking": {
                      "type": "boolean"
                    },
                    "bindingStatus": {
                      "type": "string"
                    },
                    "clickTracking": {
                      "type": "boolean"
                    },
                    "customReturnPath": {
                      "type": "string"
                    },
                    "trackingSubdomain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "governanceDomainId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "governanceBindingId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verificationStartedAt": {
                      "type": "string"
                    },
                    "lastVerificationCheckAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "mail_domain_update",
        "summary": "Update tracking / TLS / return-path config for a domain",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_domain_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Domain id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "openTracking": {
                    "description": "Enable open tracking (1×1 pixel); off by default",
                    "type": "boolean"
                  },
                  "clickTracking": {
                    "description": "Enable click tracking (link rewrite); off by default",
                    "type": "boolean"
                  },
                  "trackingSubdomain": {
                    "description": "Host used for the click-redirect and open-pixel",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "tls": {
                    "description": "TLS policy: opportunistic (default) or enforced",
                    "type": "string",
                    "enum": [
                      "opportunistic",
                      "enforced"
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "region",
                    "status",
                    "customReturnPath",
                    "openTracking",
                    "clickTracking",
                    "trackingSubdomain",
                    "tls",
                    "records",
                    "verificationStartedAt",
                    "lastVerificationCheckAt",
                    "verifiedAt",
                    "createdAt",
                    "updatedAt",
                    "apex",
                    "mode",
                    "governanceDomainId",
                    "governanceBindingId",
                    "bindingStatus",
                    "active",
                    "instructions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "tls": {
                      "type": "string"
                    },
                    "apex": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "name",
                          "value",
                          "purpose",
                          "required"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "purpose": {
                            "type": "string"
                          },
                          "priority": {
                            "type": "number"
                          },
                          "required": {
                            "type": "boolean"
                          },
                          "resolved": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "verifiedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "instructions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "openTracking": {
                      "type": "boolean"
                    },
                    "bindingStatus": {
                      "type": "string"
                    },
                    "clickTracking": {
                      "type": "boolean"
                    },
                    "customReturnPath": {
                      "type": "string"
                    },
                    "trackingSubdomain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "governanceDomainId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "governanceBindingId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verificationStartedAt": {
                      "type": "string"
                    },
                    "lastVerificationCheckAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/domains/{id}/verify": {
      "post": {
        "operationId": "mail_domain_verify",
        "summary": "Re-check a domain's DNS + SES verification immediately",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_domain_verify",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Domain id to re-check now",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "region",
                    "status",
                    "customReturnPath",
                    "openTracking",
                    "clickTracking",
                    "trackingSubdomain",
                    "tls",
                    "records",
                    "verificationStartedAt",
                    "lastVerificationCheckAt",
                    "verifiedAt",
                    "createdAt",
                    "updatedAt",
                    "apex",
                    "mode",
                    "governanceDomainId",
                    "governanceBindingId",
                    "bindingStatus",
                    "active",
                    "instructions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "tls": {
                      "type": "string"
                    },
                    "apex": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "mode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "records": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "name",
                          "value",
                          "purpose",
                          "required"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          },
                          "purpose": {
                            "type": "string"
                          },
                          "priority": {
                            "type": "number"
                          },
                          "required": {
                            "type": "boolean"
                          },
                          "resolved": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "verifiedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "instructions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "openTracking": {
                      "type": "boolean"
                    },
                    "bindingStatus": {
                      "type": "string"
                    },
                    "clickTracking": {
                      "type": "boolean"
                    },
                    "customReturnPath": {
                      "type": "string"
                    },
                    "trackingSubdomain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "governanceDomainId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "governanceBindingId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "verificationStartedAt": {
                      "type": "string"
                    },
                    "lastVerificationCheckAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/domains/allowed": {
      "get": {
        "operationId": "mail_domain_allowed_list",
        "summary": "List apex domains this product may register sending domains under (from governance)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_domain_allowed_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "domainId",
                      "domain",
                      "mode",
                      "extensionCount"
                    ],
                    "properties": {
                      "mode": {
                        "type": "string"
                      },
                      "domain": {
                        "type": "string"
                      },
                      "domainId": {
                        "type": "string"
                      },
                      "extensionCount": {
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/emails": {
      "post": {
        "operationId": "mail_email_send",
        "summary": "Send a single email",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_email_send",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "from": {
                    "description": "Sender, e.g. \"Name <you@your-domain.com>\"",
                    "type": "string",
                    "minLength": 3
                  },
                  "to": {
                    "description": "Primary recipient(s)",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "cc": {
                    "description": "Cc recipient(s)",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "bcc": {
                    "description": "Bcc recipient(s) — not shown in headers",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "subject": {
                    "description": "Email subject (required for inline sends)",
                    "type": "string",
                    "minLength": 1
                  },
                  "reply_to": {
                    "description": "Reply-To address(es)",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    ]
                  },
                  "html": {
                    "description": "HTML body",
                    "type": "string"
                  },
                  "text": {
                    "description": "Plain-text body; auto-derived from html if omitted",
                    "type": "string"
                  },
                  "headers": {
                    "description": "Custom headers map",
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  },
                  "tags": {
                    "description": "Metadata tags",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "value"
                      ],
                      "properties": {
                        "name": {
                          "description": "Tag name",
                          "type": "string"
                        },
                        "value": {
                          "description": "Tag value",
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "template": {
                    "description": "Send by reference to a published template",
                    "type": "object",
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "description": "Published template id to render",
                        "type": "string",
                        "format": "uuid"
                      },
                      "variables": {
                        "description": "Values for the template variables",
                        "type": "object",
                        "default": {},
                        "additionalProperties": {
                          "type": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  "scheduled_at": {
                    "description": "ISO-8601 instant to send at; future, within 30 days. Omit to send now.",
                    "type": "string"
                  }
                },
                "required": [
                  "from"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/emails/{id}": {
      "get": {
        "operationId": "mail_email_get",
        "summary": "Retrieve an email by id, with its last event",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_email_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Email id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {},
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "mail_email_update",
        "summary": "Reschedule a scheduled email to a new ISO-8601 instant",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_email_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Email id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scheduled_at": {
                    "description": "New ISO-8601 instant; future, within 30 days",
                    "type": "string"
                  }
                },
                "required": [
                  "scheduled_at"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/emails/{id}/cancel": {
      "post": {
        "operationId": "mail_email_cancel",
        "summary": "Cancel a scheduled email",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_email_cancel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Email id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "const": "canceled"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/emails/batch": {
      "post": {
        "operationId": "mail_email_send_batch",
        "summary": "Send up to 100 emails in one atomic batch",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_email_send_batch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emails": {
                    "description": "Up to 100 emails to send, each shaped like a single send",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "from"
                      ],
                      "properties": {
                        "cc": {
                          "description": "Cc recipient(s)",
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "to": {
                          "description": "Primary recipient(s)",
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "bcc": {
                          "description": "Bcc recipient(s) — not shown in headers",
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "from": {
                          "description": "Sender, e.g. \"Name <you@your-domain.com>\"",
                          "type": "string",
                          "minLength": 3
                        },
                        "html": {
                          "description": "HTML body",
                          "type": "string"
                        },
                        "tags": {
                          "description": "Metadata tags",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "name",
                              "value"
                            ],
                            "properties": {
                              "name": {
                                "description": "Tag name",
                                "type": "string"
                              },
                              "value": {
                                "description": "Tag value",
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "text": {
                          "description": "Plain-text body; auto-derived from html if omitted",
                          "type": "string"
                        },
                        "headers": {
                          "description": "Custom headers map",
                          "type": "object",
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        "subject": {
                          "description": "Email subject (required for inline sends)",
                          "type": "string",
                          "minLength": 1
                        },
                        "reply_to": {
                          "description": "Reply-To address(es)",
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "template": {
                          "description": "Send by reference to a published template",
                          "type": "object",
                          "required": [
                            "id"
                          ],
                          "properties": {
                            "id": {
                              "description": "Published template id to render",
                              "type": "string",
                              "format": "uuid"
                            },
                            "variables": {
                              "description": "Values for the template variables",
                              "type": "object",
                              "default": {},
                              "additionalProperties": {
                                "type": [
                                  "string",
                                  "number",
                                  "boolean"
                                ]
                              }
                            }
                          },
                          "additionalProperties": false
                        },
                        "scheduled_at": {
                          "description": "ISO-8601 instant to send at; future, within 30 days. Omit to send now.",
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "emails"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/reputation": {
      "get": {
        "operationId": "mail_reputation_get",
        "summary": "Current sender-reputation status for the product: hard-bounce and complaint rates over the rolling window, the sample volume, whether sends are throttled, the tripped metric, and the configured thresholds",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_reputation_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "gated",
                    "tripped_metric",
                    "window_days",
                    "volume",
                    "hard_bounces",
                    "complaints",
                    "hard_bounce_rate",
                    "complaint_rate",
                    "thresholds"
                  ],
                  "properties": {
                    "gated": {
                      "type": "boolean"
                    },
                    "volume": {
                      "type": "number"
                    },
                    "complaints": {
                      "type": "number"
                    },
                    "thresholds": {
                      "type": "object",
                      "required": [
                        "hard_bounce_rate",
                        "complaint_rate",
                        "min_volume"
                      ],
                      "properties": {
                        "min_volume": {
                          "type": "number"
                        },
                        "complaint_rate": {
                          "type": "number"
                        },
                        "hard_bounce_rate": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "window_days": {
                      "type": "number"
                    },
                    "hard_bounces": {
                      "type": "number"
                    },
                    "complaint_rate": {
                      "type": "number"
                    },
                    "tripped_metric": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "hard_bounce_rate": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/stats": {
      "get": {
        "operationId": "mail_stats_get",
        "summary": "Dashboard aggregation for the product over 7d|30d|90d: sent/delivered/bounced/complained totals, period-over-period deltas, daily volume buckets, and deliverability percentages",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_stats_get",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "period",
                    "range",
                    "totals",
                    "deltas",
                    "volume",
                    "deliverability"
                  ],
                  "properties": {
                    "range": {
                      "type": "object",
                      "required": [
                        "from",
                        "to"
                      ],
                      "properties": {
                        "to": {
                          "type": "string"
                        },
                        "from": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "deltas": {
                      "type": "object",
                      "required": [
                        "sent",
                        "delivered",
                        "bounced",
                        "complained"
                      ],
                      "properties": {
                        "sent": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "bounced": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "delivered": {
                          "type": [
                            "number",
                            "null"
                          ]
                        },
                        "complained": {
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "period": {
                      "type": "string"
                    },
                    "totals": {
                      "type": "object",
                      "required": [
                        "sent",
                        "delivered",
                        "bounced",
                        "complained"
                      ],
                      "properties": {
                        "sent": {
                          "type": "number"
                        },
                        "bounced": {
                          "type": "number"
                        },
                        "delivered": {
                          "type": "number"
                        },
                        "complained": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "volume": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "date",
                          "sent",
                          "delivered",
                          "bounced"
                        ],
                        "properties": {
                          "date": {
                            "type": "string"
                          },
                          "sent": {
                            "type": "number"
                          },
                          "bounced": {
                            "type": "number"
                          },
                          "delivered": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "deliverability": {
                      "type": "object",
                      "required": [
                        "deliveredPct",
                        "bouncedPct",
                        "complainedPct"
                      ],
                      "properties": {
                        "bouncedPct": {
                          "type": "number"
                        },
                        "deliveredPct": {
                          "type": "number"
                        },
                        "complainedPct": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/suppressions": {
      "get": {
        "operationId": "mail_suppression_list",
        "summary": "List suppressed recipient addresses for the current product (paginated, filter by reason or address substring)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_suppression_list",
        "parameters": [
          {
            "name": "reason",
            "in": "query",
            "required": false,
            "description": "Filter by reason",
            "schema": {
              "type": "string",
              "enum": [
                "hard_bounce",
                "complaint",
                "manual",
                "unsubscribe"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match on address",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor from a prior page",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max items per page (1–100, default 50)",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "next_cursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "address",
                          "reason",
                          "note",
                          "source_event_id",
                          "created_at"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "note": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "address": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "source_event_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mail_suppression_add",
        "summary": "Manually suppress a recipient address (reason is always \"manual\"); idempotent",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_suppression_add",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "address": {
                    "description": "Email address to suppress",
                    "type": "string"
                  },
                  "note": {
                    "description": "Optional free-text note",
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "address"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "address",
                    "reason",
                    "note",
                    "source_event_id",
                    "created_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "note": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    },
                    "address": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "source_event_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/suppressions/{address}": {
      "delete": {
        "operationId": "mail_suppression_remove",
        "summary": "Remove an address from the suppression list; idempotent (returns whether a row existed)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_suppression_remove",
        "parameters": [
          {
            "name": "address",
            "in": "path",
            "required": true,
            "description": "Email address to remove from the suppression list",
            "schema": {
              "type": "string",
              "minLength": 3
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "address",
                    "removed"
                  ],
                  "properties": {
                    "address": {
                      "type": "string"
                    },
                    "removed": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/templates": {
      "get": {
        "operationId": "mail_template_list",
        "summary": "List email templates for the current product",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_template_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "subject",
                      "html",
                      "text",
                      "variables",
                      "status",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "html": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "text": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "subject": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "variables": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "name",
                            "type",
                            "optional"
                          ],
                          "properties": {
                            "name": {
                              "type": "string"
                            },
                            "type": {
                              "type": "string"
                            },
                            "fallback": {
                              "type": "string"
                            },
                            "optional": {
                              "type": "boolean"
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mail_template_create",
        "summary": "Create a draft email template with typed {{ variable }} placeholders",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_template_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Human label for the template",
                    "type": "string",
                    "minLength": 1
                  },
                  "subject": {
                    "description": "Email subject; may contain {{ variable }} placeholders",
                    "type": "string",
                    "minLength": 1
                  },
                  "html": {
                    "description": "HTML body; may contain {{ variable }} placeholders",
                    "type": "string",
                    "minLength": 1
                  },
                  "text": {
                    "description": "Optional plaintext body; derived from html when omitted",
                    "type": "string"
                  },
                  "variables": {
                    "description": "Declared variables ([{name,type,optional,fallback}], <=20)",
                    "type": "array",
                    "default": [],
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "type"
                      ],
                      "properties": {
                        "name": {
                          "description": "Placeholder identifier used as {{ name }}",
                          "type": "string",
                          "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
                        },
                        "type": {
                          "description": "Declared type (metadata; rendered as string in v1)",
                          "type": "string",
                          "enum": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        },
                        "fallback": {
                          "description": "Value used when none is supplied",
                          "type": "string"
                        },
                        "optional": {
                          "description": "If true, an absent value renders as empty string",
                          "type": "boolean",
                          "default": false
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "name",
                  "subject",
                  "html"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "subject",
                    "html",
                    "text",
                    "variables",
                    "status",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "type",
                          "optional"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback": {
                            "type": "string"
                          },
                          "optional": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/templates/{id}": {
      "delete": {
        "operationId": "mail_template_delete",
        "summary": "Delete a template",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_template_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id to delete",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "mail_template_get",
        "summary": "Get a single email template by id, with its send-usage rollup",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_template_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "subject",
                    "html",
                    "text",
                    "variables",
                    "status",
                    "createdAt",
                    "updatedAt",
                    "usage"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "usage": {
                      "type": "object",
                      "required": [
                        "email_count",
                        "last_sent_at"
                      ],
                      "properties": {
                        "email_count": {
                          "type": "number"
                        },
                        "last_sent_at": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "status": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "type",
                          "optional"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback": {
                            "type": "string"
                          },
                          "optional": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "mail_template_update",
        "summary": "Update a draft template (published templates are not editable)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_template_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1
                  },
                  "subject": {
                    "type": "string",
                    "minLength": 1
                  },
                  "html": {
                    "type": "string",
                    "minLength": 1
                  },
                  "text": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "variables": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "type"
                      ],
                      "properties": {
                        "name": {
                          "description": "Placeholder identifier used as {{ name }}",
                          "type": "string",
                          "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
                        },
                        "type": {
                          "description": "Declared type (metadata; rendered as string in v1)",
                          "type": "string",
                          "enum": [
                            "string",
                            "number",
                            "boolean"
                          ]
                        },
                        "fallback": {
                          "description": "Value used when none is supplied",
                          "type": "string"
                        },
                        "optional": {
                          "description": "If true, an absent value renders as empty string",
                          "type": "boolean",
                          "default": false
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "subject",
                    "html",
                    "text",
                    "variables",
                    "status",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "type",
                          "optional"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback": {
                            "type": "string"
                          },
                          "optional": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/templates/{id}/publish": {
      "post": {
        "operationId": "mail_template_publish",
        "summary": "Publish a template (draft -> published)",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_template_publish",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Template id to publish",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "subject",
                    "html",
                    "text",
                    "variables",
                    "status",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "html": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "text": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "variables": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "type",
                          "optional"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "fallback": {
                            "type": "string"
                          },
                          "optional": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/usage": {
      "get": {
        "operationId": "mail_usage_get",
        "summary": "Current free-tier usage for the product: emails sent this day and month with used/limit/remaining, the hard cap, a blocked flag, and the point-in-time contacts count",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_usage_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "period",
                    "emails",
                    "contacts"
                  ],
                  "properties": {
                    "emails": {
                      "type": "object",
                      "required": [
                        "day",
                        "month",
                        "hard_cap",
                        "blocked"
                      ],
                      "properties": {
                        "day": {
                          "type": "object",
                          "required": [
                            "used",
                            "limit",
                            "remaining"
                          ],
                          "properties": {
                            "used": {
                              "type": "number"
                            },
                            "limit": {
                              "type": "number"
                            },
                            "remaining": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        "month": {
                          "type": "object",
                          "required": [
                            "used",
                            "limit",
                            "remaining"
                          ],
                          "properties": {
                            "used": {
                              "type": "number"
                            },
                            "limit": {
                              "type": "number"
                            },
                            "remaining": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        "blocked": {
                          "type": "boolean"
                        },
                        "hard_cap": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "period": {
                      "type": "object",
                      "required": [
                        "day",
                        "month"
                      ],
                      "properties": {
                        "day": {
                          "type": "string"
                        },
                        "month": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "contacts": {
                      "type": "object",
                      "required": [
                        "count"
                      ],
                      "properties": {
                        "count": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/webhooks": {
      "get": {
        "operationId": "mail_webhook_list",
        "summary": "List webhook endpoints for the current product (secret omitted).",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_webhook_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "url",
                      "description",
                      "enabled_events",
                      "enabled",
                      "created_at",
                      "updated_at"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      },
                      "enabled": {
                        "type": "boolean"
                      },
                      "created_at": {
                        "type": "string"
                      },
                      "updated_at": {
                        "type": "string"
                      },
                      "description": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "enabled_events": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "mail_webhook_create",
        "summary": "Register a webhook endpoint for the current product.",
        "description": "Register a webhook endpoint for the current product. Returns the signing secret ONCE.",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_webhook_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "HTTPS URL that signed events are POSTed to",
                    "type": "string",
                    "format": "uri"
                  },
                  "enabled_events": {
                    "description": "Event types to deliver. One or more of: email.delivered, email.bounced, email.complained, email.suppressed, email.opened, email.clicked",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "email.delivered",
                        "email.bounced",
                        "email.complained",
                        "email.suppressed",
                        "email.opened",
                        "email.clicked"
                      ]
                    }
                  },
                  "description": {
                    "description": "Optional human label",
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "url",
                  "enabled_events"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "description",
                    "enabled_events",
                    "enabled",
                    "created_at",
                    "updated_at",
                    "secret"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled_events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/webhooks/{id}": {
      "delete": {
        "operationId": "mail_webhook_delete",
        "summary": "Delete a webhook endpoint.",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_webhook_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "mail_webhook_get",
        "summary": "Get a webhook endpoint by id (secret omitted).",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_webhook_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "description",
                    "enabled_events",
                    "enabled",
                    "created_at",
                    "updated_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled_events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "mail_webhook_update",
        "summary": "Update a webhook endpoint (url, enabled_events, description, or enable/disable).",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_webhook_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "HTTPS URL that signed events are POSTed to",
                    "type": "string",
                    "format": "uri"
                  },
                  "enabled_events": {
                    "description": "Event types to deliver. One or more of: email.delivered, email.bounced, email.complained, email.suppressed, email.opened, email.clicked",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "email.delivered",
                        "email.bounced",
                        "email.complained",
                        "email.suppressed",
                        "email.opened",
                        "email.clicked"
                      ]
                    }
                  },
                  "description": {
                    "description": "Optional human label",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "enabled": {
                    "description": "Enable (true) or disable (false) delivery",
                    "type": "boolean"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "description",
                    "enabled_events",
                    "enabled",
                    "created_at",
                    "updated_at"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "enabled_events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/mail/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "mail_webhook_deliveries_list",
        "summary": "List recent delivery attempts for a webhook endpoint (status, attempts, last error).",
        "tags": [
          "Mail"
        ],
        "x-mcp-tool": "mail_webhook_deliveries_list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook endpoint id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max items (1-100, default 50)",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "endpoint_id",
                      "event_id",
                      "event_type",
                      "status",
                      "attempts",
                      "last_attempt_at",
                      "last_error",
                      "response_status",
                      "created_at",
                      "updated_at"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "attempts": {
                        "type": "number"
                      },
                      "event_id": {
                        "type": "string"
                      },
                      "created_at": {
                        "type": "string"
                      },
                      "event_type": {
                        "type": "string"
                      },
                      "last_error": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "updated_at": {
                        "type": "string"
                      },
                      "endpoint_id": {
                        "type": "string"
                      },
                      "last_attempt_at": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "response_status": {
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/alerts": {
      "get": {
        "operationId": "observe_alerts_list",
        "summary": "List the alert rules of this product, newest first, with what each one measures and whether it is firing right now.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_alerts_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "name",
                      "enabled",
                      "kind",
                      "condition",
                      "throttleMinutes",
                      "state",
                      "lastFiredAt",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "description": "Identifier of the rule",
                        "type": "string"
                      },
                      "kind": {
                        "description": "What the rule measures",
                        "type": "string",
                        "enum": [
                          "error_rate",
                          "log_match"
                        ]
                      },
                      "name": {
                        "description": "Human name the rule was registered under",
                        "type": "string"
                      },
                      "state": {
                        "description": "firing means the condition is met right now",
                        "type": "string",
                        "enum": [
                          "ok",
                          "firing"
                        ]
                      },
                      "enabled": {
                        "description": "Whether the evaluator measures it every minute",
                        "type": "boolean"
                      },
                      "condition": {
                        "description": "The kind’s parameters: threshold and window, plus q for log_match",
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "createdAt": {
                        "description": "ISO 8601 creation timestamp",
                        "type": "string"
                      },
                      "updatedAt": {
                        "description": "ISO 8601 timestamp of the last change",
                        "type": "string"
                      },
                      "lastFiredAt": {
                        "description": "ISO 8601 time it last fired, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "throttleMinutes": {
                        "description": "How long after firing the rule stays quiet",
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "observe_alerts_create",
        "summary": "Create an alert rule for this product.",
        "description": "Create an alert rule for this product. error_rate counts error events in the window; log_match counts log lines matching a Lucene expression, the same one observe_logs_search takes. The rule fires when the count reaches the threshold and resolves when it drops back below it; throttleMinutes is how long it stays quiet after firing. An expression that cannot be parsed is rejected here rather than failing silently on every evaluation.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_alerts_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "What to call the rule, up to 200 characters",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "kind": {
                    "description": "error_rate counts error events in the window; log_match counts log lines matching q",
                    "type": "string",
                    "enum": [
                      "error_rate",
                      "log_match"
                    ]
                  },
                  "condition": {
                    "description": "The kind’s parameters",
                    "type": "object",
                    "required": [
                      "threshold",
                      "window"
                    ],
                    "properties": {
                      "q": {
                        "description": "log_match only: the same Lucene expression observe_logs_search takes, e.g. level:error AND service:api",
                        "type": "string"
                      },
                      "window": {
                        "description": "How far back each evaluation looks",
                        "type": "string",
                        "enum": [
                          "5m",
                          "15m",
                          "1h"
                        ]
                      },
                      "threshold": {
                        "description": "How many matches in the window count as a problem. At least 1",
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "enabled": {
                    "description": "false registers the rule without evaluating it",
                    "type": "boolean"
                  },
                  "throttleMinutes": {
                    "description": "How long after firing the rule stays quiet. Default 60, up to a week",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10080
                  }
                },
                "required": [
                  "name",
                  "kind",
                  "condition"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "enabled",
                    "kind",
                    "condition",
                    "throttleMinutes",
                    "state",
                    "lastFiredAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the rule",
                      "type": "string"
                    },
                    "kind": {
                      "description": "What the rule measures",
                      "type": "string",
                      "enum": [
                        "error_rate",
                        "log_match"
                      ]
                    },
                    "name": {
                      "description": "Human name the rule was registered under",
                      "type": "string"
                    },
                    "state": {
                      "description": "firing means the condition is met right now",
                      "type": "string",
                      "enum": [
                        "ok",
                        "firing"
                      ]
                    },
                    "enabled": {
                      "description": "Whether the evaluator measures it every minute",
                      "type": "boolean"
                    },
                    "condition": {
                      "description": "The kind’s parameters: threshold and window, plus q for log_match",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "createdAt": {
                      "description": "ISO 8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO 8601 timestamp of the last change",
                      "type": "string"
                    },
                    "lastFiredAt": {
                      "description": "ISO 8601 time it last fired, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "throttleMinutes": {
                      "description": "How long after firing the rule stays quiet",
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/alerts/{id}": {
      "delete": {
        "operationId": "observe_alerts_delete",
        "summary": "Remove an alert rule and its firing history.",
        "description": "Remove an alert rule and its firing history. To stop being alerted while keeping the history, set the rule disabled instead.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_alerts_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the rule",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the removed rule",
                      "type": "string"
                    },
                    "deleted": {
                      "description": "Always true; the call fails otherwise",
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "observe_alerts_get",
        "summary": "Read one alert rule of this product, with its current state and last firing.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_alerts_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the rule",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "enabled",
                    "kind",
                    "condition",
                    "throttleMinutes",
                    "state",
                    "lastFiredAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the rule",
                      "type": "string"
                    },
                    "kind": {
                      "description": "What the rule measures",
                      "type": "string",
                      "enum": [
                        "error_rate",
                        "log_match"
                      ]
                    },
                    "name": {
                      "description": "Human name the rule was registered under",
                      "type": "string"
                    },
                    "state": {
                      "description": "firing means the condition is met right now",
                      "type": "string",
                      "enum": [
                        "ok",
                        "firing"
                      ]
                    },
                    "enabled": {
                      "description": "Whether the evaluator measures it every minute",
                      "type": "boolean"
                    },
                    "condition": {
                      "description": "The kind’s parameters: threshold and window, plus q for log_match",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "createdAt": {
                      "description": "ISO 8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO 8601 timestamp of the last change",
                      "type": "string"
                    },
                    "lastFiredAt": {
                      "description": "ISO 8601 time it last fired, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "throttleMinutes": {
                      "description": "How long after firing the rule stays quiet",
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "observe_alerts_update",
        "summary": "Edit an alert rule: its name, its condition, its throttle, or whether it is enabled.",
        "description": "Edit an alert rule: its name, its condition, its throttle, or whether it is enabled. What the rule measures — its kind — is not editable; create a second rule instead. Omit a field to leave it alone.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_alerts_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the rule to change",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "New name for the rule",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "condition": {
                    "description": "The kind’s parameters",
                    "type": "object",
                    "required": [
                      "threshold",
                      "window"
                    ],
                    "properties": {
                      "q": {
                        "description": "log_match only: the same Lucene expression observe_logs_search takes, e.g. level:error AND service:api",
                        "type": "string"
                      },
                      "window": {
                        "description": "How far back each evaluation looks",
                        "type": "string",
                        "enum": [
                          "5m",
                          "15m",
                          "1h"
                        ]
                      },
                      "threshold": {
                        "description": "How many matches in the window count as a problem. At least 1",
                        "type": "integer",
                        "minimum": 1
                      }
                    },
                    "additionalProperties": false
                  },
                  "enabled": {
                    "description": "false stops evaluation and keeps the rule",
                    "type": "boolean"
                  },
                  "throttleMinutes": {
                    "description": "New quiet period after a firing, in minutes",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 10080
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "enabled",
                    "kind",
                    "condition",
                    "throttleMinutes",
                    "state",
                    "lastFiredAt",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the rule",
                      "type": "string"
                    },
                    "kind": {
                      "description": "What the rule measures",
                      "type": "string",
                      "enum": [
                        "error_rate",
                        "log_match"
                      ]
                    },
                    "name": {
                      "description": "Human name the rule was registered under",
                      "type": "string"
                    },
                    "state": {
                      "description": "firing means the condition is met right now",
                      "type": "string",
                      "enum": [
                        "ok",
                        "firing"
                      ]
                    },
                    "enabled": {
                      "description": "Whether the evaluator measures it every minute",
                      "type": "boolean"
                    },
                    "condition": {
                      "description": "The kind’s parameters: threshold and window, plus q for log_match",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "createdAt": {
                      "description": "ISO 8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO 8601 timestamp of the last change",
                      "type": "string"
                    },
                    "lastFiredAt": {
                      "description": "ISO 8601 time it last fired, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "throttleMinutes": {
                      "description": "How long after firing the rule stays quiet",
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/alerts/events": {
      "get": {
        "operationId": "observe_alerts_events_list",
        "summary": "List past and current firings for this product, newest first.",
        "description": "List past and current firings for this product, newest first. A row with a null resolvedAt is an alert that is happening now. Each carries what the measure was and the condition as it stood at that moment.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_alerts_events_list",
        "parameters": [
          {
            "name": "ruleId",
            "in": "query",
            "required": false,
            "description": "Only firings of this rule",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1..200",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of firings to skip",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "ruleId",
                      "firedAt",
                      "resolvedAt",
                      "measured",
                      "condition"
                    ],
                    "properties": {
                      "id": {
                        "description": "Identifier of the firing",
                        "type": "string"
                      },
                      "ruleId": {
                        "description": "Rule that fired",
                        "type": "string"
                      },
                      "firedAt": {
                        "description": "ISO 8601 time the condition was first met",
                        "type": "string"
                      },
                      "measured": {
                        "description": "What the measure was when it fired",
                        "type": "number"
                      },
                      "condition": {
                        "description": "The condition as it stood then, not as the rule reads today",
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "resolvedAt": {
                        "description": "ISO 8601 time it cleared, or null while it is still firing",
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/artifacts": {
      "get": {
        "operationId": "observe_artifacts_list",
        "summary": "List the source map artifacts stored for the current product, newest first.",
        "description": "List the source map artifacts stored for the current product, newest first. Filter by debug ID to see what is available for one build output.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_artifacts_list",
        "parameters": [
          {
            "name": "debugId",
            "in": "query",
            "required": false,
            "description": "Only return artifacts carrying this debug ID; omit to list all of them",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of artifacts to return, 1..200 (default 50)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "debugId",
                      "kind",
                      "fileName",
                      "byteSize",
                      "uploadedAt"
                    ],
                    "properties": {
                      "id": {
                        "description": "Identifier of the stored artifact",
                        "type": "string"
                      },
                      "kind": {
                        "description": "Whether this is the minified source or its map",
                        "type": "string",
                        "enum": [
                          "source",
                          "sourcemap"
                        ]
                      },
                      "debugId": {
                        "description": "Debug ID the build stamped into the file and its source map",
                        "type": "string"
                      },
                      "byteSize": {
                        "description": "Size of the stored artifact in bytes",
                        "type": "number"
                      },
                      "fileName": {
                        "description": "Name the file was uploaded under, e.g. \"app.min.js.map\"",
                        "type": "string"
                      },
                      "uploadedAt": {
                        "description": "ISO 8601 timestamp of the upload",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/artifacts/{id}": {
      "delete": {
        "operationId": "observe_artifacts_delete",
        "summary": "Delete one stored artifact and the bytes behind it.",
        "description": "Delete one stored artifact and the bytes behind it. An artifact belonging to another product is reported as not found.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_artifacts_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the artifact to delete. An artifact of another product is reported as not found",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "debugId",
                    "kind",
                    "fileName",
                    "byteSize",
                    "uploadedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the stored artifact",
                      "type": "string"
                    },
                    "kind": {
                      "description": "Whether this is the minified source or its map",
                      "type": "string",
                      "enum": [
                        "source",
                        "sourcemap"
                      ]
                    },
                    "debugId": {
                      "description": "Debug ID the build stamped into the file and its source map",
                      "type": "string"
                    },
                    "byteSize": {
                      "description": "Size of the stored artifact in bytes",
                      "type": "number"
                    },
                    "fileName": {
                      "description": "Name the file was uploaded under, e.g. \"app.min.js.map\"",
                      "type": "string"
                    },
                    "uploadedAt": {
                      "description": "ISO 8601 timestamp of the upload",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/artifacts/{issueId}/resolve": {
      "get": {
        "operationId": "observe_artifacts_resolve",
        "summary": "Resolve the stack trace of an issue's latest event against the stored source maps, turning minified frames into original file, function, line and column.",
        "description": "Resolve the stack trace of an issue's latest event against the stored source maps, turning minified frames into original file, function, line and column. Frames with no matching debug ID are returned unchanged: a partially resolved trace is the normal result.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_artifacts_resolve",
        "parameters": [
          {
            "name": "issueId",
            "in": "path",
            "required": true,
            "description": "Issue whose latest event should have its stack resolved. An issue of another product is reported as not found",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "issueId",
                    "eventId",
                    "frames"
                  ],
                  "properties": {
                    "frames": {
                      "description": "The stack, resolved where a source map matched",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "resolved"
                        ],
                        "properties": {
                          "colno": {
                            "description": "Column number, original when the frame resolved",
                            "type": "number"
                          },
                          "inApp": {
                            "description": "Whether the frame belongs to the application rather than a dependency",
                            "type": "boolean"
                          },
                          "lineno": {
                            "description": "Line number, original when the frame resolved",
                            "type": "number"
                          },
                          "filename": {
                            "description": "Original file when the frame resolved, else the minified one",
                            "type": "string"
                          },
                          "function": {
                            "description": "Function name, original where the source map names one",
                            "type": "string"
                          },
                          "resolved": {
                            "description": "False means no source map matched and the frame is exactly as it was recorded",
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "eventId": {
                      "description": "Identifier of the event the stack was taken from",
                      "type": "string"
                    },
                    "issueId": {
                      "description": "The issue whose stack this is",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/issues": {
      "get": {
        "operationId": "observe_issues_list",
        "summary": "List error tracking issues of the current product, most recently seen first.",
        "description": "List error tracking issues of the current product, most recently seen first. Filter by status or assignee.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_issues_list",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only return issues in this state; omit to list every state",
            "schema": {
              "type": "string",
              "enum": [
                "unresolved",
                "resolved",
                "archived"
              ]
            }
          },
          {
            "name": "assignee",
            "in": "query",
            "required": false,
            "description": "Only return issues owned by this assignee",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many issues to return, most recently seen first. 1-200, default 50",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "fingerprint",
                      "groupingVersion",
                      "groupingRule",
                      "status",
                      "assignee",
                      "title",
                      "culprit",
                      "exceptionType",
                      "environment",
                      "service",
                      "lastEventId",
                      "lastRelease",
                      "firstSeen",
                      "lastSeen",
                      "eventCount",
                      "resolvedAt",
                      "archivedAt",
                      "regressedAt"
                    ],
                    "properties": {
                      "id": {
                        "description": "Identifier of the issue",
                        "type": "string"
                      },
                      "title": {
                        "description": "Display title, set when the issue opened and never rewritten",
                        "type": "string"
                      },
                      "status": {
                        "description": "unresolved, resolved or archived",
                        "type": "string"
                      },
                      "culprit": {
                        "description": "Where the error appears to come from, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "service": {
                        "description": "Service the most recent event came from, or null if none was reported",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "assignee": {
                        "description": "Who owns the issue, or null if unassigned",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastSeen": {
                        "description": "ISO 8601 timestamp of the most recent event",
                        "type": "string"
                      },
                      "firstSeen": {
                        "description": "ISO 8601 timestamp of the first event",
                        "type": "string"
                      },
                      "archivedAt": {
                        "description": "ISO 8601 archive timestamp, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "eventCount": {
                        "description": "How many events have landed on this issue",
                        "type": "number"
                      },
                      "resolvedAt": {
                        "description": "ISO 8601 resolution timestamp, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "environment": {
                        "description": "Environment the issue was first seen in, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "fingerprint": {
                        "description": "Stable grouping hash the issue is keyed on",
                        "type": "string"
                      },
                      "lastEventId": {
                        "description": "Identifier of the most recent event that landed on the issue, or null for issues rolled up before this was recorded",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "lastRelease": {
                        "description": "Release the most recent event was reported from, or null if none was reported",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "regressedAt": {
                        "description": "ISO 8601 timestamp of the last regression, or null if it never regressed",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "groupingRule": {
                        "description": "Which rule of the ladder matched: explicit, stack, exception or message",
                        "type": "string"
                      },
                      "exceptionType": {
                        "description": "Exception class of the first event, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "groupingVersion": {
                        "description": "Grouping config version that produced the fingerprint; part of the issue identity",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/issues/{id}": {
      "get": {
        "operationId": "observe_issues_get",
        "summary": "Read one error tracking issue by id, together with the resolved stack of its most recent event.",
        "description": "Read one error tracking issue by id, together with the resolved stack of its most recent event. Frames with no matching source map are returned unchanged, and an issue whose stack cannot be read still comes back — with a null stack.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_issues_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the issue",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "fingerprint",
                    "groupingVersion",
                    "groupingRule",
                    "status",
                    "assignee",
                    "title",
                    "culprit",
                    "exceptionType",
                    "environment",
                    "service",
                    "lastEventId",
                    "lastRelease",
                    "firstSeen",
                    "lastSeen",
                    "eventCount",
                    "resolvedAt",
                    "archivedAt",
                    "regressedAt",
                    "stack"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the issue",
                      "type": "string"
                    },
                    "stack": {
                      "description": "Stack of the most recent event, or null when the issue has no events yet or the stack could not be read",
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "eventId",
                            "frames",
                            "rawStacktrace"
                          ],
                          "properties": {
                            "frames": {
                              "description": "The stack, resolved where a stored source map matched the frame",
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "resolved"
                                ],
                                "properties": {
                                  "colno": {
                                    "description": "Column number, original when the frame resolved",
                                    "type": "number"
                                  },
                                  "inApp": {
                                    "description": "Whether the frame belongs to the application rather than a dependency",
                                    "type": "boolean"
                                  },
                                  "lineno": {
                                    "description": "Line number, original when the frame resolved",
                                    "type": "number"
                                  },
                                  "filename": {
                                    "description": "Original file when the frame resolved, else the minified one",
                                    "type": "string"
                                  },
                                  "function": {
                                    "description": "Function name, original where the source map names one",
                                    "type": "string"
                                  },
                                  "resolved": {
                                    "description": "False means no source map matched and the frame is exactly as it was recorded",
                                    "type": "boolean"
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "eventId": {
                              "description": "Identifier of the event the stack was taken from",
                              "type": "string"
                            },
                            "rawStacktrace": {
                              "description": "The stacktrace exactly as the emitter reported it, for events that carry one opaque string instead of frames (OTel span exceptions). Null for Sentry-source events, whose stack is in `frames`.",
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "title": {
                      "description": "Display title, set when the issue opened and never rewritten",
                      "type": "string"
                    },
                    "status": {
                      "description": "unresolved, resolved or archived",
                      "type": "string"
                    },
                    "culprit": {
                      "description": "Where the error appears to come from, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "service": {
                      "description": "Service the most recent event came from, or null if none was reported",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignee": {
                      "description": "Who owns the issue, or null if unassigned",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSeen": {
                      "description": "ISO 8601 timestamp of the most recent event",
                      "type": "string"
                    },
                    "firstSeen": {
                      "description": "ISO 8601 timestamp of the first event",
                      "type": "string"
                    },
                    "archivedAt": {
                      "description": "ISO 8601 archive timestamp, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "eventCount": {
                      "description": "How many events have landed on this issue",
                      "type": "number"
                    },
                    "resolvedAt": {
                      "description": "ISO 8601 resolution timestamp, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environment": {
                      "description": "Environment the issue was first seen in, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fingerprint": {
                      "description": "Stable grouping hash the issue is keyed on",
                      "type": "string"
                    },
                    "lastEventId": {
                      "description": "Identifier of the most recent event that landed on the issue, or null for issues rolled up before this was recorded",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastRelease": {
                      "description": "Release the most recent event was reported from, or null if none was reported",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "regressedAt": {
                      "description": "ISO 8601 timestamp of the last regression, or null if it never regressed",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "groupingRule": {
                      "description": "Which rule of the ladder matched: explicit, stack, exception or message",
                      "type": "string"
                    },
                    "exceptionType": {
                      "description": "Exception class of the first event, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "groupingVersion": {
                      "description": "Grouping config version that produced the fingerprint; part of the issue identity",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/issues/{id}/archive": {
      "post": {
        "operationId": "observe_issues_archive",
        "summary": "Archive an issue: it stops being reported and stays archived even when new events keep landing on it.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_issues_archive",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the issue",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "fingerprint",
                    "groupingVersion",
                    "groupingRule",
                    "status",
                    "assignee",
                    "title",
                    "culprit",
                    "exceptionType",
                    "environment",
                    "service",
                    "lastEventId",
                    "lastRelease",
                    "firstSeen",
                    "lastSeen",
                    "eventCount",
                    "resolvedAt",
                    "archivedAt",
                    "regressedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the issue",
                      "type": "string"
                    },
                    "title": {
                      "description": "Display title, set when the issue opened and never rewritten",
                      "type": "string"
                    },
                    "status": {
                      "description": "unresolved, resolved or archived",
                      "type": "string"
                    },
                    "culprit": {
                      "description": "Where the error appears to come from, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "service": {
                      "description": "Service the most recent event came from, or null if none was reported",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignee": {
                      "description": "Who owns the issue, or null if unassigned",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSeen": {
                      "description": "ISO 8601 timestamp of the most recent event",
                      "type": "string"
                    },
                    "firstSeen": {
                      "description": "ISO 8601 timestamp of the first event",
                      "type": "string"
                    },
                    "archivedAt": {
                      "description": "ISO 8601 archive timestamp, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "eventCount": {
                      "description": "How many events have landed on this issue",
                      "type": "number"
                    },
                    "resolvedAt": {
                      "description": "ISO 8601 resolution timestamp, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environment": {
                      "description": "Environment the issue was first seen in, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fingerprint": {
                      "description": "Stable grouping hash the issue is keyed on",
                      "type": "string"
                    },
                    "lastEventId": {
                      "description": "Identifier of the most recent event that landed on the issue, or null for issues rolled up before this was recorded",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastRelease": {
                      "description": "Release the most recent event was reported from, or null if none was reported",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "regressedAt": {
                      "description": "ISO 8601 timestamp of the last regression, or null if it never regressed",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "groupingRule": {
                      "description": "Which rule of the ladder matched: explicit, stack, exception or message",
                      "type": "string"
                    },
                    "exceptionType": {
                      "description": "Exception class of the first event, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "groupingVersion": {
                      "description": "Grouping config version that produced the fingerprint; part of the issue identity",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/issues/{id}/assign": {
      "post": {
        "operationId": "observe_issues_assign",
        "summary": "Assign an issue to someone, or pass a null assignee to clear the assignment.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_issues_assign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the issue",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "assignee": {
                    "description": "Who should own the issue; null clears the assignment",
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "assignee"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "fingerprint",
                    "groupingVersion",
                    "groupingRule",
                    "status",
                    "assignee",
                    "title",
                    "culprit",
                    "exceptionType",
                    "environment",
                    "service",
                    "lastEventId",
                    "lastRelease",
                    "firstSeen",
                    "lastSeen",
                    "eventCount",
                    "resolvedAt",
                    "archivedAt",
                    "regressedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the issue",
                      "type": "string"
                    },
                    "title": {
                      "description": "Display title, set when the issue opened and never rewritten",
                      "type": "string"
                    },
                    "status": {
                      "description": "unresolved, resolved or archived",
                      "type": "string"
                    },
                    "culprit": {
                      "description": "Where the error appears to come from, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "service": {
                      "description": "Service the most recent event came from, or null if none was reported",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignee": {
                      "description": "Who owns the issue, or null if unassigned",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSeen": {
                      "description": "ISO 8601 timestamp of the most recent event",
                      "type": "string"
                    },
                    "firstSeen": {
                      "description": "ISO 8601 timestamp of the first event",
                      "type": "string"
                    },
                    "archivedAt": {
                      "description": "ISO 8601 archive timestamp, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "eventCount": {
                      "description": "How many events have landed on this issue",
                      "type": "number"
                    },
                    "resolvedAt": {
                      "description": "ISO 8601 resolution timestamp, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environment": {
                      "description": "Environment the issue was first seen in, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fingerprint": {
                      "description": "Stable grouping hash the issue is keyed on",
                      "type": "string"
                    },
                    "lastEventId": {
                      "description": "Identifier of the most recent event that landed on the issue, or null for issues rolled up before this was recorded",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastRelease": {
                      "description": "Release the most recent event was reported from, or null if none was reported",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "regressedAt": {
                      "description": "ISO 8601 timestamp of the last regression, or null if it never regressed",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "groupingRule": {
                      "description": "Which rule of the ladder matched: explicit, stack, exception or message",
                      "type": "string"
                    },
                    "exceptionType": {
                      "description": "Exception class of the first event, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "groupingVersion": {
                      "description": "Grouping config version that produced the fingerprint; part of the issue identity",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/issues/{id}/event": {
      "get": {
        "operationId": "observe_issues_event",
        "summary": "Read one event of an error tracking issue in full — the most recent one by default, or a specific one by id.",
        "description": "Read one event of an error tracking issue in full — the most recent one by default, or a specific one by id. Returns where and in what it happened: service, environment, release, trace, tags, and for OTel events the span with its HTTP method, route, status and target address. An issue whose events are no longer stored still comes back, with a null event.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_issues_event",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the issue",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "eventId",
            "in": "query",
            "required": false,
            "description": "Which event to read; omit to read the most recent one. Must be an event of this issue",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "issueId",
                    "eventId",
                    "source",
                    "event"
                  ],
                  "properties": {
                    "event": {
                      "description": "The event, or null when the issue has no event id or the event is no longer stored — events live 30 days and an issue outlives them. Neither case is an error",
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "occurredAt",
                            "service",
                            "environment",
                            "release",
                            "level",
                            "platform",
                            "sdkName",
                            "sdkVersion",
                            "traceId",
                            "spanId",
                            "tags",
                            "dist",
                            "contexts",
                            "breadcrumbs",
                            "spanName",
                            "attributes",
                            "httpMethod",
                            "httpRoute",
                            "httpStatusCode",
                            "serverAddress",
                            "urlFull"
                          ],
                          "properties": {
                            "dist": {
                              "description": "Distribution of the release. Sentry-source events only",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "tags": {
                              "description": "Tags the emitter attached; empty when it attached none",
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              }
                            },
                            "level": {
                              "description": "Severity the emitter reported. Always null for an OTel event",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "spanId": {
                              "description": "Span the event belongs to, or null when untraced",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "release": {
                              "description": "Release the event was reported from. Always null for an OTel event — a span carries no release",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "sdkName": {
                              "description": "SDK that reported the event. Always null for an OTel event: a span names its instrumentation scope, which is not the SDK",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "service": {
                              "description": "Service the event came from, or null",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "traceId": {
                              "description": "Trace the event belongs to, or null when untraced",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "urlFull": {
                              "description": "Full URL of the span, from url.full or the legacy http.url. Null when the span carries neither",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "contexts": {
                              "description": "The event contexts exactly as stored, unparsed. Sentry-source events only, null for OTel",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "platform": {
                              "description": "Platform the emitter reported. Always null for an OTel event",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "spanName": {
                              "description": "Name of the span the exception happened in. OTel-source events only",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "httpRoute": {
                              "description": "Matched route template of the span, from http.route. Null when the span carries none",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "attributes": {
                              "description": "Attributes of that span. OTel-source events only, null for Sentry",
                              "anyOf": [
                                {
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": "string"
                                  }
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "httpMethod": {
                              "description": "HTTP method of the span, from http.request.method or the legacy http.method. Null when the span carries neither",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "occurredAt": {
                              "description": "ISO 8601 timestamp of the event. For an OTel event this is the exception itself, not the start of the span it happened in",
                              "type": "string"
                            },
                            "sdkVersion": {
                              "description": "Version of that SDK, or null",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "breadcrumbs": {
                              "description": "The breadcrumb trail exactly as stored, unparsed. Sentry-source events only, null for OTel",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "environment": {
                              "description": "Environment the event was reported in, or null",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "serverAddress": {
                              "description": "Address the span was talking to, from server.address or the legacy net.peer.name. Null when the span carries neither",
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "httpStatusCode": {
                              "description": "Response status of the span, from http.response.status_code or the legacy http.status_code. Null when the span carries neither or the value is not a number",
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "source": {
                      "description": "Which store the event id addresses, derived from its shape. Null when there is no event id",
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "sentry",
                            "otel"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "eventId": {
                      "description": "Identifier of the event that was read, or null when the issue has recorded no event id yet",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "issueId": {
                      "description": "Identifier of the issue the event belongs to",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/issues/{id}/events": {
      "get": {
        "operationId": "observe_issues_events",
        "summary": "List the events of an error tracking issue, newest first.",
        "description": "List the events of an error tracking issue, newest first. Each row identifies one event; pass its eventId to observe_issues_event to open it. Page with nextCursor.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_issues_events",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the issue",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many events to return, newest first. 1-100, default 50",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page; omit for the first page",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rows",
                    "nextCursor"
                  ],
                  "properties": {
                    "rows": {
                      "description": "The events, newest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "eventId",
                          "occurredAt",
                          "source"
                        ],
                        "properties": {
                          "source": {
                            "description": "Which store the event id addresses",
                            "type": "string",
                            "enum": [
                              "sentry",
                              "otel"
                            ]
                          },
                          "eventId": {
                            "description": "Identifier of the event; pass it to observe_issues_event to open it",
                            "type": "string"
                          },
                          "occurredAt": {
                            "description": "ISO 8601 timestamp of the event",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "description": "Pass back as cursor for the next page; null when the last page was reached",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/issues/{id}/histogram": {
      "get": {
        "operationId": "observe_issues_histogram",
        "summary": "Count the events of an error tracking issue per bucket over a window, so a reader can see when it started and whether it is still going.",
        "description": "Count the events of an error tracking issue per bucket over a window, so a reader can see when it started and whether it is still going. Bucket width is derived from the window; quiet buckets come back as zeros, never as gaps.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_issues_histogram",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the issue",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "How far back to count, e.g. \"1h\", \"24h\", \"7d\". Up to 30d, default \"24h\"",
            "schema": {
              "type": "string",
              "pattern": "^\\d+[mhd]$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "window",
                    "from",
                    "to",
                    "bucketSeconds",
                    "buckets"
                  ],
                  "properties": {
                    "to": {
                      "description": "ISO 8601 end of the last bucket, exclusive",
                      "type": "string"
                    },
                    "from": {
                      "description": "ISO 8601 start of the first bucket",
                      "type": "string"
                    },
                    "window": {
                      "description": "The window that was counted, e.g. \"24h\"",
                      "type": "string"
                    },
                    "buckets": {
                      "description": "Every bucket of the window, oldest first. Quiet buckets are zeros, never gaps",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "bucket",
                          "count"
                        ],
                        "properties": {
                          "count": {
                            "description": "How many events landed on the issue inside it; zero is a real answer",
                            "type": "number"
                          },
                          "bucket": {
                            "description": "ISO 8601 start of the bucket",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "bucketSeconds": {
                      "description": "Width of one bucket in seconds, derived from the window",
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/issues/{id}/resolve": {
      "post": {
        "operationId": "observe_issues_resolve",
        "summary": "Mark an issue resolved.",
        "description": "Mark an issue resolved. A later event flips it back to unresolved and emits observe/issue.regressed.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_issues_resolve",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the issue",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "fingerprint",
                    "groupingVersion",
                    "groupingRule",
                    "status",
                    "assignee",
                    "title",
                    "culprit",
                    "exceptionType",
                    "environment",
                    "service",
                    "lastEventId",
                    "lastRelease",
                    "firstSeen",
                    "lastSeen",
                    "eventCount",
                    "resolvedAt",
                    "archivedAt",
                    "regressedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the issue",
                      "type": "string"
                    },
                    "title": {
                      "description": "Display title, set when the issue opened and never rewritten",
                      "type": "string"
                    },
                    "status": {
                      "description": "unresolved, resolved or archived",
                      "type": "string"
                    },
                    "culprit": {
                      "description": "Where the error appears to come from, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "service": {
                      "description": "Service the most recent event came from, or null if none was reported",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignee": {
                      "description": "Who owns the issue, or null if unassigned",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSeen": {
                      "description": "ISO 8601 timestamp of the most recent event",
                      "type": "string"
                    },
                    "firstSeen": {
                      "description": "ISO 8601 timestamp of the first event",
                      "type": "string"
                    },
                    "archivedAt": {
                      "description": "ISO 8601 archive timestamp, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "eventCount": {
                      "description": "How many events have landed on this issue",
                      "type": "number"
                    },
                    "resolvedAt": {
                      "description": "ISO 8601 resolution timestamp, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environment": {
                      "description": "Environment the issue was first seen in, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "fingerprint": {
                      "description": "Stable grouping hash the issue is keyed on",
                      "type": "string"
                    },
                    "lastEventId": {
                      "description": "Identifier of the most recent event that landed on the issue, or null for issues rolled up before this was recorded",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastRelease": {
                      "description": "Release the most recent event was reported from, or null if none was reported",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "regressedAt": {
                      "description": "ISO 8601 timestamp of the last regression, or null if it never regressed",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "groupingRule": {
                      "description": "Which rule of the ladder matched: explicit, stack, exception or message",
                      "type": "string"
                    },
                    "exceptionType": {
                      "description": "Exception class of the first event, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "groupingVersion": {
                      "description": "Grouping config version that produced the fingerprint; part of the issue identity",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/keys": {
      "get": {
        "operationId": "observe_keys_list",
        "summary": "List the OTLP ingest keys of the current product.",
        "description": "List the OTLP ingest keys of the current product. Tokens are never returned.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_keys_list",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "description": "Only return keys of this environment; omit to list all of them",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "prefix",
                      "environment",
                      "name",
                      "kind",
                      "createdAt",
                      "revokedAt"
                    ],
                    "properties": {
                      "id": {
                        "description": "Identifier of the ingest key",
                        "type": "string"
                      },
                      "kind": {
                        "description": "ingest = Bearer OTLP key; dsn = public Sentry key that ships in client code",
                        "type": "string",
                        "enum": [
                          "ingest",
                          "dsn"
                        ]
                      },
                      "name": {
                        "description": "Human label given at creation, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "prefix": {
                        "description": "First characters of the token, shown for recognition",
                        "type": "string"
                      },
                      "createdAt": {
                        "description": "ISO 8601 creation timestamp",
                        "type": "string"
                      },
                      "revokedAt": {
                        "description": "ISO 8601 revocation timestamp, or null if active",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "environment": {
                        "description": "Environment the key writes telemetry for",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "observe_keys_create",
        "summary": "Create an ingest credential for one environment: a Bearer OTLP token (kind \"ingest\") or a public Sentry DSN (kind \"dsn\").",
        "description": "Create an ingest credential for one environment: a Bearer OTLP token (kind \"ingest\") or a public Sentry DSN (kind \"dsn\"). The credential is returned once and cannot be retrieved again.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_keys_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "environment": {
                    "description": "Environment this key sends telemetry for, e.g. \"staging\" or \"production\"",
                    "type": "string",
                    "minLength": 1
                  },
                  "name": {
                    "description": "Optional human label for the key, e.g. \"ci\" or \"backend pods\"",
                    "type": "string",
                    "minLength": 1
                  },
                  "kind": {
                    "description": "ingest (default) issues a Bearer OTLP token; dsn issues a public Sentry key returned as a full DSN",
                    "type": "string",
                    "enum": [
                      "ingest",
                      "dsn"
                    ],
                    "default": "ingest"
                  }
                },
                "required": [
                  "environment"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "prefix",
                    "environment",
                    "name",
                    "kind",
                    "createdAt",
                    "revokedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the ingest key",
                      "type": "string"
                    },
                    "dsn": {
                      "description": "The full DSN, for kind \"dsn\" — shown only here, store it now",
                      "type": "string"
                    },
                    "kind": {
                      "description": "ingest = Bearer OTLP key; dsn = public Sentry key that ships in client code",
                      "type": "string",
                      "enum": [
                        "ingest",
                        "dsn"
                      ]
                    },
                    "name": {
                      "description": "Human label given at creation, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "token": {
                      "description": "The full ingest token, for kind \"ingest\" — shown only here, store it now",
                      "type": "string"
                    },
                    "prefix": {
                      "description": "First characters of the token, shown for recognition",
                      "type": "string"
                    },
                    "createdAt": {
                      "description": "ISO 8601 creation timestamp",
                      "type": "string"
                    },
                    "revokedAt": {
                      "description": "ISO 8601 revocation timestamp, or null if active",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "environment": {
                      "description": "Environment the key writes telemetry for",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/keys/{id}/revoke": {
      "post": {
        "operationId": "observe_keys_revoke",
        "summary": "Revoke an OTLP ingest key.",
        "description": "Revoke an OTLP ingest key. Telemetry sent with it is rejected immediately.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_keys_revoke",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the ingest key to revoke",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "revokedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the revoked key",
                      "type": "string"
                    },
                    "revokedAt": {
                      "description": "ISO 8601 timestamp of the revocation",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/logs/facets": {
      "get": {
        "operationId": "observe_logs_facets",
        "summary": "Count the environments, services and severities present in the logs of the current product over a window, so a filter can offer the values that actually exist.",
        "description": "Count the environments, services and severities present in the logs of the current product over a window, so a filter can offer the values that actually exist. Counts are cached for up to a minute.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_logs_facets",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "How far back to count, e.g. \"1h\", \"24h\", \"7d\". Up to 30d, default \"24h\"",
            "schema": {
              "type": "string",
              "default": "24h",
              "pattern": "^\\d+[mhd]$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "window",
                    "from",
                    "to",
                    "environments",
                    "services",
                    "severities"
                  ],
                  "properties": {
                    "to": {
                      "description": "Newest timestamp counted, ISO 8601",
                      "type": "string"
                    },
                    "from": {
                      "description": "Oldest timestamp counted, ISO 8601",
                      "type": "string"
                    },
                    "window": {
                      "description": "The window that was counted, e.g. \"24h\"",
                      "type": "string"
                    },
                    "services": {
                      "description": "Services, most frequent first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "value",
                          "count"
                        ],
                        "properties": {
                          "count": {
                            "description": "How many lines carried it inside the window",
                            "type": "number"
                          },
                          "value": {
                            "description": "The value as the emitter wrote it",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "severities": {
                      "description": "Severities, most frequent first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "value",
                          "count"
                        ],
                        "properties": {
                          "count": {
                            "description": "How many lines carried it inside the window",
                            "type": "number"
                          },
                          "value": {
                            "description": "The value as the emitter wrote it",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "environments": {
                      "description": "Environments, most frequent first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "value",
                          "count"
                        ],
                        "properties": {
                          "count": {
                            "description": "How many lines carried it inside the window",
                            "type": "number"
                          },
                          "value": {
                            "description": "The value as the emitter wrote it",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/logs/search": {
      "get": {
        "operationId": "observe_logs_search",
        "summary": "Search the log lines of the current product, newest first.",
        "description": "Search the log lines of the current product, newest first. Filters are structured; there is no SQL surface. Page with nextCursor.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_logs_search",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "description": "Only lines of this environment, e.g. \"production\"",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": false,
            "description": "Only lines of this service, e.g. \"api\"",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "severityIn",
            "in": "query",
            "required": false,
            "description": "Only lines whose severity is one of these, e.g. [\"ERROR\", \"FATAL\"]",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Match the message body. A single word matches whole words and is indexed; anything longer is a case-insensitive substring match",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "traceId",
            "in": "query",
            "required": false,
            "description": "Only lines of this trace",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Lucene-style expression, ANDed with the structured filters. `key:value` (service, environment, severity, trace_id, span_id, body; any other key matches an attribute), \"quoted phrases\", AND / OR / NOT in uppercase, parentheses. A bare word matches a whole word in the message body. Example: service:api AND NOT severity:INFO AND \"connection refused\"",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Oldest timestamp to include, ISO 8601",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Newest timestamp to include, ISO 8601",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many lines to return, 1-1000, default 100",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page; omit for the first page",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rows",
                    "nextCursor"
                  ],
                  "properties": {
                    "rows": {
                      "description": "The matching log lines, newest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "timestamp",
                          "environment",
                          "service",
                          "severityText",
                          "severityNumber",
                          "body",
                          "traceId",
                          "spanId",
                          "attributes"
                        ],
                        "properties": {
                          "body": {
                            "description": "The log message itself",
                            "type": "string"
                          },
                          "spanId": {
                            "description": "Span this line belongs to, empty when untraced",
                            "type": "string"
                          },
                          "service": {
                            "description": "Service that wrote the line",
                            "type": "string"
                          },
                          "traceId": {
                            "description": "Trace this line belongs to, empty when untraced",
                            "type": "string"
                          },
                          "timestamp": {
                            "description": "ISO 8601 timestamp of the log line, millisecond precision",
                            "type": "string"
                          },
                          "attributes": {
                            "description": "Attributes the emitter attached",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "environment": {
                            "description": "Environment the line was written in",
                            "type": "string"
                          },
                          "severityText": {
                            "description": "Severity as the emitter named it, e.g. \"ERROR\"",
                            "type": "string"
                          },
                          "severityNumber": {
                            "description": "OpenTelemetry severity number, 1-24",
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "description": "Pass back as cursor for the next page; null when the last page was reached",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/logs/tail": {
      "get": {
        "operationId": "observe_logs_tail",
        "summary": "Follow the log lines of the current product.",
        "description": "Follow the log lines of the current product. The first call returns the last 50 lines oldest-first; pass the returned cursor back to get only what arrived since.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_logs_tail",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "description": "Only lines of this environment",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": false,
            "description": "Only lines of this service",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "severityIn",
            "in": "query",
            "required": false,
            "description": "Only lines whose severity is one of these",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous poll; omit to start at the newest lines",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rows",
                    "nextCursor"
                  ],
                  "properties": {
                    "rows": {
                      "description": "The new log lines, oldest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "timestamp",
                          "environment",
                          "service",
                          "severityText",
                          "severityNumber",
                          "body",
                          "traceId",
                          "spanId",
                          "attributes"
                        ],
                        "properties": {
                          "body": {
                            "description": "The log message itself",
                            "type": "string"
                          },
                          "spanId": {
                            "description": "Span this line belongs to, empty when untraced",
                            "type": "string"
                          },
                          "service": {
                            "description": "Service that wrote the line",
                            "type": "string"
                          },
                          "traceId": {
                            "description": "Trace this line belongs to, empty when untraced",
                            "type": "string"
                          },
                          "timestamp": {
                            "description": "ISO 8601 timestamp of the log line, millisecond precision",
                            "type": "string"
                          },
                          "attributes": {
                            "description": "Attributes the emitter attached",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "environment": {
                            "description": "Environment the line was written in",
                            "type": "string"
                          },
                          "severityText": {
                            "description": "Severity as the emitter named it, e.g. \"ERROR\"",
                            "type": "string"
                          },
                          "severityNumber": {
                            "description": "OpenTelemetry severity number, 1-24",
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "description": "Pass back as cursor on the next poll; null only while the product has no logs",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/metrics/catalog": {
      "get": {
        "operationId": "observe_metrics_list",
        "summary": "Catalogue the metrics of the current product: what exists, whether it is a counter or a histogram, its unit, which services report it and which attribute keys its series carry.",
        "description": "Catalogue the metrics of the current product: what exists, whether it is a counter or a histogram, its unit, which services report it and which attribute keys its series carry. Read this before observe_metrics_query — it is where a name, a type and a groupBy key come from.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_metrics_list",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "description": "Only metrics reported in this environment, e.g. \"production\"",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": false,
            "description": "Only metrics reported by this service, e.g. \"api\"",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Only metrics whose name contains this text, case-insensitively",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "How far back to look for metrics; default \"24h\"",
            "schema": {
              "type": "string",
              "enum": [
                "15m",
                "1h",
                "24h",
                "7d",
                "30d"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "window",
                    "metrics"
                  ],
                  "properties": {
                    "window": {
                      "description": "The window that was catalogued",
                      "type": "string"
                    },
                    "metrics": {
                      "description": "The metrics seen in the window, by name",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "type",
                          "unit",
                          "description",
                          "environments",
                          "services",
                          "attributeKeys",
                          "seriesCount",
                          "lastSeen"
                        ],
                        "properties": {
                          "name": {
                            "description": "The metric name, e.g. \"http.server.requests\"",
                            "type": "string"
                          },
                          "type": {
                            "description": "What the metric holds: a counter (\"sum\") or an explicit-bucket histogram",
                            "type": "string",
                            "enum": [
                              "sum",
                              "histogram"
                            ]
                          },
                          "unit": {
                            "description": "Unit as the emitter declared it, e.g. \"ms\"; empty when none",
                            "type": "string"
                          },
                          "lastSeen": {
                            "description": "When the newest point in the window arrived, ISO 8601",
                            "type": "string"
                          },
                          "services": {
                            "description": "Services that reported it",
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "description": {
                            "description": "Description the emitter declared; empty when none",
                            "type": "string"
                          },
                          "seriesCount": {
                            "description": "How many distinct attribute sets were seen in the window",
                            "type": "number"
                          },
                          "environments": {
                            "description": "Environments this metric was reported in",
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "attributeKeys": {
                            "description": "Attribute keys its series carry — the values groupBy accepts",
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/metrics/query": {
      "get": {
        "operationId": "observe_metrics_query",
        "summary": "Read one metric of the current product as a time series.",
        "description": "Read one metric of the current product as a time series. Cumulative counters are differenced at read time, so a process restart reads as its own increase rather than as a negative spike; histogram percentiles are interpolated across the emitter's buckets. Up to 100 series and 500 points each, over at most 31 days; truncated says when a ceiling was reached.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_metrics_query",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": true,
            "description": "The metric to read, exactly as observe_metrics_list names it",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "aggregation",
            "in": "query",
            "required": true,
            "description": "How to aggregate each step. A counter takes \"rate\" (per second), \"increase\" (over the step) or \"value\" (its last reading); a histogram takes \"p50\", \"p90\", \"p99\", \"avg\" or \"count\". A pair that does not match the metric is rejected.",
            "schema": {
              "type": "string",
              "enum": [
                "rate",
                "increase",
                "value",
                "p50",
                "p90",
                "p99",
                "avg",
                "count"
              ]
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the window, ISO 8601; default one hour ago",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the window, ISO 8601; default now",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "step",
            "in": "query",
            "required": false,
            "description": "Bucket width; default the finest that renders at most 500 points",
            "schema": {
              "type": "string",
              "enum": [
                "1m",
                "5m",
                "15m",
                "1h",
                "6h",
                "1d"
              ]
            }
          },
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "description": "Only points from this environment",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": false,
            "description": "Only points from this service",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "attributes",
            "in": "query",
            "required": false,
            "description": "Only points whose attributes match every one of these key/value pairs",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          {
            "name": "groupBy",
            "in": "query",
            "required": false,
            "description": "Attribute keys to keep as the series labels, aggregating every other attribute into them; default one series per distinct attribute set",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "maxItems": 10,
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "type",
                    "unit",
                    "aggregation",
                    "step",
                    "stepSeconds",
                    "from",
                    "to",
                    "series",
                    "truncated"
                  ],
                  "properties": {
                    "to": {
                      "description": "End of the window that was read, ISO 8601",
                      "type": "string"
                    },
                    "from": {
                      "description": "Start of the window that was read, ISO 8601",
                      "type": "string"
                    },
                    "name": {
                      "description": "The metric that was read",
                      "type": "string"
                    },
                    "step": {
                      "description": "The bucket width the series is rendered at",
                      "type": "string"
                    },
                    "type": {
                      "description": "What the metric holds: a counter (\"sum\") or an explicit-bucket histogram",
                      "type": "string",
                      "enum": [
                        "sum",
                        "histogram"
                      ]
                    },
                    "unit": {
                      "description": "Unit as the emitter declared it; empty when none",
                      "type": "string"
                    },
                    "series": {
                      "description": "One series per label set, ordered stably",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "labels",
                          "points"
                        ],
                        "properties": {
                          "labels": {
                            "description": "The attribute set identifying this series, narrowed by groupBy when given",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "points": {
                            "description": "One point per step, oldest first, gaps included",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "timestamp",
                                "value"
                              ],
                              "properties": {
                                "value": {
                                  "description": "The aggregated value; null when the step had no points",
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "timestamp": {
                                  "description": "Start of the step this value covers, ISO 8601",
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "truncated": {
                      "description": "True when a ceiling cut the answer — more series exist than were returned",
                      "type": "boolean"
                    },
                    "aggregation": {
                      "description": "The aggregation that was applied",
                      "type": "string"
                    },
                    "stepSeconds": {
                      "description": "That width in seconds — what a rate was divided by",
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/traces/{traceId}": {
      "get": {
        "operationId": "observe_traces_get",
        "summary": "Read every span of one trace of the current product, oldest first, as a flat list carrying parentSpanId and depth — enough to draw a waterfall without a second call.",
        "description": "Read every span of one trace of the current product, oldest first, as a flat list carrying parentSpanId and depth — enough to draw a waterfall without a second call. Span events are returned exactly as the emitter sent them. Up to 5000 spans.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_traces_get",
        "parameters": [
          {
            "name": "traceId",
            "in": "path",
            "required": true,
            "description": "The trace to render, by its 32-character hex id",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "traceId",
                    "spans"
                  ],
                  "properties": {
                    "spans": {
                      "description": "Every span of the trace, oldest first; empty when the product has no such trace",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "spanId",
                          "parentSpanId",
                          "name",
                          "service",
                          "environment",
                          "kind",
                          "startTime",
                          "endTime",
                          "durationMs",
                          "status",
                          "statusMessage",
                          "depth",
                          "attributes",
                          "resourceAttributes",
                          "events"
                        ],
                        "properties": {
                          "kind": {
                            "description": "OTLP span kind: UNSPECIFIED, INTERNAL, SERVER, CLIENT, PRODUCER or CONSUMER",
                            "type": "string"
                          },
                          "name": {
                            "description": "Span name, e.g. \"GET /users\"",
                            "type": "string"
                          },
                          "depth": {
                            "description": "How many ancestors the span has inside this trace; the root is 0",
                            "type": "number"
                          },
                          "events": {
                            "description": "Events recorded on the span, in the order they were sent",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "name",
                                "timestamp",
                                "attributes"
                              ],
                              "properties": {
                                "name": {
                                  "description": "Event name as the emitter wrote it, e.g. \"exception\"",
                                  "type": "string"
                                },
                                "timestamp": {
                                  "description": "When the event was recorded, ISO 8601",
                                  "type": "string"
                                },
                                "attributes": {
                                  "description": "The event's own attributes, raw",
                                  "type": "object",
                                  "additionalProperties": {}
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "spanId": {
                            "description": "The span id, 16 hex characters",
                            "type": "string"
                          },
                          "status": {
                            "description": "OTLP span status: UNSET, OK or ERROR",
                            "type": "string"
                          },
                          "endTime": {
                            "description": "When the span ended, ISO 8601, nanosecond precision",
                            "type": "string"
                          },
                          "service": {
                            "description": "Service that recorded the span",
                            "type": "string"
                          },
                          "startTime": {
                            "description": "When the span started, ISO 8601, nanosecond precision",
                            "type": "string"
                          },
                          "attributes": {
                            "description": "Attributes the emitter attached",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          },
                          "durationMs": {
                            "description": "How long the span took, in milliseconds",
                            "type": "number"
                          },
                          "environment": {
                            "description": "Environment the span was recorded in",
                            "type": "string"
                          },
                          "parentSpanId": {
                            "description": "Parent span id; empty for the root or when the parent is not in this trace",
                            "type": "string"
                          },
                          "statusMessage": {
                            "description": "Status message the emitter attached, empty when none",
                            "type": "string"
                          },
                          "resourceAttributes": {
                            "description": "Attributes of the emitting resource",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "traceId": {
                      "description": "The trace that was read",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/traces/search": {
      "get": {
        "operationId": "observe_traces_search",
        "summary": "Search the traces of the current product, newest first.",
        "description": "Search the traces of the current product, newest first. One row per trace: its root span, how long the whole trace took, how many spans it has and whether any of them failed. Filters are structured; there is no SQL surface. Page with nextCursor.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_traces_search",
        "parameters": [
          {
            "name": "environment",
            "in": "query",
            "required": false,
            "description": "Only traces of this environment, e.g. \"production\"",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "service",
            "in": "query",
            "required": false,
            "description": "Only traces one of whose spans belongs to this service, e.g. \"api\"",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "description": "Only traces one of whose spans carries this exact span name, e.g. \"GET /users\"",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only traces in this state: \"error\" when any span failed, \"ok\" when none did and at least one reported OK, \"unset\" when no span reported a status",
            "schema": {
              "type": "string",
              "enum": [
                "ok",
                "error",
                "unset"
              ]
            }
          },
          {
            "name": "minDurationMs",
            "in": "query",
            "required": false,
            "description": "Only traces that took at least this many milliseconds end to end",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "maxDurationMs",
            "in": "query",
            "required": false,
            "description": "Only traces that took at most this many milliseconds end to end",
            "schema": {
              "type": "number",
              "minimum": 0
            }
          },
          {
            "name": "traceId",
            "in": "query",
            "required": false,
            "description": "Only this trace, by its 32-character hex id",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Oldest span start to include, ISO 8601",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Newest span start to include, ISO 8601",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many traces to return, 1-1000, default 100",
            "schema": {
              "type": "integer",
              "default": 100,
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The nextCursor of the previous page; omit for the first page",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "traces",
                    "nextCursor"
                  ],
                  "properties": {
                    "traces": {
                      "description": "The matching traces, newest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "traceId",
                          "rootName",
                          "rootService",
                          "environment",
                          "startTime",
                          "durationMs",
                          "spanCount",
                          "errorCount",
                          "hasError"
                        ],
                        "properties": {
                          "traceId": {
                            "description": "The trace id, 32 hex characters",
                            "type": "string"
                          },
                          "hasError": {
                            "description": "True when at least one span failed",
                            "type": "boolean"
                          },
                          "rootName": {
                            "description": "Name of the root span — the one with no parent, or the earliest span",
                            "type": "string"
                          },
                          "spanCount": {
                            "description": "How many spans the trace has",
                            "type": "number"
                          },
                          "startTime": {
                            "description": "When the earliest span started, ISO 8601",
                            "type": "string"
                          },
                          "durationMs": {
                            "description": "Earliest start to latest end, in milliseconds",
                            "type": "number"
                          },
                          "errorCount": {
                            "description": "How many of them reported an ERROR status",
                            "type": "number"
                          },
                          "environment": {
                            "description": "Environment the root span was recorded in",
                            "type": "string"
                          },
                          "rootService": {
                            "description": "Service the root span belongs to",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "description": "Pass back as cursor for the next page; null when the last page was reached",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/webhooks": {
      "get": {
        "operationId": "observe_webhooks_list",
        "summary": "List the webhook endpoints registered for this product.",
        "description": "List the webhook endpoints registered for this product. Signing secrets are never returned.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_webhooks_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "url",
                      "active",
                      "description",
                      "createdAt",
                      "updatedAt"
                    ],
                    "properties": {
                      "id": {
                        "description": "Identifier of the endpoint",
                        "type": "string"
                      },
                      "url": {
                        "description": "HTTPS endpoint events are POSTed to",
                        "type": "string"
                      },
                      "active": {
                        "description": "Whether deliveries are being attempted for it",
                        "type": "boolean"
                      },
                      "createdAt": {
                        "description": "ISO 8601 registration timestamp",
                        "type": "string"
                      },
                      "updatedAt": {
                        "description": "ISO 8601 timestamp of the last change",
                        "type": "string"
                      },
                      "description": {
                        "description": "Free-form note given at registration, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "observe_webhooks_create",
        "summary": "Register an HTTPS endpoint to receive this product’s observe issue events, and mint its signing secret.",
        "description": "Register an HTTPS endpoint to receive this product’s observe issue events, and mint its signing secret. The secret is returned here and NOWHERE ELSE — store it now: it cannot be read back and can only be replaced by rotating it. Plain http:// endpoints are rejected.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_webhooks_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "HTTPS endpoint the event is POSTed to. Plain http:// is rejected",
                    "type": "string",
                    "format": "uri"
                  },
                  "description": {
                    "description": "Free-form note about what this endpoint is for, up to 1000 characters",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  }
                },
                "required": [
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "active",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "secret"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the endpoint",
                      "type": "string"
                    },
                    "url": {
                      "description": "HTTPS endpoint events are POSTed to",
                      "type": "string"
                    },
                    "active": {
                      "description": "Whether deliveries are being attempted for it",
                      "type": "boolean"
                    },
                    "secret": {
                      "description": "The signing secret — shown only here, store it now; it cannot be read back",
                      "type": "string"
                    },
                    "createdAt": {
                      "description": "ISO 8601 registration timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO 8601 timestamp of the last change",
                      "type": "string"
                    },
                    "description": {
                      "description": "Free-form note given at registration, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/webhooks/{id}": {
      "delete": {
        "operationId": "observe_webhooks_delete",
        "summary": "Remove a webhook endpoint and its delivery log.",
        "description": "Remove a webhook endpoint and its delivery log. Delivery stops immediately. To stop delivery while keeping the history, set the endpoint inactive instead.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_webhooks_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the endpoint",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the removed endpoint",
                      "type": "string"
                    },
                    "deleted": {
                      "description": "Always true; the call fails otherwise",
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "observe_webhooks_get",
        "summary": "Read one registered webhook endpoint of this product.",
        "description": "Read one registered webhook endpoint of this product. Its signing secret is never returned.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_webhooks_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the endpoint",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "active",
                    "description",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the endpoint",
                      "type": "string"
                    },
                    "url": {
                      "description": "HTTPS endpoint events are POSTed to",
                      "type": "string"
                    },
                    "active": {
                      "description": "Whether deliveries are being attempted for it",
                      "type": "boolean"
                    },
                    "createdAt": {
                      "description": "ISO 8601 registration timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO 8601 timestamp of the last change",
                      "type": "string"
                    },
                    "description": {
                      "description": "Free-form note given at registration, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "observe_webhooks_update",
        "summary": "Edit a registered endpoint: its url, its description, or whether it is active.",
        "description": "Edit a registered endpoint: its url, its description, or whether it is active. Setting active to false keeps the registration and stops delivery. Omit a field to leave it alone; pass null to clear the description. The signing secret is not editable here — rotate it instead.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_webhooks_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the endpoint to change",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "New HTTPS endpoint. Plain http:// is rejected",
                    "type": "string",
                    "format": "uri"
                  },
                  "active": {
                    "description": "false keeps the registration and stops delivery; true resumes it",
                    "type": "boolean"
                  },
                  "description": {
                    "description": "New note, or null to clear it",
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "active",
                    "description",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the endpoint",
                      "type": "string"
                    },
                    "url": {
                      "description": "HTTPS endpoint events are POSTed to",
                      "type": "string"
                    },
                    "active": {
                      "description": "Whether deliveries are being attempted for it",
                      "type": "boolean"
                    },
                    "createdAt": {
                      "description": "ISO 8601 registration timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO 8601 timestamp of the last change",
                      "type": "string"
                    },
                    "description": {
                      "description": "Free-form note given at registration, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "observe_webhooks_rotate_secret",
        "summary": "Replace the signing secret of an endpoint and return the new one, exactly once.",
        "description": "Replace the signing secret of an endpoint and return the new one, exactly once. The old secret stops verifying immediately — there is no grace window, so update the receiver before rotating.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_webhooks_rotate_secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the endpoint",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "active",
                    "description",
                    "createdAt",
                    "updatedAt",
                    "secret"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the endpoint",
                      "type": "string"
                    },
                    "url": {
                      "description": "HTTPS endpoint events are POSTed to",
                      "type": "string"
                    },
                    "active": {
                      "description": "Whether deliveries are being attempted for it",
                      "type": "boolean"
                    },
                    "secret": {
                      "description": "The signing secret — shown only here, store it now; it cannot be read back",
                      "type": "string"
                    },
                    "createdAt": {
                      "description": "ISO 8601 registration timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO 8601 timestamp of the last change",
                      "type": "string"
                    },
                    "description": {
                      "description": "Free-form note given at registration, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/webhooks/deliveries": {
      "get": {
        "operationId": "observe_webhooks_deliveries_list",
        "summary": "List webhook delivery attempts for this product, newest first.",
        "description": "List webhook delivery attempts for this product, newest first. Filter by endpoint or by state (pending, success, failed). Each row carries the event data that was sent, the last HTTP status and why the last attempt failed.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_webhooks_deliveries_list",
        "parameters": [
          {
            "name": "webhookId",
            "in": "query",
            "required": false,
            "description": "Only deliveries for this endpoint",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only deliveries in this state",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "success",
                "failed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1..200",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of deliveries to skip",
            "schema": {
              "type": "integer",
              "default": 0,
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "webhookId",
                      "eventName",
                      "idempotencyKey",
                      "status",
                      "attemptCount",
                      "lastStatusCode",
                      "lastError",
                      "createdAt",
                      "deliveredAt"
                    ],
                    "properties": {
                      "id": {
                        "description": "Identifier of the delivery, also sent as the envelope id",
                        "type": "string"
                      },
                      "status": {
                        "description": "pending means attempts remain; failed means the retry ladder is spent",
                        "type": "string",
                        "enum": [
                          "pending",
                          "success",
                          "failed"
                        ]
                      },
                      "payload": {
                        "description": "The event data that was sent, before snake_case conversion"
                      },
                      "createdAt": {
                        "description": "ISO 8601 time the delivery was opened",
                        "type": "string"
                      },
                      "eventName": {
                        "description": "Event that was delivered, e.g. \"observe/issue.created\"",
                        "type": "string"
                      },
                      "lastError": {
                        "description": "Why the last attempt failed, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "webhookId": {
                        "description": "Endpoint the delivery is for",
                        "type": "string"
                      },
                      "deliveredAt": {
                        "description": "ISO 8601 time it succeeded, or null",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "attemptCount": {
                        "description": "How many attempts have been made so far",
                        "type": "number"
                      },
                      "idempotencyKey": {
                        "description": "Identity of the source event, repeated on every attempt and on a redelivery",
                        "type": "string"
                      },
                      "lastStatusCode": {
                        "description": "HTTP status of the last attempt, or null",
                        "type": [
                          "number",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/observe/webhooks/deliveries/{id}/redeliver": {
      "post": {
        "operationId": "observe_webhooks_redeliver",
        "summary": "Send a past delivery to its endpoint again, with the original payload and the original idempotency key — a receiver that already processed it can recognise and ignore the repeat.",
        "description": "Send a past delivery to its endpoint again, with the original payload and the original idempotency key — a receiver that already processed it can recognise and ignore the repeat. The original delivery is kept as history and a new one is opened for this attempt. If the endpoint has since been disabled, nothing is delivered.",
        "tags": [
          "Observe"
        ],
        "x-mcp-tool": "observe_webhooks_redeliver",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Identifier of the delivery to send again",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "webhookId",
                    "eventName",
                    "idempotencyKey",
                    "status",
                    "attemptCount",
                    "lastStatusCode",
                    "lastError",
                    "createdAt",
                    "deliveredAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Identifier of the delivery, also sent as the envelope id",
                      "type": "string"
                    },
                    "status": {
                      "description": "pending means attempts remain; failed means the retry ladder is spent",
                      "type": "string",
                      "enum": [
                        "pending",
                        "success",
                        "failed"
                      ]
                    },
                    "payload": {
                      "description": "The event data that was sent, before snake_case conversion"
                    },
                    "createdAt": {
                      "description": "ISO 8601 time the delivery was opened",
                      "type": "string"
                    },
                    "eventName": {
                      "description": "Event that was delivered, e.g. \"observe/issue.created\"",
                      "type": "string"
                    },
                    "lastError": {
                      "description": "Why the last attempt failed, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "webhookId": {
                      "description": "Endpoint the delivery is for",
                      "type": "string"
                    },
                    "deliveredAt": {
                      "description": "ISO 8601 time it succeeded, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "attemptCount": {
                      "description": "How many attempts have been made so far",
                      "type": "number"
                    },
                    "idempotencyKey": {
                      "description": "Identity of the source event, repeated on every attempt and on a redelivery",
                      "type": "string"
                    },
                    "lastStatusCode": {
                      "description": "HTTP status of the last attempt, or null",
                      "type": [
                        "number",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/auth/me": {
      "get": {
        "operationId": "organization_auth_me",
        "summary": "Returns the current identity: identity ID, email, and identity type (e.g.",
        "description": "Returns the current identity: identity ID, email, and identity type (e.g. \"service\" for a service token, which has no email)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_auth_me",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "identityId",
                    "email",
                    "displayName",
                    "identityType"
                  ],
                  "properties": {
                    "email": {
                      "type": "string"
                    },
                    "identityId": {
                      "type": "string"
                    },
                    "displayName": {
                      "type": "string"
                    },
                    "identityType": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/billing/budgets": {
      "get": {
        "operationId": "organization_billing_budgets_get",
        "summary": "Reads the active product's billing budget: the per-product caps of the organization and the current consumption against them.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_billing_budgets_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/billing/budgets/cap": {
      "delete": {
        "operationId": "organization_billing_caps_clear",
        "summary": "Clears the spending cap of one product in the caller’s organization, leaving that product with no cap.",
        "description": "Clears the spending cap of one product in the caller’s organization, leaving that product with no cap. The product must belong to the same organization as the active product.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_billing_caps_clear",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "productId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "organization_billing_caps_set",
        "summary": "Sets the spending cap of one product in the caller’s organization, in integer minor units.",
        "description": "Sets the spending cap of one product in the caller’s organization, in integer minor units. The product must belong to the same organization as the active product; any other is refused.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_billing_caps_set",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "cap_minor": {
                    "type": "integer",
                    "minimum": 0
                  }
                },
                "required": [
                  "productId",
                  "cap_minor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/{id}": {
      "delete": {
        "operationId": "organization_connectors_remove",
        "summary": "Detaches the current product from a connector",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_remove",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/{id}/attachments": {
      "get": {
        "operationId": "organization_connectors_list-attachments",
        "summary": "Lists the products a connector is attached to (org owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_list-attachments",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connectorId",
                    "attachments"
                  ],
                  "properties": {
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "productId",
                          "createdBy",
                          "createdAt",
                          "customerId",
                          "descriptiveName"
                        ],
                        "properties": {
                          "createdAt": {
                            "type": "string"
                          },
                          "createdBy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productId": {
                            "type": "string"
                          },
                          "customerId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "descriptiveName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "connectorId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_connectors_attach",
        "summary": "Attaches products to a connector (batch, idempotent; org owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_attach",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "productIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connectorId",
                    "attachments"
                  ],
                  "properties": {
                    "attachments": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "productId",
                          "createdBy",
                          "createdAt",
                          "customerId",
                          "descriptiveName"
                        ],
                        "properties": {
                          "createdAt": {
                            "type": "string"
                          },
                          "createdBy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productId": {
                            "type": "string"
                          },
                          "customerId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "descriptiveName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "connectorId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/{id}/attachments/{productId}": {
      "delete": {
        "operationId": "organization_connectors_detach",
        "summary": "Detaches one product from a connector (org owner/admin).",
        "description": "Detaches one product from a connector (org owner/admin). Last detach → dormant.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_detach",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/{id}/org": {
      "delete": {
        "operationId": "organization_connectors_delete",
        "summary": "Deletes a connector org-wide: soft-delete, remove all attachments, tear down routing (org owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/{id}/requests": {
      "post": {
        "operationId": "organization_connectors_request",
        "summary": "Requests access to an org connector for a product (any product member)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_request",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/{id}/requests/{requestId}/approve": {
      "post": {
        "operationId": "organization_connectors_approve-request",
        "summary": "Approves a connector access request, attaching the product (org owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_approve-request",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/{id}/requests/{requestId}/deny": {
      "post": {
        "operationId": "organization_connectors_deny-request",
        "summary": "Denies a connector access request (org owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_deny-request",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "success"
                  ],
                  "properties": {
                    "success": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/available": {
      "get": {
        "operationId": "organization_connectors_list-available",
        "summary": "Lists org connectors not yet attached to a product, with this product's request status",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_list-available",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "provider",
                      "externalId",
                      "displayName",
                      "status",
                      "needsReauth",
                      "reauthReason",
                      "reauthAt",
                      "organizationId",
                      "requestStatus"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string"
                      },
                      "reauthAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "needsReauth": {
                        "type": "boolean"
                      },
                      "reauthReason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "requestStatus": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "pending",
                              "denied"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "organizationId": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/clickup/install": {
      "get": {
        "operationId": "organization_clickup_install",
        "summary": "Starts the ClickUp OAuth connect flow for a product and returns the install URL",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_clickup_install",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/clickup/installations": {
      "get": {
        "operationId": "organization_clickup_list-installations",
        "summary": "Lists the ClickUp installations connected to a product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_clickup_list-installations",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "teamId",
                      "teamName",
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "teamId": {
                        "type": "string"
                      },
                      "teamName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/cloudflare/install": {
      "get": {
        "operationId": "organization_cloudflare_install",
        "summary": "Starts the Cloudflare OAuth connect flow for a product and returns the consent URL",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_cloudflare_install",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/gdrive/install": {
      "get": {
        "operationId": "organization_gdrive_install",
        "summary": "Starts the Google Drive OAuth connect flow for a product and returns the consent URL",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_gdrive_install",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/github/install": {
      "get": {
        "operationId": "organization_github_install",
        "summary": "Starts the GitHub app installation flow for a product.",
        "description": "Starts the GitHub app installation flow for a product. When the product's organization already has GitHub connections, returns them so one can be reused (attached) instead of dead-ending on GitHub's already-installed settings page. `url` is always returned — connecting an additional, different GitHub org stays possible.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_github_install",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "url",
                    "canAttach",
                    "connectors"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "install_required",
                        "already_connected"
                      ]
                    },
                    "canAttach": {
                      "type": "boolean"
                    },
                    "connectors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "externalId",
                          "displayName",
                          "attachedToThisProduct",
                          "organizationId"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "externalId": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "organizationId": {
                            "type": "string"
                          },
                          "attachedToThisProduct": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/github/installations": {
      "get": {
        "operationId": "organization_github_list-installations",
        "summary": "Lists the GitHub app installations connected to a product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_github_list-installations",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "installationId",
                      "accountLogin",
                      "accountType",
                      "status"
                    ],
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "accountType": {
                        "type": "string"
                      },
                      "accountLogin": {
                        "type": "string"
                      },
                      "installationId": {
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/googleads/install": {
      "get": {
        "operationId": "organization_googleads_install",
        "summary": "Starts the Google Ads OAuth connect flow for an organization and returns the consent URL",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_googleads_install",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/linkedin-member/install": {
      "get": {
        "operationId": "organization_linkedin_member_install",
        "summary": "Starts the LinkedIn member (personal profile) OAuth connect flow for a product and returns the consent URL",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_linkedin_member_install",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/list": {
      "get": {
        "operationId": "organization_connectors_list",
        "summary": "Lists active connectors in a product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_list",
        "parameters": [
          {
            "name": "productId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "provider",
                      "status",
                      "externalId",
                      "displayName",
                      "config",
                      "needsReauth",
                      "reauthReason",
                      "reauthAt",
                      "createdAt",
                      "origin",
                      "customerId"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "config": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "origin": {
                        "type": "string",
                        "enum": [
                          "product",
                          "org"
                        ]
                      },
                      "status": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string"
                      },
                      "reauthAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "customerId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "needsReauth": {
                        "type": "boolean"
                      },
                      "reauthReason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/reddit/install": {
      "get": {
        "operationId": "organization_reddit_install",
        "summary": "Starts the Reddit OAuth connect flow for a product and returns the consent URL",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_reddit_install",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/x/install": {
      "get": {
        "operationId": "organization_x_install",
        "summary": "Starts the X (Twitter) OAuth connect flow for a product and returns the consent URL",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_x_install",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/connectors/youtube/install": {
      "get": {
        "operationId": "organization_youtube_install",
        "summary": "Starts the YouTube OAuth connect flow for a product and returns the consent URL",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_youtube_install",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url"
                  ],
                  "properties": {
                    "url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/feedback": {
      "post": {
        "operationId": "organization_feedback_submit",
        "summary": "Submit product feedback — opens a GitHub issue in the Lessly feedback repo.",
        "description": "Submit product feedback — opens a GitHub issue in the Lessly feedback repo. Use when the user wants to report a bug, request a feature, or leave feedback about the platform.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_feedback_submit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  },
                  "details": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 65536
                  },
                  "page": {
                    "type": "string"
                  }
                },
                "required": [
                  "title",
                  "details"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "url",
                    "number"
                  ],
                  "properties": {
                    "url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "number": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "supportThreadId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations": {
      "get": {
        "operationId": "organization_list",
        "summary": "Lists the organizations the current user belongs to (owned or via membership).",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "organizations"
                  ],
                  "properties": {
                    "organizations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "role",
                          "active",
                          "logoUrl",
                          "blockedAt",
                          "blockReason"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin",
                              "member"
                            ]
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "logoUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "blockedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "blockReason": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "no_subscription",
                                  "under_review"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_create",
        "summary": "Creates a new organization owned by the current user and sets it as the active organization for the session.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "legalName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "ownerName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "countryOfIncorporation": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "residencyCountry": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "beneficialOwners": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "required": [
                        "name",
                        "country",
                        "share_pct"
                      ],
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "country": {
                          "type": "string",
                          "minLength": 2,
                          "maxLength": 2
                        },
                        "share_pct": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 100
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "ownershipConfirmed": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "legalName",
                  "ownerName",
                  "countryOfIncorporation",
                  "residencyCountry"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/connectors": {
      "get": {
        "operationId": "organization_connectors_list-org",
        "summary": "Lists an organization's connectors with their product attachments (org owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_list-org",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "provider",
                      "status",
                      "externalId",
                      "displayName",
                      "config",
                      "needsReauth",
                      "reauthReason",
                      "reauthAt",
                      "createdAt",
                      "organizationId",
                      "attachedProducts"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "config": {
                        "type": "object",
                        "additionalProperties": {}
                      },
                      "status": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string"
                      },
                      "reauthAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "displayName": {
                        "type": "string"
                      },
                      "needsReauth": {
                        "type": "boolean"
                      },
                      "reauthReason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "organizationId": {
                        "type": "string"
                      },
                      "attachedProducts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "productId",
                            "createdBy",
                            "createdAt",
                            "customerId",
                            "descriptiveName"
                          ],
                          "properties": {
                            "createdAt": {
                              "type": "string"
                            },
                            "createdBy": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "productId": {
                              "type": "string"
                            },
                            "customerId": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "descriptiveName": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/connectors/requests": {
      "get": {
        "operationId": "organization_connectors_list-requests",
        "summary": "Lists connector access requests for an organization (org owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_connectors_list-requests",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "approved",
                "denied"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "connectorId",
                      "provider",
                      "connectorDisplayName",
                      "productId",
                      "productName",
                      "requestedBy",
                      "status",
                      "createdAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "provider": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string"
                      },
                      "productId": {
                        "type": "string"
                      },
                      "connectorId": {
                        "type": "string"
                      },
                      "productName": {
                        "type": "string"
                      },
                      "requestedBy": {
                        "type": "string"
                      },
                      "connectorDisplayName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/invitations": {
      "get": {
        "operationId": "organization_member_list-invitations",
        "summary": "Lists invitations for an organization",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_list-invitations",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "invitations"
                  ],
                  "properties": {
                    "invitations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "email",
                          "role",
                          "status",
                          "invitedByDisplayName",
                          "expiresAt",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "email": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "type": "string"
                          },
                          "invitedByDisplayName": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_member_invite",
        "summary": "Invites a user to an organization by email, optionally sharing products",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_invite",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "role": {
                    "type": "string",
                    "enum": [
                      "owner",
                      "admin",
                      "member"
                    ]
                  },
                  "productShares": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "productId"
                      ],
                      "properties": {
                        "role": {
                          "type": "string"
                        },
                        "roleId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "expiresAt": {
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "date-time"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "productId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "permissions": {
                          "type": "object",
                          "properties": {
                            "deny": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "allow": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "email",
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "outcome",
                        "id",
                        "email",
                        "role",
                        "status",
                        "expiresAt",
                        "createdAt"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "outcome": {
                          "type": "string",
                          "const": "invited"
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "outcome",
                        "userId",
                        "organizationId",
                        "name",
                        "role",
                        "products"
                      ],
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        },
                        "userId": {
                          "type": "string"
                        },
                        "outcome": {
                          "type": "string",
                          "const": "added"
                        },
                        "products": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "name",
                              "slug",
                              "role"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "role": {
                                "type": "string"
                              },
                              "slug": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "organizationId": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/invitations/{invitationId}": {
      "delete": {
        "operationId": "organization_member_revoke-invitation",
        "summary": "Revokes a pending organization invitation",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_revoke-invitation",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "invitationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/members": {
      "get": {
        "operationId": "organization_member_list",
        "summary": "Lists the stored members of an organization with their roles and product grants",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_list",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "members"
                  ],
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "userId",
                          "role",
                          "status",
                          "displayName",
                          "createdAt",
                          "products"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "userId": {
                            "type": "string"
                          },
                          "products": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "productId",
                                "role",
                                "grantSource",
                                "expiresAt"
                              ],
                              "properties": {
                                "role": {
                                  "type": "string"
                                },
                                "expiresAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "productId": {
                                  "type": "string"
                                },
                                "grantSource": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/members/{userId}": {
      "delete": {
        "operationId": "organization_member_remove",
        "summary": "Removes a member from an organization",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_remove",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/members/{userId}/products": {
      "get": {
        "operationId": "organization_member_list-product-access",
        "summary": "Lists the products in an organization a member can access, with role, grant source, and expiry (management view; expired grants are shown with expiresAt).",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_list-product-access",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "products"
                  ],
                  "properties": {
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "productId",
                          "name",
                          "slug",
                          "role",
                          "isCustom",
                          "permissions",
                          "effectivePermissions",
                          "sourceRole",
                          "grantSource",
                          "viaGroup",
                          "viaGroupId",
                          "directGrantNotInForce",
                          "directGrantRole",
                          "expiresAt"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "isCustom": {
                            "type": "boolean"
                          },
                          "viaGroup": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productId": {
                            "type": "string"
                          },
                          "sourceRole": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "viaGroupId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "grantSource": {
                            "type": "string"
                          },
                          "permissions": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "allow",
                                  "deny"
                                ],
                                "properties": {
                                  "deny": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  },
                                  "allow": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    }
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "directGrantRole": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "effectivePermissions": {
                            "type": "object",
                            "required": [
                              "allow",
                              "deny"
                            ],
                            "properties": {
                              "deny": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "allow": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "additionalProperties": false
                          },
                          "directGrantNotInForce": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_member_share-product",
        "summary": "Grants an organization member explicit access to a product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_share-product",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "role": {
                    "type": "string"
                  },
                  "expiresAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "permissions": {
                    "type": "object",
                    "properties": {
                      "deny": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "allow": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "additionalProperties": false
                  },
                  "roleId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "productId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "userId",
                    "role",
                    "expiresAt"
                  ],
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/members/{userId}/products/{productId}": {
      "delete": {
        "operationId": "organization_member_unshare-product",
        "summary": "Revokes an explicit product share from an organization member",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_unshare-product",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/members/{userId}/role": {
      "patch": {
        "operationId": "organization_member_set-role",
        "summary": "Changes an organization member's role (owner only)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_set-role",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "member"
                    ]
                  }
                },
                "required": [
                  "role"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "userId",
                    "role"
                  ],
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{organizationId}/security/mfa/enable": {
      "post": {
        "operationId": "organization_security_mfa_enable",
        "summary": "Turns ON organization-wide multi-factor authentication (2FA) enforcement for an organization.",
        "description": "Turns ON organization-wide multi-factor authentication (2FA) enforcement for an organization. Owner-only: only the owner of the organization may call it. This is deliberately one-way — disabling MFA enforcement is not available over MCP; use the organization security settings in the Product App instead. The policy is strictest-wins across all of a member’s organizations, so enabling it here forces MFA enrollment for every member of this organization at their next sign-in or token refresh.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_security_mfa_enable",
        "parameters": [
          {
            "name": "organizationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "mfaRequired",
                    "trustedDeviceAllowed"
                  ],
                  "properties": {
                    "mfaRequired": {
                      "type": "boolean",
                      "const": true
                    },
                    "trustedDeviceAllowed": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{orgId}/groups": {
      "get": {
        "operationId": "organization_groups_list",
        "summary": "Lists the groups of an organization with their members and product grants",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_list",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "groups"
                  ],
                  "properties": {
                    "groups": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "organizationId",
                          "name",
                          "description",
                          "members",
                          "grants",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "grants": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "productId",
                                "roleId"
                              ],
                              "properties": {
                                "roleId": {
                                  "type": "string"
                                },
                                "productId": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "members": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "userId"
                              ],
                              "properties": {
                                "userId": {
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "organizationId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_groups_create",
        "summary": "Creates an organization group (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_create",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "organizationId",
                    "name",
                    "description",
                    "members",
                    "grants",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "grants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "productId",
                          "roleId"
                        ],
                        "properties": {
                          "roleId": {
                            "type": "string"
                          },
                          "productId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "userId"
                        ],
                        "properties": {
                          "userId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{orgId}/groups/{groupId}": {
      "delete": {
        "operationId": "organization_groups_delete",
        "summary": "Deletes an organization group; the access it carried is withdrawn (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_delete",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "organization_groups_get",
        "summary": "Gets a single organization group with its members and product grants",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_get",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "organizationId",
                    "name",
                    "description",
                    "members",
                    "grants",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "grants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "productId",
                          "roleId"
                        ],
                        "properties": {
                          "roleId": {
                            "type": "string"
                          },
                          "productId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "userId"
                        ],
                        "properties": {
                          "userId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "organization_groups_update",
        "summary": "Renames an organization group or changes its description (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_update",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "organizationId",
                    "name",
                    "description",
                    "members",
                    "grants",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "grants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "productId",
                          "roleId"
                        ],
                        "properties": {
                          "roleId": {
                            "type": "string"
                          },
                          "productId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "userId"
                        ],
                        "properties": {
                          "userId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{orgId}/groups/{groupId}/grants/{productId}": {
      "delete": {
        "operationId": "organization_groups_grant-remove",
        "summary": "Removes a group's grant on a product (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_grant-remove",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "organization_groups_grant-set",
        "summary": "Grants a product to every member of a group at an organization role (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_grant-set",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "roleId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "roleId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{orgId}/groups/{groupId}/members": {
      "post": {
        "operationId": "organization_groups_member-add",
        "summary": "Adds an organization member to a group (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_member-add",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "userId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{orgId}/groups/{groupId}/members/{userId}": {
      "delete": {
        "operationId": "organization_groups_member-remove",
        "summary": "Removes a member from a group; the access the group carried is withdrawn (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_groups_member-remove",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{orgId}/roles": {
      "get": {
        "operationId": "organization_roles_list",
        "summary": "Lists the reusable custom roles defined in an organization",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_roles_list",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "roles"
                  ],
                  "properties": {
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "organizationId",
                          "name",
                          "allow",
                          "deny",
                          "type",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "deny": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "system",
                              "custom"
                            ]
                          },
                          "allow": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "organizationId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_roles_create",
        "summary": "Creates a reusable organization role with allow/deny permission patterns (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_roles_create",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "allow": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "deny": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "organizationId",
                    "name",
                    "allow",
                    "deny",
                    "type",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deny": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "system",
                        "custom"
                      ]
                    },
                    "allow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/{orgId}/roles/{roleId}": {
      "delete": {
        "operationId": "organization_roles_delete",
        "summary": "Deletes an organization role (owner/admin).",
        "description": "Deletes an organization role (owner/admin). Already-materialized product grants are unaffected.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_roles_delete",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "organization_roles_get",
        "summary": "Gets a single organization role by id",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_roles_get",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "organizationId",
                    "name",
                    "allow",
                    "deny",
                    "type",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deny": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "system",
                        "custom"
                      ]
                    },
                    "allow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "organization_roles_update",
        "summary": "Updates an organization role's name or allow/deny patterns (owner/admin)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_roles_update",
        "parameters": [
          {
            "name": "orgId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "allow": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "deny": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "organizationId",
                    "name",
                    "allow",
                    "deny",
                    "type",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deny": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "system",
                        "custom"
                      ]
                    },
                    "allow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/invitations/accept": {
      "post": {
        "operationId": "organization_member_accept-invite",
        "summary": "Accepts an organization invitation using the invitation token",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_member_accept-invite",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "organizationId",
                    "name",
                    "role",
                    "products"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "slug",
                          "role"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/permission-catalog": {
      "get": {
        "operationId": "organization_permission_catalog",
        "summary": "Lists the full permission catalog (key, display_name, group, level, scope) derived from @McpTool handlers.",
        "description": "Lists the full permission catalog (key, display_name, group, level, scope) derived from @McpTool handlers. Only scope=\"product\" entries are grantable in role/point-rights pickers; scope=\"user\" entries are informational.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_permission_catalog",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "catalog"
                  ],
                  "properties": {
                    "catalog": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "display_name",
                          "group",
                          "level",
                          "scope"
                        ],
                        "properties": {
                          "key": {
                            "type": "string"
                          },
                          "group": {
                            "type": "string"
                          },
                          "level": {
                            "type": "string",
                            "enum": [
                              "read",
                              "write",
                              "admin"
                            ]
                          },
                          "scope": {
                            "type": "string",
                            "enum": [
                              "user",
                              "product"
                            ]
                          },
                          "display_name": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/organizations/select": {
      "post": {
        "operationId": "organization_select",
        "summary": "Sets the active organization for the current session and returns the resolved active product.",
        "description": "Sets the active organization for the current session and returns the resolved active product. Session state: the switch also rewrites the session product selection — the current product survives only when it belongs to the new organization, otherwise the caller's first product in that organization is selected, or the selection is cleared when there is none.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_select",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "organizationId": {
                    "type": "string"
                  }
                },
                "required": [
                  "organizationId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "organization",
                    "activeProductId"
                  ],
                  "properties": {
                    "organization": {
                      "type": "object",
                      "required": [
                        "id",
                        "name"
                      ],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "activeProductId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products": {
      "get": {
        "operationId": "organization_product_list",
        "summary": "Lists all products the current user has access to",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_list",
        "parameters": [
          {
            "name": "organizationId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "products"
                  ],
                  "properties": {
                    "products": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "slug",
                          "status",
                          "region",
                          "role",
                          "createdAt",
                          "archivedAt",
                          "blockedAt",
                          "demoAt",
                          "organizationId",
                          "description",
                          "logoUrl"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "demoAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "region": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "logoUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "blockedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "archivedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "organizationId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_product_create",
        "summary": "Creates a new product with the given name",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "organizationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "region": {
                    "type": "string",
                    "enum": [
                      "eu"
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "status",
                    "region",
                    "role",
                    "createdAt",
                    "archivedAt",
                    "blockedAt",
                    "demoAt",
                    "organizationId",
                    "description",
                    "logoUrl"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "demoAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "logoUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "blockedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "archivedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}": {
      "patch": {
        "operationId": "organization_product_update",
        "summary": "Updates an existing product's name and/or description",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_update",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "status",
                    "region",
                    "role",
                    "createdAt",
                    "archivedAt",
                    "blockedAt",
                    "demoAt",
                    "organizationId",
                    "description",
                    "logoUrl"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "demoAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "region": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "logoUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "blockedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "archivedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "organizationId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/access": {
      "get": {
        "operationId": "organization_product_list-access",
        "summary": "Lists who can work in a product: the explicit grants and their roles, the organization owners and admins who inherit full access (read-only here), the organization members holding no access yet, and the organization's named roles a grant can be handed at.",
        "description": "Lists who can work in a product: the explicit grants and their roles, the organization owners and admins who inherit full access (read-only here), the organization members holding no access yet, and the organization's named roles a grant can be handed at. `canManage` states whether the caller may change any of it.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_list-access",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "canManage",
                    "members",
                    "inherited",
                    "candidates",
                    "orgRoles"
                  ],
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "userId",
                          "displayName",
                          "email",
                          "role",
                          "roleId",
                          "roleName",
                          "isCustom",
                          "sourceRole"
                        ],
                        "properties": {
                          "role": {
                            "type": "string"
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "roleId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          },
                          "isCustom": {
                            "type": "boolean"
                          },
                          "roleName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sourceRole": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "id",
                                  "name"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "orgRoles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "canManage": {
                      "type": "boolean"
                    },
                    "inherited": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "userId",
                          "displayName",
                          "email",
                          "orgRole"
                        ],
                        "properties": {
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          },
                          "orgRole": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "admin"
                            ]
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "candidates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "userId",
                          "displayName",
                          "email"
                        ],
                        "properties": {
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/access/{userId}": {
      "delete": {
        "operationId": "organization_product_revoke-access",
        "summary": "Revokes a product grant from an organization member.",
        "description": "Revokes a product grant from an organization member. Access inherited from an organization role is lifted in the organization, and the product owner is removed by transferring ownership.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_revoke-access",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "organization_product_set-access",
        "summary": "Grants an organization member access to a product, or changes the role they already hold, at a standard role (admin, member, viewer) or one of the organization's named roles.",
        "description": "Grants an organization member access to a product, or changes the role they already hold, at a standard role (admin, member, viewer) or one of the organization's named roles. The target must already be an active member of the product's organization; owner is transfer-only, and access inherited from an organization role is changed in the organization.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_set-access",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "role": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "member",
                      "viewer"
                    ]
                  },
                  "roleId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "userId",
                    "role"
                  ],
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/domains": {
      "get": {
        "operationId": "organization_domains_list",
        "summary": "Lists the custom domains configured in a product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_domains_list",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "domains"
                  ],
                  "properties": {
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "productId",
                          "domain",
                          "mode",
                          "providerConnectorId",
                          "createdBy",
                          "createdAt",
                          "extensionCount"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "mode": {
                            "type": "string",
                            "enum": [
                              "external",
                              "managed"
                            ]
                          },
                          "domain": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "productId": {
                            "type": "string"
                          },
                          "extensionCount": {
                            "type": "number"
                          },
                          "providerConnectorId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_domains_add",
        "summary": "Adds a custom domain to a product.",
        "description": "Adds a custom domain to a product. The domain always starts in external (self-managed DNS) mode; when the product has an active Cloudflare connector that can write DNS, the response carries a managedDns hint naming the connector and the tool that switches the domain to managed mode.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_domains_add",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string"
                  }
                },
                "required": [
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "domain",
                    "mode",
                    "providerConnectorId",
                    "createdBy",
                    "createdAt",
                    "managedDns"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "external",
                        "managed"
                      ]
                    },
                    "domain": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "managedDns": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "available",
                            "provider",
                            "providerConnectorId",
                            "tool"
                          ],
                          "properties": {
                            "tool": {
                              "type": "string",
                              "const": "organization_domains_set-mode"
                            },
                            "provider": {
                              "type": "string",
                              "const": "cloudflare"
                            },
                            "available": {
                              "type": "boolean",
                              "const": true
                            },
                            "providerConnectorId": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "providerConnectorId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/domains/{domainId}": {
      "delete": {
        "operationId": "organization_domains_remove",
        "summary": "Removes a custom domain from a product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_domains_remove",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. The tool catalog describes no response body for this operation.",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "organization_domains_get",
        "summary": "Gets a single custom domain in a product by id",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_domains_get",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "domain",
                    "mode",
                    "providerConnectorId",
                    "createdBy",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "external",
                        "managed"
                      ]
                    },
                    "domain": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "providerConnectorId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/domains/{domainId}/bindings": {
      "get": {
        "operationId": "organization_bindings_list",
        "summary": "Lists the extension bindings attached to a domain in a product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_bindings_list",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "bindingId",
                      "domainId",
                      "host",
                      "records",
                      "ownerExtension",
                      "status",
                      "statusDetail",
                      "instruction"
                    ],
                    "properties": {
                      "host": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "active",
                          "failed"
                        ]
                      },
                      "records": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "recordType",
                            "target"
                          ],
                          "properties": {
                            "ttl": {
                              "type": "number"
                            },
                            "name": {
                              "type": "string"
                            },
                            "target": {
                              "type": "string"
                            },
                            "proxied": {
                              "type": "boolean"
                            },
                            "priority": {
                              "type": "number"
                            },
                            "recordType": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "domainId": {
                        "type": "string"
                      },
                      "bindingId": {
                        "type": "string"
                      },
                      "instruction": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "statusDetail": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ownerExtension": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/domains/{domainId}/mode": {
      "put": {
        "operationId": "organization_domains_set-mode",
        "summary": "Switches a custom domain between external (self-managed DNS) and managed mode.",
        "description": "Switches a custom domain between external (self-managed DNS) and managed mode. Managed mode requires providerConnectorId — the id of an active Cloudflare connector attached to the product — and hands the domain's records to the platform reconciler.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_domains_set-mode",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domainId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "managed",
                      "external"
                    ]
                  },
                  "providerConnectorId": {
                    "type": "string"
                  }
                },
                "required": [
                  "mode"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "domain",
                    "mode",
                    "providerConnectorId",
                    "createdBy",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string",
                      "enum": [
                        "external",
                        "managed"
                      ]
                    },
                    "domain": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "providerConnectorId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/extensions": {
      "get": {
        "operationId": "organization_extensions_list-installed",
        "summary": "Lists extensions available to the current product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_extensions_list-installed",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "extensions"
                  ],
                  "properties": {
                    "extensions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "version",
                          "status",
                          "manifest",
                          "uiMode",
                          "registeredAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "uiMode": {
                            "type": "string",
                            "enum": [
                              "federation",
                              "standalone",
                              "none"
                            ]
                          },
                          "version": {
                            "type": "string"
                          },
                          "manifest": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "registeredAt": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/me": {
      "get": {
        "operationId": "organization_product_me",
        "summary": "Returns the caller's own role on a product and the allow/deny grants it carries",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_me",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "role",
                    "roleId",
                    "roleName",
                    "roleType",
                    "allow",
                    "deny"
                  ],
                  "properties": {
                    "deny": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "role": {
                      "type": "string"
                    },
                    "allow": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "roleId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "roleName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "roleType": {
                      "anyOf": [
                        {
                          "type": "string",
                          "enum": [
                            "system",
                            "custom"
                          ]
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/members": {
      "get": {
        "operationId": "organization_product_list-members",
        "summary": "Lists all active members of a product with their roles",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_list-members",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "members"
                  ],
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "userId",
                          "displayName",
                          "email",
                          "role",
                          "roleId",
                          "roleName",
                          "roleType",
                          "joinedAt",
                          "expiresAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "role": {
                            "type": "string"
                          },
                          "email": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "roleId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          },
                          "joinedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "roleName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "roleType": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "system",
                                  "custom"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "displayName": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/members/{memberId}/role": {
      "put": {
        "operationId": "organization_members_assign-role",
        "summary": "Assigns a role to a member of a product",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_members_assign-role",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "memberId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "roleId": {
                    "type": "string"
                  }
                },
                "required": [
                  "roleId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "userId",
                    "agentId",
                    "role",
                    "roleId",
                    "permissions",
                    "status",
                    "invitedBy",
                    "invitedAt",
                    "joinedAt",
                    "expiresAt",
                    "grantSource"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "roleId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "userId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "agentId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "joinedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expiresAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "invitedAt": {
                      "type": "string"
                    },
                    "invitedBy": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "grantSource": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/public-keys": {
      "get": {
        "operationId": "organization_public-keys_list",
        "summary": "Lists a product's public keys.",
        "description": "Lists a product's public keys. Never returns key material.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_public-keys_list",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "keys"
                  ],
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "keyPrefix",
                          "scope",
                          "createdBy",
                          "createdAt",
                          "revokedAt",
                          "imported"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "scope": {
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "*"
                              },
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "extension"
                                  ],
                                  "properties": {
                                    "path": {
                                      "type": "string"
                                    },
                                    "method": {
                                      "type": "string"
                                    },
                                    "extension": {
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              }
                            ]
                          },
                          "imported": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "createdBy": {
                            "type": "string"
                          },
                          "keyPrefix": {
                            "type": "string"
                          },
                          "revokedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_public-keys_create",
        "summary": "Creates a public key for a product.",
        "description": "Creates a public key for a product. The plaintext key is returned only in this response and cannot be retrieved again.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_public-keys_create",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "scope": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "*"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "extension"
                          ],
                          "properties": {
                            "path": {
                              "type": "string"
                            },
                            "method": {
                              "type": "string"
                            },
                            "extension": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "scope"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "keyPrefix",
                    "scope",
                    "createdBy",
                    "createdAt",
                    "revokedAt",
                    "imported",
                    "key"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "*"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "extension"
                            ],
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "method": {
                                "type": "string"
                              },
                              "extension": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      ]
                    },
                    "imported": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "keyPrefix": {
                      "type": "string"
                    },
                    "revokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/public-keys/{id}/revoke": {
      "post": {
        "operationId": "organization_public-keys_revoke",
        "summary": "Revokes a public key.",
        "description": "Revokes a public key. Idempotent; revocation is permanent.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_public-keys_revoke",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "keyPrefix",
                    "scope",
                    "createdBy",
                    "createdAt",
                    "revokedAt",
                    "imported"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "*"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "extension"
                            ],
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "method": {
                                "type": "string"
                              },
                              "extension": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      ]
                    },
                    "imported": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "keyPrefix": {
                      "type": "string"
                    },
                    "revokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/public-keys/{id}/scope": {
      "put": {
        "operationId": "organization_public-keys_update-scope",
        "summary": "Replaces the scope of an active public key.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_public-keys_update-scope",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "scope": {
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "*"
                      },
                      {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "required": [
                            "extension"
                          ],
                          "properties": {
                            "path": {
                              "type": "string"
                            },
                            "method": {
                              "type": "string"
                            },
                            "extension": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        }
                      }
                    ]
                  }
                },
                "required": [
                  "scope"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "keyPrefix",
                    "scope",
                    "createdBy",
                    "createdAt",
                    "revokedAt",
                    "imported"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "scope": {
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "*"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "extension"
                            ],
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "method": {
                                "type": "string"
                              },
                              "extension": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      ]
                    },
                    "imported": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "createdBy": {
                      "type": "string"
                    },
                    "keyPrefix": {
                      "type": "string"
                    },
                    "revokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/public-routes": {
      "get": {
        "operationId": "organization_public-routes_list",
        "summary": "Lists the public routes declared by the product's toolkits, with each route's access mode and public URL.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_public-routes_list",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "routes"
                  ],
                  "properties": {
                    "routes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "extension",
                          "method",
                          "path",
                          "mode",
                          "publicUrl"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "open",
                              "keyed"
                            ]
                          },
                          "path": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "extension": {
                            "type": "string"
                          },
                          "publicUrl": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/{productId}/roles": {
      "get": {
        "operationId": "organization_product_list-roles",
        "summary": "Lists the roles assignable to a product member (system templates + product custom roles)",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_list-roles",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "roles"
                  ],
                  "properties": {
                    "roles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "productId",
                          "type",
                          "key",
                          "name",
                          "allow",
                          "deny"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "key": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "deny": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "system",
                              "custom"
                            ]
                          },
                          "allow": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "productId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/products/select": {
      "post": {
        "operationId": "organization_product_select",
        "summary": "Sets the active product for the current session and reconciles the active organization to that product's organization.",
        "description": "Sets the active product for the current session and reconciles the active organization to that product's organization. Session state: the selection persists for the whole MCP session and every product-scoped tool call resolves against it until changed. Without an explicit selection the session resolves an active product implicitly, so results can belong to a product other than the intended one.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_product_select",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productId": {
                    "type": "string"
                  }
                },
                "required": [
                  "productId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/support/threads": {
      "get": {
        "operationId": "organization_support_threads_list",
        "summary": "List the support threads of the caller's organization, most recently updated first — every member sees every one of them.",
        "description": "List the support threads of the caller's organization, most recently updated first — every member sees every one of them. Threads the caller opened personally before support became organization-wide are included and flagged `legacy`. Use when the user asks about their organization's support requests or tickets.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_support_threads_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "threads"
                  ],
                  "properties": {
                    "threads": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "title",
                          "status",
                          "category",
                          "createdAt",
                          "lastMessageAt",
                          "lastMessagePreview",
                          "openedByName",
                          "legacy"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "legacy": {
                            "type": "boolean"
                          },
                          "status": {
                            "type": "string"
                          },
                          "category": {
                            "type": "string",
                            "enum": [
                              "open",
                              "pending",
                              "resolved",
                              "closed"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "openedByName": {
                            "type": "string"
                          },
                          "lastMessageAt": {
                            "type": "string"
                          },
                          "lastMessagePreview": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "organization_support_thread_create",
        "summary": "Open a support thread owned by the caller's organization — the body becomes the first message, authored by the caller.",
        "description": "Open a support thread owned by the caller's organization — the body becomes the first message, authored by the caller. Every colleague can then read and answer it. Use when the user wants to contact Lessly support.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_support_thread_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  }
                },
                "required": [
                  "title",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "title",
                    "status",
                    "category",
                    "createdAt",
                    "lastMessageAt",
                    "lastMessagePreview",
                    "openedByName",
                    "legacy",
                    "messages"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "legacy": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string",
                      "enum": [
                        "open",
                        "pending",
                        "resolved",
                        "closed"
                      ]
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "author",
                          "body",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "author": {
                            "type": "object",
                            "required": [
                              "kind",
                              "name"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "agent"
                                ]
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "openedByName": {
                      "type": "string"
                    },
                    "lastMessageAt": {
                      "type": "string"
                    },
                    "lastMessagePreview": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/support/threads/{id}": {
      "get": {
        "operationId": "organization_support_thread_get",
        "summary": "Read one support thread of the caller's organization with its full conversation, each message named after its own author.",
        "description": "Read one support thread of the caller's organization with its full conversation, each message named after its own author. A thread of another organization — or another person's legacy personal thread — is reported as not found.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_support_thread_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "title",
                    "status",
                    "category",
                    "createdAt",
                    "lastMessageAt",
                    "lastMessagePreview",
                    "openedByName",
                    "legacy",
                    "messages"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "legacy": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string",
                      "enum": [
                        "open",
                        "pending",
                        "resolved",
                        "closed"
                      ]
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "author",
                          "body",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "author": {
                            "type": "object",
                            "required": [
                              "kind",
                              "name"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "agent"
                                ]
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "openedByName": {
                      "type": "string"
                    },
                    "lastMessageAt": {
                      "type": "string"
                    },
                    "lastMessagePreview": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/governance/api/v1/support/threads/{id}/messages": {
      "post": {
        "operationId": "organization_support_thread_reply",
        "summary": "Reply in any support thread of the caller's organization, as the caller.",
        "description": "Reply in any support thread of the caller's organization, as the caller. A thread of another organization is reported as not found.",
        "tags": [
          "Organization"
        ],
        "x-mcp-tool": "organization_support_thread_reply",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  }
                },
                "required": [
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "title",
                    "status",
                    "category",
                    "createdAt",
                    "lastMessageAt",
                    "lastMessagePreview",
                    "openedByName",
                    "legacy",
                    "messages"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "legacy": {
                      "type": "boolean"
                    },
                    "status": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string",
                      "enum": [
                        "open",
                        "pending",
                        "resolved",
                        "closed"
                      ]
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "author",
                          "body",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "author": {
                            "type": "object",
                            "required": [
                              "kind",
                              "name"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "user",
                                  "agent"
                                ]
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "openedByName": {
                      "type": "string"
                    },
                    "lastMessageAt": {
                      "type": "string"
                    },
                    "lastMessagePreview": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/archive": {
      "get": {
        "operationId": "realtime_archive_get",
        "summary": "Read a channel's durably archived history from Postgres (survives the Redis hot window).",
        "description": "Read a channel's durably archived history from Postgres (survives the Redis hot window). Offset-paginated: pass the returned next_offset as after_offset for the next page.",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_archive_get",
        "parameters": [
          {
            "name": "channel",
            "in": "query",
            "required": true,
            "description": "Channel whose archived history to read",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "after_offset",
            "in": "query",
            "required": false,
            "description": "Return entries strictly after this offset (from a previous page)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100,
              "maximum": 1000,
              "exclusiveMinimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channel",
                    "entries",
                    "next_offset"
                  ],
                  "properties": {
                    "channel": {
                      "type": "string"
                    },
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "offset",
                          "epoch",
                          "ts"
                        ],
                        "properties": {
                          "ts": {
                            "description": "Original publish timestamp (epoch ms)",
                            "type": "number"
                          },
                          "epoch": {
                            "type": "string"
                          },
                          "offset": {
                            "type": "string"
                          },
                          "envelope": {
                            "description": "The archived message envelope"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "next_offset": {
                      "description": "Pass as after_offset to fetch the next page; null = no more entries",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/archive/exports": {
      "post": {
        "operationId": "realtime_archive_export",
        "summary": "Start an async NDJSON export of a channel's archived history to the product bucket.",
        "description": "Start an async NDJSON export of a channel's archived history to the product bucket. Returns an export id; poll realtime_archive_export_status until done.",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_archive_export",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "description": "Channel whose archive to export",
                    "type": "string",
                    "minLength": 1
                  },
                  "from_ts": {
                    "description": "Only entries with ts >= from_ts (epoch ms)",
                    "type": "integer"
                  },
                  "to_ts": {
                    "description": "Only entries with ts <= to_ts (epoch ms)",
                    "type": "integer"
                  }
                },
                "required": [
                  "channel"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "export_id",
                    "status"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "done",
                        "failed"
                      ]
                    },
                    "export_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/archive/exports/{export_id}": {
      "get": {
        "operationId": "realtime_archive_export_status",
        "summary": "Check an archive export: status, and the NDJSON blob reference once done",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_archive_export_status",
        "parameters": [
          {
            "name": "export_id",
            "in": "path",
            "required": true,
            "description": "Export id returned by realtime_archive_export",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "export_id",
                    "status",
                    "ref",
                    "entry_count",
                    "error"
                  ],
                  "properties": {
                    "ref": {
                      "description": "Blob reference of the NDJSON export once status is \"done\"",
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "bucket_key",
                            "size"
                          ],
                          "properties": {
                            "size": {
                              "type": "number"
                            },
                            "bucket_key": {
                              "type": "string"
                            },
                            "content_type": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "done",
                        "failed"
                      ]
                    },
                    "export_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "entry_count": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/grants": {
      "get": {
        "operationId": "realtime_grant_list",
        "summary": "List realtime channel grants for this product, optionally filtered by subject",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_grant_list",
        "parameters": [
          {
            "name": "subject",
            "in": "query",
            "required": false,
            "description": "Filter grants by subject",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "grants"
                  ],
                  "properties": {
                    "grants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "subject",
                          "pattern",
                          "ops",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "ops": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "subscribe",
                                "publish",
                                "presence",
                                "history"
                              ]
                            }
                          },
                          "pattern": {
                            "type": "string"
                          },
                          "subject": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "realtime_grant_create",
        "summary": "Grant a subject (identity id or \"*\" for all identities) operations on channels matching a pattern; \"*\" in a pattern matches exactly one segment",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_grant_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subject": {
                    "description": "Identity id the grant applies to, or \"*\" for every identity in the product",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "pattern": {
                    "description": "Channel pattern, e.g. \"chat:*\" (\"*\" matches exactly one segment)",
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9._-]{1,64}(:([a-zA-Z0-9._-]{1,64}|\\*)){0,7}$"
                  },
                  "ops": {
                    "description": "Operations granted on matching channels",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "subscribe",
                        "publish",
                        "presence",
                        "history"
                      ]
                    }
                  }
                },
                "required": [
                  "subject",
                  "pattern",
                  "ops"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "subject",
                    "pattern",
                    "ops",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "ops": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "subscribe",
                          "publish",
                          "presence",
                          "history"
                        ]
                      }
                    },
                    "pattern": {
                      "type": "string"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/grants/{id}": {
      "delete": {
        "operationId": "realtime_grant_revoke",
        "summary": "Revoke a realtime channel grant by id",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_grant_revoke",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Grant id to revoke",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "revoked"
                  ],
                  "properties": {
                    "revoked": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/messages": {
      "post": {
        "operationId": "realtime_messages_publish",
        "summary": "Publish a JSON message to a realtime channel of the current product",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_messages_publish",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "description": "Channel to publish the message to",
                    "type": "string",
                    "pattern": "^(?=[a-zA-Z0-9._:-]{3,128}$)[a-zA-Z0-9._-]+:[a-zA-Z0-9._:-]+$"
                  },
                  "data": {
                    "description": "JSON payload delivered to channel subscribers",
                    "type": "string"
                  }
                },
                "required": [
                  "channel",
                  "data"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channel",
                    "published"
                  ],
                  "properties": {
                    "epoch": {
                      "description": "Stream epoch of the stored message (present when history is on)",
                      "type": "string"
                    },
                    "offset": {
                      "description": "Stream offset of the stored message (present when history is on)",
                      "type": "string"
                    },
                    "channel": {
                      "description": "Channel the message was published to",
                      "type": "string"
                    },
                    "published": {
                      "description": "Publish acknowledged by the fan-out backend",
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/messages/history": {
      "get": {
        "operationId": "realtime_history_get",
        "summary": "Read message history of a realtime channel: either a cursor (offset + epoch, replays strictly after the offset; recovered:false on epoch mismatch or aged-out entries) or a window (last_n / last_ms).",
        "description": "Read message history of a realtime channel: either a cursor (offset + epoch, replays strictly after the offset; recovered:false on epoch mismatch or aged-out entries) or a window (last_n / last_ms). Conceptually requires the `history` capability; in Phase 1 this surface is Identity-authenticated management access.",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_history_get",
        "parameters": [
          {
            "name": "channel",
            "in": "query",
            "required": true,
            "description": "Channel to read history from",
            "schema": {
              "type": "string",
              "pattern": "^(?=[a-zA-Z0-9._:-]{3,128}$)[a-zA-Z0-9._-]+:[a-zA-Z0-9._:-]+$"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Cursor: resume strictly after this offset (requires epoch)",
            "schema": {
              "type": "string",
              "pattern": "^\\d+-\\d+$"
            }
          },
          {
            "name": "epoch",
            "in": "query",
            "required": false,
            "description": "Cursor: stream epoch the offset belongs to",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "last_n",
            "in": "query",
            "required": false,
            "description": "Window: return the last N entries",
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "exclusiveMinimum": 0
            }
          },
          {
            "name": "last_ms",
            "in": "query",
            "required": false,
            "description": "Window: return entries newer than now minus this many milliseconds",
            "schema": {
              "type": "integer",
              "exclusiveMinimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channel",
                    "epoch",
                    "recovered",
                    "entries"
                  ],
                  "properties": {
                    "epoch": {
                      "description": "Current stream epoch, or null when the channel has no history yet",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "channel": {
                      "description": "Channel the history was read from",
                      "type": "string"
                    },
                    "entries": {
                      "description": "Entries in stream order",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "ts",
                          "offset"
                        ],
                        "properties": {
                          "id": {
                            "description": "Message id from the envelope",
                            "type": "string"
                          },
                          "ts": {
                            "description": "Publish timestamp (ms)",
                            "type": "number"
                          },
                          "ref": {
                            "description": "Store-and-link reference for payloads over the inline cap",
                            "type": "object",
                            "required": [
                              "bucket_key",
                              "size"
                            ],
                            "properties": {
                              "size": {
                                "description": "Stored body size in bytes",
                                "type": "number"
                              },
                              "bucket_key": {
                                "description": "Object key in the product-scoped bucket",
                                "type": "string"
                              },
                              "content_type": {
                                "description": "Stored content type",
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          },
                          "data": {
                            "description": "Inline payload (absent when ref is present)"
                          },
                          "offset": {
                            "description": "Stream offset of the entry",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "recovered": {
                      "description": "false when the cursor epoch mismatches or entries aged out — client must resync",
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/namespaces": {
      "get": {
        "operationId": "realtime_namespace_list",
        "summary": "List all realtime namespaces registered for this product",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_namespace_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "namespaces"
                  ],
                  "properties": {
                    "namespaces": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "visibility",
                          "presence",
                          "clientEvents",
                          "history",
                          "historyWindowSeconds",
                          "encryptionRequired",
                          "identifiedOnly",
                          "subscribeProxyUrl",
                          "archive",
                          "subscribeProxySecretPrefix",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "type": "string"
                          },
                          "archive": {
                            "description": "History archive policy",
                            "anyOf": [
                              {
                                "type": "string",
                                "const": "off"
                              },
                              {
                                "type": "object",
                                "required": [
                                  "days"
                                ],
                                "properties": {
                                  "days": {
                                    "type": "integer"
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "history": {
                            "type": "string",
                            "enum": [
                              "none",
                              "last-message",
                              "window"
                            ]
                          },
                          "presence": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "visibility": {
                            "type": "string",
                            "enum": [
                              "public",
                              "authorized"
                            ]
                          },
                          "clientEvents": {
                            "type": "boolean"
                          },
                          "identifiedOnly": {
                            "type": "boolean"
                          },
                          "subscribeProxyUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "encryptionRequired": {
                            "type": "boolean"
                          },
                          "historyWindowSeconds": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "subscribeProxySecret": {
                            "description": "Full proxy signing secret — returned ONLY when subscribeProxyUrl is set/changed",
                            "type": "string"
                          },
                          "subscribeProxySecretPrefix": {
                            "description": "Visible prefix of the proxy signing secret; null when no proxy url is set",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "realtime_namespace_create",
        "summary": "Register a realtime namespace (the part of a channel name before the first colon) with its policy: visibility, presence, client events, history, encryption, identified-only",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_namespace_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Namespace name (the part of a channel name before the first colon)",
                    "type": "string",
                    "pattern": "^[a-zA-Z0-9._-]{1,64}$"
                  },
                  "visibility": {
                    "description": "public: any authenticated identity may subscribe without a grant",
                    "type": "string",
                    "enum": [
                      "public",
                      "authorized"
                    ],
                    "default": "authorized"
                  },
                  "presence": {
                    "description": "Whether presence is enabled on channels in this namespace",
                    "type": "boolean",
                    "default": false
                  },
                  "clientEvents": {
                    "description": "Whether clients may publish events directly",
                    "type": "boolean",
                    "default": false
                  },
                  "history": {
                    "description": "History retention policy for channels in this namespace",
                    "type": "string",
                    "enum": [
                      "none",
                      "last-message",
                      "window"
                    ],
                    "default": "none"
                  },
                  "historyWindowSeconds": {
                    "description": "Retention window in seconds; required when history is \"window\"",
                    "type": "integer",
                    "maximum": 2592000,
                    "exclusiveMinimum": 0
                  },
                  "encryptionRequired": {
                    "description": "Whether payloads must be end-to-end encrypted",
                    "type": "boolean",
                    "default": false
                  },
                  "identifiedOnly": {
                    "description": "Whether only identified (non-anonymous) identities get capabilities",
                    "type": "boolean",
                    "default": false
                  },
                  "subscribeProxyUrl": {
                    "description": "If set, token mint consults this URL per requested channel (fail-closed); null disables",
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "archive": {
                    "description": "History archive policy: off, or durably retain archived entries for N days (requires history != \"none\")",
                    "default": "off",
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "off"
                      },
                      {
                        "type": "object",
                        "required": [
                          "days"
                        ],
                        "properties": {
                          "days": {
                            "type": "integer",
                            "maximum": 3650,
                            "exclusiveMinimum": 0
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "visibility",
                    "presence",
                    "clientEvents",
                    "history",
                    "historyWindowSeconds",
                    "encryptionRequired",
                    "identifiedOnly",
                    "subscribeProxyUrl",
                    "archive",
                    "subscribeProxySecretPrefix",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "archive": {
                      "description": "History archive policy",
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "off"
                        },
                        {
                          "type": "object",
                          "required": [
                            "days"
                          ],
                          "properties": {
                            "days": {
                              "type": "integer"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "history": {
                      "type": "string",
                      "enum": [
                        "none",
                        "last-message",
                        "window"
                      ]
                    },
                    "presence": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "authorized"
                      ]
                    },
                    "clientEvents": {
                      "type": "boolean"
                    },
                    "identifiedOnly": {
                      "type": "boolean"
                    },
                    "subscribeProxyUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "encryptionRequired": {
                      "type": "boolean"
                    },
                    "historyWindowSeconds": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subscribeProxySecret": {
                      "description": "Full proxy signing secret — returned ONLY when subscribeProxyUrl is set/changed",
                      "type": "string"
                    },
                    "subscribeProxySecretPrefix": {
                      "description": "Visible prefix of the proxy signing secret; null when no proxy url is set",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/namespaces/{name}": {
      "delete": {
        "operationId": "realtime_namespace_delete",
        "summary": "Delete a realtime namespace by name (grants on it stop resolving)",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_namespace_delete",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Namespace name",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._-]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "realtime_namespace_get",
        "summary": "Get a realtime namespace and its policy by name",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_namespace_get",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Namespace name",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._-]{1,64}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "visibility",
                    "presence",
                    "clientEvents",
                    "history",
                    "historyWindowSeconds",
                    "encryptionRequired",
                    "identifiedOnly",
                    "subscribeProxyUrl",
                    "archive",
                    "subscribeProxySecretPrefix",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "archive": {
                      "description": "History archive policy",
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "off"
                        },
                        {
                          "type": "object",
                          "required": [
                            "days"
                          ],
                          "properties": {
                            "days": {
                              "type": "integer"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "history": {
                      "type": "string",
                      "enum": [
                        "none",
                        "last-message",
                        "window"
                      ]
                    },
                    "presence": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "authorized"
                      ]
                    },
                    "clientEvents": {
                      "type": "boolean"
                    },
                    "identifiedOnly": {
                      "type": "boolean"
                    },
                    "subscribeProxyUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "encryptionRequired": {
                      "type": "boolean"
                    },
                    "historyWindowSeconds": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subscribeProxySecret": {
                      "description": "Full proxy signing secret — returned ONLY when subscribeProxyUrl is set/changed",
                      "type": "string"
                    },
                    "subscribeProxySecretPrefix": {
                      "description": "Visible prefix of the proxy signing secret; null when no proxy url is set",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "realtime_namespace_update",
        "summary": "Update the policy of a realtime namespace",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_namespace_update",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "description": "Namespace name to update",
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9._-]{1,64}$"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "visibility": {
                    "description": "public: any authenticated identity may subscribe without a grant",
                    "type": "string",
                    "enum": [
                      "public",
                      "authorized"
                    ]
                  },
                  "presence": {
                    "description": "Whether presence is enabled on channels in this namespace",
                    "type": "boolean"
                  },
                  "clientEvents": {
                    "description": "Whether clients may publish events directly",
                    "type": "boolean"
                  },
                  "history": {
                    "description": "History retention policy for channels in this namespace",
                    "type": "string",
                    "enum": [
                      "none",
                      "last-message",
                      "window"
                    ]
                  },
                  "historyWindowSeconds": {
                    "description": "Retention window in seconds; required when history is \"window\"",
                    "type": "integer",
                    "maximum": 2592000,
                    "exclusiveMinimum": 0
                  },
                  "encryptionRequired": {
                    "description": "Whether payloads must be end-to-end encrypted",
                    "type": "boolean"
                  },
                  "identifiedOnly": {
                    "description": "Whether only identified (non-anonymous) identities get capabilities",
                    "type": "boolean"
                  },
                  "subscribeProxyUrl": {
                    "description": "If set, token mint consults this URL per requested channel (fail-closed); null disables",
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "archive": {
                    "description": "History archive policy: off, or durably retain archived entries for N days (requires history != \"none\")",
                    "anyOf": [
                      {
                        "type": "string",
                        "const": "off"
                      },
                      {
                        "type": "object",
                        "required": [
                          "days"
                        ],
                        "properties": {
                          "days": {
                            "type": "integer",
                            "maximum": 3650,
                            "exclusiveMinimum": 0
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "visibility",
                    "presence",
                    "clientEvents",
                    "history",
                    "historyWindowSeconds",
                    "encryptionRequired",
                    "identifiedOnly",
                    "subscribeProxyUrl",
                    "archive",
                    "subscribeProxySecretPrefix",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "type": "string"
                    },
                    "archive": {
                      "description": "History archive policy",
                      "anyOf": [
                        {
                          "type": "string",
                          "const": "off"
                        },
                        {
                          "type": "object",
                          "required": [
                            "days"
                          ],
                          "properties": {
                            "days": {
                              "type": "integer"
                            }
                          },
                          "additionalProperties": false
                        }
                      ]
                    },
                    "history": {
                      "type": "string",
                      "enum": [
                        "none",
                        "last-message",
                        "window"
                      ]
                    },
                    "presence": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "visibility": {
                      "type": "string",
                      "enum": [
                        "public",
                        "authorized"
                      ]
                    },
                    "clientEvents": {
                      "type": "boolean"
                    },
                    "identifiedOnly": {
                      "type": "boolean"
                    },
                    "subscribeProxyUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "encryptionRequired": {
                      "type": "boolean"
                    },
                    "historyWindowSeconds": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "subscribeProxySecret": {
                      "description": "Full proxy signing secret — returned ONLY when subscribeProxyUrl is set/changed",
                      "type": "string"
                    },
                    "subscribeProxySecretPrefix": {
                      "description": "Visible prefix of the proxy signing secret; null when no proxy url is set",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/presence": {
      "get": {
        "operationId": "realtime_presence_get",
        "summary": "Get the current presence roster for a channel.",
        "description": "Get the current presence roster for a channel. Roster is deduplicated by identity (connections counts live sockets); a per-connection view is deferred — the store is identity-keyed.",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_presence_get",
        "parameters": [
          {
            "name": "channel",
            "in": "query",
            "required": true,
            "description": "Channel name, \"namespace:rest\"",
            "schema": {
              "type": "string",
              "pattern": "^(?=[a-zA-Z0-9._:-]{3,128}$)[a-zA-Z0-9._-]+:[a-zA-Z0-9._:-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channel",
                    "members"
                  ],
                  "properties": {
                    "channel": {
                      "description": "Channel name",
                      "type": "string"
                    },
                    "members": {
                      "description": "Current roster, deduplicated by identity",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "identity",
                          "connections",
                          "ts"
                        ],
                        "properties": {
                          "ts": {
                            "description": "Last update timestamp (ms epoch)",
                            "type": "number"
                          },
                          "info": {
                            "description": "Arbitrary JSON metadata for the member"
                          },
                          "identity": {
                            "description": "Member identity",
                            "type": "string"
                          },
                          "connections": {
                            "description": "Number of live sockets for this identity",
                            "type": "integer"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/presence/enter": {
      "post": {
        "operationId": "realtime_presence_enter",
        "summary": "Enter presence on a realtime channel; upserts the caller (or member_id) into the roster",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_presence_enter",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "description": "Channel name, \"namespace:rest\"",
                    "type": "string",
                    "pattern": "^(?=[a-zA-Z0-9._:-]{3,128}$)[a-zA-Z0-9._-]+:[a-zA-Z0-9._:-]+$"
                  },
                  "info": {
                    "description": "Arbitrary JSON metadata for the member (<=10KB serialized)",
                    "type": "string"
                  },
                  "ttl_seconds": {
                    "description": "Presence entry TTL in seconds (1-3600)",
                    "type": "integer",
                    "default": 60,
                    "minimum": 1,
                    "maximum": 3600
                  },
                  "member_id": {
                    "description": "Act for a synthetic member id instead of the caller identity (backend integrations)",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "channel"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channel",
                    "member"
                  ],
                  "properties": {
                    "member": {
                      "description": "The entered/updated member",
                      "type": "object",
                      "required": [
                        "identity",
                        "connections",
                        "ts"
                      ],
                      "properties": {
                        "ts": {
                          "description": "Last update timestamp (ms epoch)",
                          "type": "number"
                        },
                        "info": {
                          "description": "Arbitrary JSON metadata for the member"
                        },
                        "identity": {
                          "description": "Member identity",
                          "type": "string"
                        },
                        "connections": {
                          "description": "Number of live sockets for this identity",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "channel": {
                      "description": "Channel name",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/presence/leave": {
      "post": {
        "operationId": "realtime_presence_leave",
        "summary": "Leave presence on a realtime channel, removing the caller (or member_id) from the roster",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_presence_leave",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "description": "Channel name, \"namespace:rest\"",
                    "type": "string",
                    "pattern": "^(?=[a-zA-Z0-9._:-]{3,128}$)[a-zA-Z0-9._-]+:[a-zA-Z0-9._:-]+$"
                  },
                  "member_id": {
                    "description": "Act for a synthetic member id instead of the caller identity (backend integrations)",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "channel"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channel",
                    "removed"
                  ],
                  "properties": {
                    "channel": {
                      "description": "Channel name",
                      "type": "string"
                    },
                    "removed": {
                      "description": "Whether the member was removed",
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/presence/stats": {
      "get": {
        "operationId": "realtime_presence_stats",
        "summary": "Get the presence member count for a channel",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_presence_stats",
        "parameters": [
          {
            "name": "channel",
            "in": "query",
            "required": true,
            "description": "Channel name, \"namespace:rest\"",
            "schema": {
              "type": "string",
              "pattern": "^(?=[a-zA-Z0-9._:-]{3,128}$)[a-zA-Z0-9._-]+:[a-zA-Z0-9._:-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channel",
                    "members"
                  ],
                  "properties": {
                    "channel": {
                      "description": "Channel name",
                      "type": "string"
                    },
                    "members": {
                      "description": "Number of distinct identities present",
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/presence/update": {
      "post": {
        "operationId": "realtime_presence_update",
        "summary": "Update a presence member's info and/or refresh its TTL",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_presence_update",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channel": {
                    "description": "Channel name, \"namespace:rest\"",
                    "type": "string",
                    "pattern": "^(?=[a-zA-Z0-9._:-]{3,128}$)[a-zA-Z0-9._-]+:[a-zA-Z0-9._:-]+$"
                  },
                  "info": {
                    "description": "Arbitrary JSON metadata for the member (<=10KB serialized)",
                    "type": "string"
                  },
                  "ttl_seconds": {
                    "description": "Presence entry TTL in seconds (1-3600)",
                    "type": "integer",
                    "default": 60,
                    "minimum": 1,
                    "maximum": 3600
                  },
                  "member_id": {
                    "description": "Act for a synthetic member id instead of the caller identity (backend integrations)",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 256
                  }
                },
                "required": [
                  "channel"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "channel",
                    "member"
                  ],
                  "properties": {
                    "member": {
                      "description": "The entered/updated member",
                      "type": "object",
                      "required": [
                        "identity",
                        "connections",
                        "ts"
                      ],
                      "properties": {
                        "ts": {
                          "description": "Last update timestamp (ms epoch)",
                          "type": "number"
                        },
                        "info": {
                          "description": "Arbitrary JSON metadata for the member"
                        },
                        "identity": {
                          "description": "Member identity",
                          "type": "string"
                        },
                        "connections": {
                          "description": "Number of live sockets for this identity",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "channel": {
                      "description": "Channel name",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/public-access/status": {
      "get": {
        "operationId": "realtime_public_access_status",
        "summary": "Check whether this product has a public key configured — an onboarding hint for the portal, never an authorization decision",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_public_access_status",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "exists"
                  ],
                  "properties": {
                    "exists": {
                      "description": "Whether this product has created a public key yet (an onboarding hint, not a gate)",
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/status": {
      "get": {
        "operationId": "realtime_status_get",
        "summary": "Get realtime service status: Redis fan-out connectivity, token signing key presence, gateway URL",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_status_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "service",
                    "redis",
                    "signingKeyConfigured",
                    "gatewayUrl"
                  ],
                  "properties": {
                    "redis": {
                      "description": "Redis fan-out connectivity",
                      "type": "string",
                      "enum": [
                        "connected",
                        "disconnected",
                        "unconfigured"
                      ]
                    },
                    "service": {
                      "description": "API liveness marker",
                      "type": "string",
                      "const": "ok"
                    },
                    "gatewayUrl": {
                      "description": "WebSocket URL of the realtime gateway",
                      "type": "string"
                    },
                    "signingKeyConfigured": {
                      "description": "Whether the token signing key is present",
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/tokens": {
      "post": {
        "operationId": "realtime_tokens_create",
        "summary": "Mint a short-lived capability token (JWT) carrying the capabilities the identity has via namespace policy and grants (optionally filtered to the given channels), plus the gateway WebSocket URL to connect to",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_tokens_create",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "channels": {
                    "description": "Concrete channels to filter the resolved capabilities to; omit to receive all capabilities the identity has",
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 32,
                    "items": {
                      "description": "Channel name to grant subscribe access to",
                      "type": "string",
                      "pattern": "^(?=[a-zA-Z0-9._:-]{3,128}$)[a-zA-Z0-9._-]+:[a-zA-Z0-9._:-]+$"
                    }
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "token",
                    "gatewayUrl"
                  ],
                  "properties": {
                    "token": {
                      "description": "Signed EdDSA capability JWT (60s TTL)",
                      "type": "string"
                    },
                    "gatewayUrl": {
                      "description": "WebSocket URL of the realtime gateway to connect to",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/webhooks": {
      "get": {
        "operationId": "realtime_webhook_list",
        "summary": "List all client webhooks registered for this product (secret metadata only)",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_webhook_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "webhooks"
                  ],
                  "properties": {
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "url",
                          "description",
                          "events",
                          "active",
                          "secrets",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "url": {
                            "type": "string"
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "secrets": {
                            "description": "Secret metadata only — never the secret itself",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "prefix",
                                "expiresAt",
                                "createdAt"
                              ],
                              "properties": {
                                "prefix": {
                                  "description": "Visible secret prefix — matches the X-Realtime-Key header",
                                  "type": "string"
                                },
                                "createdAt": {
                                  "type": "string"
                                },
                                "expiresAt": {
                                  "description": "When this secret stops verifying; null = current signer",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "realtime_webhook_create",
        "summary": "Register a client webhook: lifecycle notifications (channel occupied/vacated, presence member added/removed) are POSTed to the URL signed with HMAC-SHA256.",
        "description": "Register a client webhook: lifecycle notifications (channel occupied/vacated, presence member added/removed) are POSTed to the URL signed with HMAC-SHA256. Returns the full signing secret ONCE.",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_webhook_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "Endpoint that receives signed lifecycle POSTs (https in production)",
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "events": {
                    "description": "Lifecycle event types this webhook receives",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "description": "Lifecycle notification type",
                      "type": "string",
                      "enum": [
                        "channel.occupied",
                        "channel.vacated",
                        "presence.member-added",
                        "presence.member-removed"
                      ]
                    }
                  },
                  "description": {
                    "description": "Free-form note",
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "webhook",
                    "secret"
                  ],
                  "properties": {
                    "secret": {
                      "description": "Full signing secret — returned only once, at creation. Store it now.",
                      "type": "string"
                    },
                    "webhook": {
                      "type": "object",
                      "required": [
                        "id",
                        "url",
                        "description",
                        "events",
                        "active",
                        "secrets",
                        "createdAt",
                        "updatedAt"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "url": {
                          "type": "string"
                        },
                        "active": {
                          "type": "boolean"
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "secrets": {
                          "description": "Secret metadata only — never the secret itself",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "prefix",
                              "expiresAt",
                              "createdAt"
                            ],
                            "properties": {
                              "prefix": {
                                "description": "Visible secret prefix — matches the X-Realtime-Key header",
                                "type": "string"
                              },
                              "createdAt": {
                                "type": "string"
                              },
                              "expiresAt": {
                                "description": "When this secret stops verifying; null = current signer",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string"
                        },
                        "description": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/webhooks/{webhookId}": {
      "delete": {
        "operationId": "realtime_webhook_delete",
        "summary": "Delete a client webhook (its secrets and delivery log go with it)",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_webhook_delete",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deleted"
                  ],
                  "properties": {
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "realtime_webhook_get",
        "summary": "Get a client webhook by id (secret metadata only, never the secret)",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_webhook_get",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "description",
                    "events",
                    "active",
                    "secrets",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "url": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "secrets": {
                      "description": "Secret metadata only — never the secret itself",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "prefix",
                          "expiresAt",
                          "createdAt"
                        ],
                        "properties": {
                          "prefix": {
                            "description": "Visible secret prefix — matches the X-Realtime-Key header",
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "description": "When this secret stops verifying; null = current signer",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "realtime_webhook_update",
        "summary": "Update a client webhook: url, event filter, description, active flag",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_webhook_update",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "description": "Webhook id to update",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "Endpoint that receives signed lifecycle POSTs (https in production)",
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "events": {
                    "description": "Lifecycle event types this webhook receives",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "description": "Lifecycle notification type",
                      "type": "string",
                      "enum": [
                        "channel.occupied",
                        "channel.vacated",
                        "presence.member-added",
                        "presence.member-removed"
                      ]
                    }
                  },
                  "description": {
                    "description": "Free-form note",
                    "anyOf": [
                      {
                        "description": "Free-form note",
                        "type": "string",
                        "maxLength": 500
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "active": {
                    "description": "Inactive webhooks receive no deliveries",
                    "type": "boolean"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "description",
                    "events",
                    "active",
                    "secrets",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "url": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "secrets": {
                      "description": "Secret metadata only — never the secret itself",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "prefix",
                          "expiresAt",
                          "createdAt"
                        ],
                        "properties": {
                          "prefix": {
                            "description": "Visible secret prefix — matches the X-Realtime-Key header",
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "description": "When this secret stops verifying; null = current signer",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/webhooks/{webhookId}/deliveries": {
      "get": {
        "operationId": "realtime_webhook_deliveries_list",
        "summary": "List recent delivery attempts of a webhook (status, attempts, response code)",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_webhook_deliveries_list",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max deliveries to return (newest first)",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deliveries"
                  ],
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "eventType",
                          "eventId",
                          "status",
                          "attempts",
                          "responseStatus",
                          "lastError",
                          "lastAttemptAt",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "succeeded",
                              "failed"
                            ]
                          },
                          "eventId": {
                            "description": "Source lifecycle event idempotencyKey",
                            "type": "string"
                          },
                          "attempts": {
                            "type": "integer"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "eventType": {
                            "type": "string"
                          },
                          "lastError": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastAttemptAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "responseStatus": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/realtime/webhooks/{webhookId}/secret/rotate": {
      "post": {
        "operationId": "realtime_webhook_secret_rotate",
        "summary": "Rotate the webhook signing secret with an overlap window: the new secret signs immediately (returned ONCE), the previous one keeps verifying until its grace expiry",
        "tags": [
          "Realtime"
        ],
        "x-mcp-tool": "realtime_webhook_secret_rotate",
        "parameters": [
          {
            "name": "webhookId",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "secret",
                    "prefix",
                    "previousExpiresAt"
                  ],
                  "properties": {
                    "prefix": {
                      "description": "Visible prefix of the new secret (X-Realtime-Key)",
                      "type": "string"
                    },
                    "secret": {
                      "description": "New full signing secret — returned only once. Store it now.",
                      "type": "string"
                    },
                    "previousExpiresAt": {
                      "description": "When the rotated-out secret stops verifying (grace window)",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/agents": {
      "get": {
        "operationId": "support_agent_list",
        "summary": "List this product support agents by display name.",
        "description": "List this product support agents by display name. Deactivated agents are hidden unless asked for: they keep every message they wrote but cannot take new threads. Through the public edge the profiles come back without lesslyUserId — the binding never leaves the authenticated plane",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_agent_list",
        "parameters": [
          {
            "name": "includeInactive",
            "in": "query",
            "required": false,
            "description": "Also return deactivated agents (default false)",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "agents"
                  ],
                  "properties": {
                    "agents": {
                      "description": "The product support agents, by display name",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "displayName",
                          "title",
                          "avatarUrl",
                          "lesslyUserId",
                          "isActive",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Agent id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "title": {
                            "description": "Job title shown under the name, or null if unset",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "isActive": {
                            "description": "A deactivated agent keeps its history but can no longer be put on a thread",
                            "type": "boolean"
                          },
                          "avatarUrl": {
                            "description": "Avatar image URL, or null if unset",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          },
                          "updatedAt": {
                            "description": "ISO-8601 last-modification timestamp",
                            "type": "string"
                          },
                          "displayName": {
                            "description": "Name shown next to the agent replies",
                            "type": "string"
                          },
                          "lesslyUserId": {
                            "description": "Bound Lessly identity, stored verbatim and resolved by nobody. Null for an unbound profile — a bot or the client's own backend, which replies just like anyone else",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "support_agent_create",
        "summary": "Create a support agent profile for this product.",
        "description": "Create a support agent profile for this product. Binding a Lessly identity is optional and the value is stored verbatim — nothing resolves it or checks that the user exists. An unbound profile is a bot or the client's own backend, and it replies exactly like a human agent does",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_agent_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Name the end user sees next to this agent replies",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "title": {
                    "description": "Job title shown under the name, e.g. \"Support engineer\"",
                    "type": "string",
                    "maxLength": 255
                  },
                  "avatarUrl": {
                    "description": "Absolute URL of the agent avatar image",
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2048
                  },
                  "lesslyUserId": {
                    "description": "Lessly identity to bind this profile to, stored verbatim as an opaque string. It is never resolved, validated against the platform or enriched. Omit it for a bot or a backend profile. At most one agent per product may claim a given Lessly user",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "required": [
                  "displayName"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "displayName",
                    "title",
                    "avatarUrl",
                    "lesslyUserId",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Agent id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "title": {
                      "description": "Job title shown under the name, or null if unset",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isActive": {
                      "description": "A deactivated agent keeps its history but can no longer be put on a thread",
                      "type": "boolean"
                    },
                    "avatarUrl": {
                      "description": "Avatar image URL, or null if unset",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "displayName": {
                      "description": "Name shown next to the agent replies",
                      "type": "string"
                    },
                    "lesslyUserId": {
                      "description": "Bound Lessly identity, stored verbatim and resolved by nobody. Null for an unbound profile — a bot or the client's own backend, which replies just like anyone else",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/agents/{id}": {
      "get": {
        "operationId": "support_agent_get",
        "summary": "Get one support agent by id, deactivated ones included.",
        "description": "Get one support agent by id, deactivated ones included. An agent belonging to another product is reported as not found. Through the public edge the profile comes back without lesslyUserId — the binding never leaves the authenticated plane",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_agent_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Agent id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "displayName",
                    "title",
                    "avatarUrl",
                    "lesslyUserId",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Agent id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "title": {
                      "description": "Job title shown under the name, or null if unset",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isActive": {
                      "description": "A deactivated agent keeps its history but can no longer be put on a thread",
                      "type": "boolean"
                    },
                    "avatarUrl": {
                      "description": "Avatar image URL, or null if unset",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "displayName": {
                      "description": "Name shown next to the agent replies",
                      "type": "string"
                    },
                    "lesslyUserId": {
                      "description": "Bound Lessly identity, stored verbatim and resolved by nobody. Null for an unbound profile — a bot or the client's own backend, which replies just like anyone else",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "support_agent_update",
        "summary": "Edit an agent profile.",
        "description": "Edit an agent profile. Pass null to clear the title, the avatar or the Lessly binding; omit a field to leave it alone. Setting isActive to false deactivates the agent: it keeps every message it wrote and every thread it already sits on, but cannot be assigned to another one",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_agent_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Agent id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "displayName": {
                    "description": "Name the end user sees next to this agent replies",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "title": {
                    "description": "New job title, or null to clear it",
                    "anyOf": [
                      {
                        "description": "Job title shown under the name, e.g. \"Support engineer\"",
                        "type": "string",
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "avatarUrl": {
                    "description": "New avatar URL, or null to clear it",
                    "anyOf": [
                      {
                        "description": "Absolute URL of the agent avatar image",
                        "type": "string",
                        "format": "uri",
                        "maxLength": 2048
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lesslyUserId": {
                    "description": "Lessly identity to bind, or null to unbind. Stored verbatim, resolved by nobody",
                    "anyOf": [
                      {
                        "description": "Lessly identity to bind this profile to, stored verbatim as an opaque string. It is never resolved, validated against the platform or enriched. Omit it for a bot or a backend profile. At most one agent per product may claim a given Lessly user",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 255
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "isActive": {
                    "description": "Deactivate or reactivate. A deactivated agent keeps every message it wrote and every thread it already sits on, but cannot be assigned to another one",
                    "type": "boolean"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "displayName",
                    "title",
                    "avatarUrl",
                    "lesslyUserId",
                    "isActive",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Agent id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "title": {
                      "description": "Job title shown under the name, or null if unset",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "isActive": {
                      "description": "A deactivated agent keeps its history but can no longer be put on a thread",
                      "type": "boolean"
                    },
                    "avatarUrl": {
                      "description": "Avatar image URL, or null if unset",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "displayName": {
                      "description": "Name shown next to the agent replies",
                      "type": "string"
                    },
                    "lesslyUserId": {
                      "description": "Bound Lessly identity, stored verbatim and resolved by nobody. Null for an unbound profile — a bot or the client's own backend, which replies just like anyone else",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/attachments": {
      "post": {
        "operationId": "support_attachment_create",
        "summary": "Reserve a file on a support thread and get a short-lived signed URL to upload it to.",
        "description": "Reserve a file on a support thread and get a short-lived signed URL to upload it to. The bytes never pass through this API: PUT them to the returned uploadUrl with the same Content-Type AND the header \"x-goog-content-length-range: 0,26214400\", both of which the signature covers — omit either and storage refuses the PUT. Then call support_attachment_finalize, which checks that the first bytes really are the type you declared. Only the content types listed on the contentType field are accepted. A thread may hold at most 20 attachments waiting for their bytes at once; past that the call is refused with 429 and a message beginning \"too_many_pending_attachments\". Until finalized the attachment is pending — it cannot be attached to a message and is invisible in message output. A thread belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_attachment_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "threadId": {
                    "description": "Thread the file belongs to. An attachment is created against a thread first and claimed by one of its messages later, when that message is posted",
                    "type": "string",
                    "format": "uuid"
                  },
                  "fileName": {
                    "description": "Display name of the file, e.g. \"invoice.pdf\". Only the base name is used for the storage key; any directory part is discarded",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "contentType": {
                    "description": "MIME type of the file, which must be one of: image/jpeg, image/png, image/gif, image/webp, image/heic, video/mp4, video/webm, video/quicktime, application/pdf, text/plain, application/zip. Exact strings only — a parameter such as \"; charset=utf-8\" is refused. The upload URL is signed for exactly this type, so the PUT must send the same Content-Type header, and finalize refuses the file unless its first bytes really are this type",
                    "type": "string",
                    "enum": [
                      "image/jpeg",
                      "image/png",
                      "image/gif",
                      "image/webp",
                      "image/heic",
                      "video/mp4",
                      "video/webm",
                      "video/quicktime",
                      "application/pdf",
                      "text/plain",
                      "application/zip"
                    ]
                  },
                  "sizeBytes": {
                    "description": "Size of the file in bytes, at most 26214400. Declared up front so an oversized upload is refused before a URL is issued; finalize checks the real size again",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 26214400
                  }
                },
                "required": [
                  "threadId",
                  "fileName",
                  "contentType",
                  "sizeBytes"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "threadId",
                    "messageId",
                    "fileName",
                    "contentType",
                    "sizeBytes",
                    "status",
                    "createdAt",
                    "uploadedAt",
                    "rejectedReason",
                    "uploadUrl",
                    "uploadExpiresAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Attachment id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "description": "pending: the row exists and an upload URL was issued, but no bytes have been confirmed. uploaded: finalize saw the object in storage and its first bytes matched the declared type. rejected: they did not, the object was deleted, and this attachment is finished — the state is terminal. Only uploaded attachments can be attached to a message or downloaded",
                      "type": "string",
                      "enum": [
                        "pending",
                        "uploaded",
                        "rejected"
                      ]
                    },
                    "fileName": {
                      "description": "Display name of the file",
                      "type": "string"
                    },
                    "threadId": {
                      "description": "Thread this attachment belongs to",
                      "type": "string",
                      "format": "uuid"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "messageId": {
                      "description": "The message that carries this attachment, or null while nothing claims it yet",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sizeBytes": {
                      "description": "Size in bytes: what the caller declared while the attachment is pending, what storage reported once it is uploaded",
                      "type": "integer"
                    },
                    "uploadUrl": {
                      "description": "Short-lived signed URL. PUT the file bytes here with the same Content-Type, then call support_attachment_finalize. The URL is a bearer credential for this one object",
                      "type": "string"
                    },
                    "uploadedAt": {
                      "description": "ISO-8601 timestamp of the confirmed upload, or null while pending",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contentType": {
                      "description": "MIME type declared when the attachment was created",
                      "type": "string"
                    },
                    "rejectedReason": {
                      "description": "Why finalize refused the file — signature_mismatch, not_utf8, nul_byte or markup_in_text — or null in any state but rejected",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "uploadExpiresAt": {
                      "description": "ISO-8601 moment the upload URL stops working",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/attachments/finalize": {
      "post": {
        "operationId": "support_attachment_finalize",
        "summary": "Confirm that an upload landed.",
        "description": "Confirm that an upload landed. Storage is asked whether the object exists and how large it is; if it is not there the call is refused and the attachment stays pending. Its first 4 KiB are then read and checked against the content type the attachment was created with: if the bytes are something else — an svg uploaded as a png, html uploaded as text — the object is DELETED, the attachment becomes rejected, and the call answers 400 with a message beginning \"attachment_rejected\" and naming the reason. That state is terminal: calling finalize again returns the same 400, and the file must be created and uploaded afresh. On success the attachment becomes uploaded — it can now be named in support_message_create and carries a download URL served under the verified type. Calling it again on an uploaded attachment is safe and simply returns a fresh download URL",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_attachment_finalize",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "attachmentId": {
                    "description": "The attachment whose upload should be confirmed, as returned by the create call",
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "attachmentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "threadId",
                    "messageId",
                    "fileName",
                    "contentType",
                    "sizeBytes",
                    "status",
                    "createdAt",
                    "uploadedAt",
                    "rejectedReason",
                    "downloadUrl"
                  ],
                  "properties": {
                    "id": {
                      "description": "Attachment id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "description": "pending: the row exists and an upload URL was issued, but no bytes have been confirmed. uploaded: finalize saw the object in storage and its first bytes matched the declared type. rejected: they did not, the object was deleted, and this attachment is finished — the state is terminal. Only uploaded attachments can be attached to a message or downloaded",
                      "type": "string",
                      "enum": [
                        "pending",
                        "uploaded",
                        "rejected"
                      ]
                    },
                    "fileName": {
                      "description": "Display name of the file",
                      "type": "string"
                    },
                    "threadId": {
                      "description": "Thread this attachment belongs to",
                      "type": "string",
                      "format": "uuid"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "messageId": {
                      "description": "The message that carries this attachment, or null while nothing claims it yet",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "sizeBytes": {
                      "description": "Size in bytes: what the caller declared while the attachment is pending, what storage reported once it is uploaded",
                      "type": "integer"
                    },
                    "uploadedAt": {
                      "description": "ISO-8601 timestamp of the confirmed upload, or null while pending",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "contentType": {
                      "description": "MIME type declared when the attachment was created",
                      "type": "string"
                    },
                    "downloadUrl": {
                      "description": "Short-lived signed URL to read the uploaded file",
                      "type": "string"
                    },
                    "rejectedReason": {
                      "description": "Why finalize refused the file — signature_mismatch, not_utf8, nul_byte or markup_in_text — or null in any state but rejected",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/labels": {
      "get": {
        "operationId": "support_label_list",
        "summary": "List this product label dictionary by name.",
        "description": "List this product label dictionary by name. A product that has invented no tags yet gets an empty list — unlike statuses, there is nothing to seed",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_label_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "labels"
                  ],
                  "properties": {
                    "labels": {
                      "description": "The product label dictionary, by name",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "color",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Label id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "description": "Label name, unique within the product",
                            "type": "string"
                          },
                          "color": {
                            "description": "Display colour as a hex string, or null if uncoloured",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "support_label_create",
        "summary": "Add a label to this product label dictionary.",
        "description": "Add a label to this product label dictionary. A label is a free-form tag: nothing automates off it and a thread may carry any number of them. Names are unique per product",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_label_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Label name as the customer wants to see it. Unique within the product",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "color": {
                    "description": "Optional display colour as a six-digit hex string, e.g. #2563eb",
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "color",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Label id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "Label name, unique within the product",
                      "type": "string"
                    },
                    "color": {
                      "description": "Display colour as a hex string, or null if uncoloured",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/messages": {
      "get": {
        "operationId": "support_message_list",
        "summary": "List messages oldest first — the conversation reads forward.",
        "description": "List messages oldest first — the conversation reads forward. Name a threadId to read one thread, or omit it to read every thread of this product, which is how a client catches up on what it missed: pass since with the timestamp of the last message it has, then follow nextCursor until it comes back null. Paging is stable across messages that share a timestamp, so a walk neither skips nor repeats one. Filter by direction and by visibility; omit visibility to get public messages and internal notes together. A thread belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_message_list",
        "parameters": [
          {
            "name": "threadId",
            "in": "query",
            "required": false,
            "description": "Thread whose messages to list. Omit to list the messages of every thread of this product — the catch-up read",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Only messages in this direction",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "visibility",
            "in": "query",
            "required": false,
            "description": "Only messages with this visibility. Omit to get both public and internal",
            "schema": {
              "type": "string",
              "enum": [
                "public",
                "internal"
              ]
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO-8601 timestamp. Only messages created strictly after it — pass the createdAt of the last message you already have",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque position from a previous nextCursor. Resumes exactly where that page ended, with no gap and no repeat even when messages share a timestamp. Never construct one, and do not combine it with offset",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1..100 (default 50)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of messages to skip. The older pagination, kept for callers that already use it; prefer cursor, which cannot drift as messages arrive",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "messages",
                    "limit",
                    "offset",
                    "nextCursor"
                  ],
                  "properties": {
                    "limit": {
                      "description": "Page size that was applied",
                      "type": "integer"
                    },
                    "offset": {
                      "description": "Offset that was applied",
                      "type": "integer"
                    },
                    "messages": {
                      "description": "The requested page of messages, oldest first — the conversation reads forward",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "threadId",
                          "body",
                          "direction",
                          "authorExternalId",
                          "authorAgentId",
                          "visibility",
                          "createdAt",
                          "attachments"
                        ],
                        "properties": {
                          "id": {
                            "description": "Message id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "body": {
                            "description": "The message text, byte-identical to what was stored",
                            "type": "string"
                          },
                          "threadId": {
                            "description": "Thread this message belongs to",
                            "type": "string",
                            "format": "uuid"
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          },
                          "direction": {
                            "description": "inbound: written by the external end user. outbound: written by support, going out to them",
                            "type": "string",
                            "enum": [
                              "inbound",
                              "outbound"
                            ]
                          },
                          "visibility": {
                            "description": "public: part of the conversation the external end user sees. internal: a note between agents that never leaves the support contour",
                            "type": "string",
                            "enum": [
                              "public",
                              "internal"
                            ]
                          },
                          "attachments": {
                            "description": "Files this message carries, each with a freshly signed download URL. Empty when there are none. Attachments whose upload was never confirmed are never listed here",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "fileName",
                                "contentType",
                                "sizeBytes",
                                "downloadUrl",
                                "createdAt"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Attachment id",
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "fileName": {
                                  "description": "Display name of the file",
                                  "type": "string"
                                },
                                "createdAt": {
                                  "description": "ISO-8601 timestamp of when the attachment was created",
                                  "type": "string"
                                },
                                "sizeBytes": {
                                  "description": "Size in bytes as reported by storage",
                                  "type": "integer"
                                },
                                "contentType": {
                                  "description": "MIME type of the file",
                                  "type": "string"
                                },
                                "downloadUrl": {
                                  "description": "Short-lived signed URL to read the file. Re-read the message to get a fresh one",
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "authorAgentId": {
                            "description": "The agent author, or null when the external end user wrote the message",
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "authorExternalId": {
                            "description": "The external author, or null when an agent wrote the message",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "description": "Position to resume from: pass it back as cursor for the next page. Null when this page is the last one",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "support_message_create",
        "summary": "Post a message into a support thread.",
        "description": "Post a message into a support thread. A message has exactly one author: either an opaque external identifier from the client's own user base, or a support agent — never both and never neither. Direction, authorship and visibility are independent: an internal note may be inbound or outbound. Posting a message moves the parent thread's last reply timestamp. A message may carry files: create and finalize them first, then name them in attachmentIds. Through the public edge an agent author is accepted only if that agent carries no Lessly binding — a bot or the calling backend; an agent bound to a Lessly identity may author only from a signed-in session",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_message_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "threadId": {
                    "description": "Id of the thread this message belongs to",
                    "type": "string",
                    "format": "uuid"
                  },
                  "body": {
                    "description": "The message text, stored verbatim",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 50000
                  },
                  "direction": {
                    "description": "inbound: written by the external end user. outbound: written by support, going out to them",
                    "type": "string",
                    "enum": [
                      "inbound",
                      "outbound"
                    ]
                  },
                  "authorExternalId": {
                    "description": "Opaque identifier of the external end user in the client's own user base, stored verbatim. Set this exactly when the message comes from outside; leave authorAgentId empty",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "authorAgentId": {
                    "description": "The support agent of this product who wrote the message. Set this exactly when the message comes from inside the support contour; leave authorExternalId empty. An agent of another product is reported as not found",
                    "type": "string",
                    "format": "uuid"
                  },
                  "visibility": {
                    "description": "Defaults to public when omitted. Internal notes are never shown to the end user",
                    "type": "string",
                    "enum": [
                      "public",
                      "internal"
                    ]
                  },
                  "attachmentIds": {
                    "description": "Files this message carries, created with support_attachment_create and confirmed with support_attachment_finalize beforehand. Each must be an uploaded attachment of the same thread that no other message already carries; otherwise the whole message is refused. At most 10 per message",
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "threadId",
                  "body",
                  "direction"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "threadId",
                    "body",
                    "direction",
                    "authorExternalId",
                    "authorAgentId",
                    "visibility",
                    "createdAt",
                    "attachments"
                  ],
                  "properties": {
                    "id": {
                      "description": "Message id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "body": {
                      "description": "The message text, byte-identical to what was stored",
                      "type": "string"
                    },
                    "threadId": {
                      "description": "Thread this message belongs to",
                      "type": "string",
                      "format": "uuid"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "direction": {
                      "description": "inbound: written by the external end user. outbound: written by support, going out to them",
                      "type": "string",
                      "enum": [
                        "inbound",
                        "outbound"
                      ]
                    },
                    "visibility": {
                      "description": "public: part of the conversation the external end user sees. internal: a note between agents that never leaves the support contour",
                      "type": "string",
                      "enum": [
                        "public",
                        "internal"
                      ]
                    },
                    "attachments": {
                      "description": "Files this message carries, each with a freshly signed download URL. Empty when there are none. Attachments whose upload was never confirmed are never listed here",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "fileName",
                          "contentType",
                          "sizeBytes",
                          "downloadUrl",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Attachment id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "fileName": {
                            "description": "Display name of the file",
                            "type": "string"
                          },
                          "createdAt": {
                            "description": "ISO-8601 timestamp of when the attachment was created",
                            "type": "string"
                          },
                          "sizeBytes": {
                            "description": "Size in bytes as reported by storage",
                            "type": "integer"
                          },
                          "contentType": {
                            "description": "MIME type of the file",
                            "type": "string"
                          },
                          "downloadUrl": {
                            "description": "Short-lived signed URL to read the file. Re-read the message to get a fresh one",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "authorAgentId": {
                      "description": "The agent author, or null when the external end user wrote the message",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorExternalId": {
                      "description": "The external author, or null when an agent wrote the message",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/responses": {
      "get": {
        "operationId": "support_response_list",
        "summary": "List the responses of ONE survey, newest first — surveyId is required, because a page mixing two surveys would carry answers keyed by two different question sets.",
        "description": "List the responses of ONE survey, newest first — surveyId is required, because a page mixing two surveys would carry answers keyed by two different question sets. Filters: score range (scoreMin/scoreMax, inclusive — a response with no score matches neither bound), a creation window (from/to), completed, plus pagination",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_response_list",
        "parameters": [
          {
            "name": "surveyId",
            "in": "query",
            "required": true,
            "description": "Required: responses are always read one survey at a time",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "scoreMin",
            "in": "query",
            "required": false,
            "description": "Only responses scored at or above this value (inclusive). A response with no score matches neither bound — not even at the bottom of the scale",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "scoreMax",
            "in": "query",
            "required": false,
            "description": "Only responses scored at or below this value (inclusive). A response with no score matches neither bound — not even at the bottom of the scale",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Only responses created at or after this ISO-8601 timestamp",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Only responses created at or before this ISO-8601 timestamp",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "completed",
            "in": "query",
            "required": false,
            "description": "true: only responses that reached the end. false: only partial ones",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1..100 (default 25)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of responses to skip",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "responses",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "limit": {
                      "description": "Page size that was applied",
                      "type": "integer"
                    },
                    "offset": {
                      "description": "Offset that was applied",
                      "type": "integer"
                    },
                    "responses": {
                      "description": "The requested page of responses, newest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "surveyId",
                          "authorExternalId",
                          "answers",
                          "score",
                          "completed",
                          "metadata",
                          "escalatedThreadId",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Response id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "score": {
                            "description": "The answer of the first nps or rating question, raw and never rescaled, or null when neither was answered. Null is not zero — 0 is a real score at the bottom of an NPS scale",
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "answers": {
                            "description": "Answers keyed by question id, exactly as stored",
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "metadata": {
                            "description": "Free-form client-owned JSON",
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "surveyId": {
                            "description": "The survey that was answered",
                            "type": "string",
                            "format": "uuid"
                          },
                          "completed": {
                            "description": "Whether the respondent reached the end",
                            "type": "boolean"
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          },
                          "updatedAt": {
                            "description": "ISO-8601 last-modification timestamp",
                            "type": "string"
                          },
                          "authorExternalId": {
                            "description": "The respondent, byte-identical to what was stored",
                            "type": "string"
                          },
                          "escalatedThreadId": {
                            "description": "The feedback thread this response was escalated into, or null while it has not been",
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/responses/{id}": {
      "get": {
        "operationId": "support_response_get",
        "summary": "Get one survey response by id, with its answers exactly as they were submitted.",
        "description": "Get one survey response by id, with its answers exactly as they were submitted. A response belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_response_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Response id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "surveyId",
                    "authorExternalId",
                    "answers",
                    "score",
                    "completed",
                    "metadata",
                    "escalatedThreadId",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Response id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "score": {
                      "description": "The answer of the first nps or rating question, raw and never rescaled, or null when neither was answered. Null is not zero — 0 is a real score at the bottom of an NPS scale",
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "answers": {
                      "description": "Answers keyed by question id, exactly as stored",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "metadata": {
                      "description": "Free-form client-owned JSON",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "surveyId": {
                      "description": "The survey that was answered",
                      "type": "string",
                      "format": "uuid"
                    },
                    "completed": {
                      "description": "Whether the respondent reached the end",
                      "type": "boolean"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "authorExternalId": {
                      "description": "The respondent, byte-identical to what was stored",
                      "type": "string"
                    },
                    "escalatedThreadId": {
                      "description": "The feedback thread this response was escalated into, or null while it has not been",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/responses/{id}/escalate": {
      "post": {
        "operationId": "support_response_escalate",
        "summary": "Turn a survey response into a feedback thread so a person can follow up.",
        "description": "Turn a survey response into a feedback thread so a person can follow up. The thread opens on the product’s default open status, titled with the survey’s name, authored by the same external respondent, carrying the response metadata plus surveyResponseId, and rated with the response score when it fits 0..10. No message is written — the answers stay on the response, and neither the end user nor an agent typed anything. A response that was already escalated is refused with a conflict naming the thread it went to",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_response_escalate",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Response id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "response",
                    "thread"
                  ],
                  "properties": {
                    "thread": {
                      "description": "The feedback thread that was opened",
                      "type": "object",
                      "required": [
                        "id",
                        "type",
                        "title",
                        "statusId",
                        "status",
                        "priority",
                        "authorExternalId",
                        "authorDisplay",
                        "assignedAgentId",
                        "metadata",
                        "rating",
                        "labels",
                        "createdAt",
                        "updatedAt",
                        "lastReplyAt"
                      ],
                      "properties": {
                        "id": {
                          "description": "Thread id",
                          "type": "string",
                          "format": "uuid"
                        },
                        "type": {
                          "description": "ticket: the end user wants something fixed. feedback: unsolicited input",
                          "type": "string",
                          "enum": [
                            "ticket",
                            "feedback"
                          ]
                        },
                        "title": {
                          "description": "Thread subject",
                          "type": "string"
                        },
                        "labels": {
                          "description": "Every label on the thread, by name",
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "name",
                              "color",
                              "createdAt"
                            ],
                            "properties": {
                              "id": {
                                "description": "Label id",
                                "type": "string",
                                "format": "uuid"
                              },
                              "name": {
                                "description": "Label name, unique within the product",
                                "type": "string"
                              },
                              "color": {
                                "description": "Display colour as a hex string, or null if uncoloured",
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "createdAt": {
                                "description": "ISO-8601 creation timestamp",
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "rating": {
                          "description": "The score the client supplied at creation, or null while the thread is unrated",
                          "anyOf": [
                            {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 10
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "status": {
                          "description": "The status itself, joined in at read time",
                          "type": "object",
                          "required": [
                            "id",
                            "name",
                            "color",
                            "order",
                            "category",
                            "archived"
                          ],
                          "properties": {
                            "id": {
                              "description": "Status id",
                              "type": "string",
                              "format": "uuid"
                            },
                            "name": {
                              "description": "Status name, unique within the product",
                              "type": "string"
                            },
                            "color": {
                              "description": "Display colour as a hex string",
                              "type": "string"
                            },
                            "order": {
                              "description": "Sort order within the status dictionary",
                              "type": "integer"
                            },
                            "archived": {
                              "description": "Archived statuses stay readable but are not offered as targets",
                              "type": "boolean"
                            },
                            "category": {
                              "description": "Lifecycle bucket the status belongs to",
                              "type": "string",
                              "enum": [
                                "open",
                                "pending",
                                "resolved",
                                "closed"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "metadata": {
                          "description": "Free-form client-owned JSON",
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "priority": {
                          "description": "Thread priority",
                          "type": "string",
                          "enum": [
                            "low",
                            "normal",
                            "high",
                            "urgent"
                          ]
                        },
                        "statusId": {
                          "description": "Id of the status the thread sits on",
                          "type": "string",
                          "format": "uuid"
                        },
                        "createdAt": {
                          "description": "ISO-8601 creation timestamp",
                          "type": "string"
                        },
                        "updatedAt": {
                          "description": "ISO-8601 last-modification timestamp",
                          "type": "string"
                        },
                        "lastReplyAt": {
                          "description": "ISO-8601 timestamp of the last reply, or null while there are none",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "authorDisplay": {
                          "description": "Display name for the external author, if given",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "assignedAgentId": {
                          "description": "Assigned agent, or null while unassigned",
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "authorExternalId": {
                          "description": "The external author, byte-identical to what was stored",
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "response": {
                      "description": "The response, with escalatedThreadId now set",
                      "type": "object",
                      "required": [
                        "id",
                        "surveyId",
                        "authorExternalId",
                        "answers",
                        "score",
                        "completed",
                        "metadata",
                        "escalatedThreadId",
                        "createdAt",
                        "updatedAt"
                      ],
                      "properties": {
                        "id": {
                          "description": "Response id",
                          "type": "string",
                          "format": "uuid"
                        },
                        "score": {
                          "description": "The answer of the first nps or rating question, raw and never rescaled, or null when neither was answered. Null is not zero — 0 is a real score at the bottom of an NPS scale",
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "answers": {
                          "description": "Answers keyed by question id, exactly as stored",
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "metadata": {
                          "description": "Free-form client-owned JSON",
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "surveyId": {
                          "description": "The survey that was answered",
                          "type": "string",
                          "format": "uuid"
                        },
                        "completed": {
                          "description": "Whether the respondent reached the end",
                          "type": "boolean"
                        },
                        "createdAt": {
                          "description": "ISO-8601 creation timestamp",
                          "type": "string"
                        },
                        "updatedAt": {
                          "description": "ISO-8601 last-modification timestamp",
                          "type": "string"
                        },
                        "authorExternalId": {
                          "description": "The respondent, byte-identical to what was stored",
                          "type": "string"
                        },
                        "escalatedThreadId": {
                          "description": "The feedback thread this response was escalated into, or null while it has not been",
                          "anyOf": [
                            {
                              "type": "string",
                              "format": "uuid"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/rules": {
      "get": {
        "operationId": "support_rule_list",
        "summary": "List this product’s delivery rules, newest first, optionally narrowed to one survey, to the live or switched-off ones, or to the rules that apply to a given page URL and device.",
        "description": "List this product’s delivery rules, newest first, optionally narrowed to one survey, to the live or switched-off ones, or to the rules that apply to a given page URL and device. This is the same answer a client’s runtime fetches through the public edge, where a URL is required and only live rules on published surveys are visible",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_rule_list",
        "parameters": [
          {
            "name": "surveyId",
            "in": "query",
            "required": false,
            "description": "Only rules delivering this survey",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "enabled",
            "in": "query",
            "required": false,
            "description": "true: only live rules. false: only switched-off ones",
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "string",
                  "enum": [
                    "true",
                    "false"
                  ]
                }
              ]
            }
          },
          {
            "name": "url",
            "in": "query",
            "required": false,
            "description": "Only rules whose URL match applies to this page URL",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048
            }
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "description": "The device the page is rendered on. Without it only rules targeting any device match",
            "schema": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1..100 (default 25)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of rules to skip",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "rules",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "limit": {
                      "description": "Page size that was applied",
                      "type": "integer"
                    },
                    "rules": {
                      "description": "The requested page of rules, newest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "surveyId",
                          "enabled",
                          "urlMatch",
                          "device",
                          "trigger",
                          "frequency",
                          "attributeConditions",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Rule id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "device": {
                            "description": "Which devices the rule applies to. any is the rule that does not care and is the default",
                            "type": "string",
                            "enum": [
                              "any",
                              "desktop",
                              "mobile"
                            ]
                          },
                          "enabled": {
                            "description": "Whether the rule is live",
                            "type": "boolean"
                          },
                          "trigger": {
                            "type": "object",
                            "required": [
                              "kind"
                            ],
                            "properties": {
                              "kind": {
                                "description": "Which kind of trigger this is",
                                "type": "string",
                                "enum": [
                                  "immediate",
                                  "delay",
                                  "event"
                                ]
                              },
                              "name": {
                                "description": "The client’s own event name, on an event trigger",
                                "type": "string"
                              },
                              "seconds": {
                                "description": "Delay in seconds, on a delay trigger",
                                "type": "integer"
                              }
                            },
                            "additionalProperties": false
                          },
                          "surveyId": {
                            "description": "The survey this rule delivers",
                            "type": "string",
                            "format": "uuid"
                          },
                          "urlMatch": {
                            "description": "Which pages match",
                            "type": "object",
                            "required": [
                              "kind",
                              "value"
                            ],
                            "properties": {
                              "kind": {
                                "description": "exact: the whole URL, character for character. prefix: the URL starts with the value. contains: the value appears anywhere in the URL. regex: a JavaScript regular expression, applied unanchored — write ^ yourself if you mean the start",
                                "type": "string",
                                "enum": [
                                  "exact",
                                  "prefix",
                                  "contains",
                                  "regex"
                                ]
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          },
                          "frequency": {
                            "type": "object",
                            "required": [
                              "kind"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "once",
                                  "until_answered",
                                  "always"
                                ]
                              },
                              "cooldownDays": {
                                "description": "Days between showings, when set",
                                "type": "integer"
                              }
                            },
                            "additionalProperties": false
                          },
                          "updatedAt": {
                            "description": "ISO-8601 last-modification timestamp",
                            "type": "string"
                          },
                          "attributeConditions": {
                            "description": "Conditions on the visitor’s attributes, ALL of which must hold",
                            "type": "array",
                            "maxItems": 20,
                            "items": {
                              "type": "object",
                              "required": [
                                "key",
                                "op"
                              ],
                              "properties": {
                                "op": {
                                  "description": "eq / neq: equal or not equal to value. contains: value appears in the attribute. exists: the attribute is present at all",
                                  "type": "string",
                                  "enum": [
                                    "eq",
                                    "neq",
                                    "contains",
                                    "exists"
                                  ]
                                },
                                "key": {
                                  "description": "The attribute name, in the client’s own vocabulary",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 128
                                },
                                "value": {
                                  "description": "What to compare against. Required except on exists, where it is refused",
                                  "type": "string",
                                  "maxLength": 512
                                }
                              },
                              "additionalProperties": false
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "offset": {
                      "description": "Offset that was applied",
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "support_rule_create",
        "summary": "Write a delivery rule: where a survey should be shown (a URL match), on which devices, when (immediately, after a delay, or on the client’s own event) and how often.",
        "description": "Write a delivery rule: where a survey should be shown (a URL match), on which devices, when (immediately, after a delay, or on the client’s own event) and how often. Nothing here runs on this side — the rule is configuration a client’s own runtime reads back through the public edge and acts on. A rule reaches that edge only while its survey is published, so a rule may be written against a draft and simply waits",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_rule_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "surveyId": {
                    "description": "The survey this rule delivers. It must belong to this product",
                    "type": "string",
                    "format": "uuid"
                  },
                  "urlMatch": {
                    "description": "Which pages this rule applies to",
                    "type": "object",
                    "required": [
                      "kind",
                      "value"
                    ],
                    "properties": {
                      "kind": {
                        "description": "exact: the whole URL, character for character. prefix: the URL starts with the value. contains: the value appears anywhere in the URL. regex: a JavaScript regular expression, applied unanchored — write ^ yourself if you mean the start",
                        "type": "string",
                        "enum": [
                          "exact",
                          "prefix",
                          "contains",
                          "regex"
                        ]
                      },
                      "value": {
                        "description": "What the URL is compared against, read according to kind",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "additionalProperties": false
                  },
                  "trigger": {
                    "description": "When to show the survey once the page matches",
                    "anyOf": [
                      {
                        "description": "Show it as soon as the page matches",
                        "type": "object",
                        "required": [
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "immediate"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "seconds"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "delay"
                          },
                          "seconds": {
                            "description": "How long to wait after the page matched, in seconds (at most a day)",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 86400
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "name"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "event"
                          },
                          "name": {
                            "description": "An event in the client’s own runtime. This toolkit never sees it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "frequency": {
                    "description": "How often the same person may see this survey",
                    "type": "object",
                    "required": [
                      "kind"
                    ],
                    "properties": {
                      "kind": {
                        "description": "once: show it a single time, ever. until_answered: keep showing it until they respond. always: show it every time the rule matches",
                        "type": "string",
                        "enum": [
                          "once",
                          "until_answered",
                          "always"
                        ]
                      },
                      "cooldownDays": {
                        "description": "Days to wait before showing it again. Not valid on once",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 365
                      }
                    },
                    "additionalProperties": false
                  },
                  "device": {
                    "description": "Which devices this rule applies to (default any)",
                    "type": "string",
                    "enum": [
                      "any",
                      "desktop",
                      "mobile"
                    ]
                  },
                  "enabled": {
                    "description": "Whether the rule is live. A rule is created enabled unless this says otherwise",
                    "type": "boolean"
                  },
                  "attributeConditions": {
                    "description": "Conditions on the visitor’s attributes. Omit for a rule that applies to everyone",
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "required": [
                        "key",
                        "op"
                      ],
                      "properties": {
                        "op": {
                          "description": "eq / neq: equal or not equal to value. contains: value appears in the attribute. exists: the attribute is present at all",
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "contains",
                            "exists"
                          ]
                        },
                        "key": {
                          "description": "The attribute name, in the client’s own vocabulary",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "value": {
                          "description": "What to compare against. Required except on exists, where it is refused",
                          "type": "string",
                          "maxLength": 512
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "surveyId",
                  "urlMatch",
                  "trigger",
                  "frequency"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "surveyId",
                    "enabled",
                    "urlMatch",
                    "device",
                    "trigger",
                    "frequency",
                    "attributeConditions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Rule id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "device": {
                      "description": "Which devices the rule applies to. any is the rule that does not care and is the default",
                      "type": "string",
                      "enum": [
                        "any",
                        "desktop",
                        "mobile"
                      ]
                    },
                    "enabled": {
                      "description": "Whether the rule is live",
                      "type": "boolean"
                    },
                    "trigger": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "description": "Which kind of trigger this is",
                          "type": "string",
                          "enum": [
                            "immediate",
                            "delay",
                            "event"
                          ]
                        },
                        "name": {
                          "description": "The client’s own event name, on an event trigger",
                          "type": "string"
                        },
                        "seconds": {
                          "description": "Delay in seconds, on a delay trigger",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "surveyId": {
                      "description": "The survey this rule delivers",
                      "type": "string",
                      "format": "uuid"
                    },
                    "urlMatch": {
                      "description": "Which pages match",
                      "type": "object",
                      "required": [
                        "kind",
                        "value"
                      ],
                      "properties": {
                        "kind": {
                          "description": "exact: the whole URL, character for character. prefix: the URL starts with the value. contains: the value appears anywhere in the URL. regex: a JavaScript regular expression, applied unanchored — write ^ yourself if you mean the start",
                          "type": "string",
                          "enum": [
                            "exact",
                            "prefix",
                            "contains",
                            "regex"
                          ]
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "frequency": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "once",
                            "until_answered",
                            "always"
                          ]
                        },
                        "cooldownDays": {
                          "description": "Days between showings, when set",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "attributeConditions": {
                      "description": "Conditions on the visitor’s attributes, ALL of which must hold",
                      "type": "array",
                      "maxItems": 20,
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "op"
                        ],
                        "properties": {
                          "op": {
                            "description": "eq / neq: equal or not equal to value. contains: value appears in the attribute. exists: the attribute is present at all",
                            "type": "string",
                            "enum": [
                              "eq",
                              "neq",
                              "contains",
                              "exists"
                            ]
                          },
                          "key": {
                            "description": "The attribute name, in the client’s own vocabulary",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "value": {
                            "description": "What to compare against. Required except on exists, where it is refused",
                            "type": "string",
                            "maxLength": 512
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/rules/{id}": {
      "delete": {
        "operationId": "support_rule_delete",
        "summary": "Delete a delivery rule for good.",
        "description": "Delete a delivery rule for good. Unlike a survey, a rule is not archived — it has no responses behind it and nothing outlives it, so the row is removed and cannot be recovered. The survey it targeted is untouched. To stop delivery reversibly, set enabled to false instead",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_rule_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rule id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "description": "Id of the rule that was deleted",
                      "type": "string",
                      "format": "uuid"
                    },
                    "deleted": {
                      "description": "Always true — the rule is gone",
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "support_rule_get",
        "summary": "Get one delivery rule by id, with its whole configuration.",
        "description": "Get one delivery rule by id, with its whole configuration. A rule belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_rule_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rule id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "surveyId",
                    "enabled",
                    "urlMatch",
                    "device",
                    "trigger",
                    "frequency",
                    "attributeConditions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Rule id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "device": {
                      "description": "Which devices the rule applies to. any is the rule that does not care and is the default",
                      "type": "string",
                      "enum": [
                        "any",
                        "desktop",
                        "mobile"
                      ]
                    },
                    "enabled": {
                      "description": "Whether the rule is live",
                      "type": "boolean"
                    },
                    "trigger": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "description": "Which kind of trigger this is",
                          "type": "string",
                          "enum": [
                            "immediate",
                            "delay",
                            "event"
                          ]
                        },
                        "name": {
                          "description": "The client’s own event name, on an event trigger",
                          "type": "string"
                        },
                        "seconds": {
                          "description": "Delay in seconds, on a delay trigger",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "surveyId": {
                      "description": "The survey this rule delivers",
                      "type": "string",
                      "format": "uuid"
                    },
                    "urlMatch": {
                      "description": "Which pages match",
                      "type": "object",
                      "required": [
                        "kind",
                        "value"
                      ],
                      "properties": {
                        "kind": {
                          "description": "exact: the whole URL, character for character. prefix: the URL starts with the value. contains: the value appears anywhere in the URL. regex: a JavaScript regular expression, applied unanchored — write ^ yourself if you mean the start",
                          "type": "string",
                          "enum": [
                            "exact",
                            "prefix",
                            "contains",
                            "regex"
                          ]
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "frequency": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "once",
                            "until_answered",
                            "always"
                          ]
                        },
                        "cooldownDays": {
                          "description": "Days between showings, when set",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "attributeConditions": {
                      "description": "Conditions on the visitor’s attributes, ALL of which must hold",
                      "type": "array",
                      "maxItems": 20,
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "op"
                        ],
                        "properties": {
                          "op": {
                            "description": "eq / neq: equal or not equal to value. contains: value appears in the attribute. exists: the attribute is present at all",
                            "type": "string",
                            "enum": [
                              "eq",
                              "neq",
                              "contains",
                              "exists"
                            ]
                          },
                          "key": {
                            "description": "The attribute name, in the client’s own vocabulary",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "value": {
                            "description": "What to compare against. Required except on exists, where it is refused",
                            "type": "string",
                            "maxLength": 512
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "support_rule_update",
        "summary": "Edit a delivery rule: its URL match, device, trigger, frequency, conditions, or whether it is live at all.",
        "description": "Edit a delivery rule: its URL match, device, trigger, frequency, conditions, or whether it is live at all. Every value replaces the old one whole rather than merging into it. The survey is not editable — a rule is the targeting OF one survey, and retargeting it silently would change what every matching page shows; delete it and write the one you meant. Switching a rule off is the quiet way to stop delivering without touching the survey",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_rule_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Rule id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "urlMatch": {
                    "description": "The new URL match, replacing the old one",
                    "type": "object",
                    "required": [
                      "kind",
                      "value"
                    ],
                    "properties": {
                      "kind": {
                        "description": "exact: the whole URL, character for character. prefix: the URL starts with the value. contains: the value appears anywhere in the URL. regex: a JavaScript regular expression, applied unanchored — write ^ yourself if you mean the start",
                        "type": "string",
                        "enum": [
                          "exact",
                          "prefix",
                          "contains",
                          "regex"
                        ]
                      },
                      "value": {
                        "description": "What the URL is compared against, read according to kind",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 512
                      }
                    },
                    "additionalProperties": false
                  },
                  "trigger": {
                    "description": "The new trigger, replacing the old one",
                    "anyOf": [
                      {
                        "description": "Show it as soon as the page matches",
                        "type": "object",
                        "required": [
                          "kind"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "immediate"
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "seconds"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "delay"
                          },
                          "seconds": {
                            "description": "How long to wait after the page matched, in seconds (at most a day)",
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 86400
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "required": [
                          "kind",
                          "name"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "event"
                          },
                          "name": {
                            "description": "An event in the client’s own runtime. This toolkit never sees it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          }
                        },
                        "additionalProperties": false
                      }
                    ]
                  },
                  "frequency": {
                    "description": "The new frequency, replacing the old one",
                    "type": "object",
                    "required": [
                      "kind"
                    ],
                    "properties": {
                      "kind": {
                        "description": "once: show it a single time, ever. until_answered: keep showing it until they respond. always: show it every time the rule matches",
                        "type": "string",
                        "enum": [
                          "once",
                          "until_answered",
                          "always"
                        ]
                      },
                      "cooldownDays": {
                        "description": "Days to wait before showing it again. Not valid on once",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 365
                      }
                    },
                    "additionalProperties": false
                  },
                  "device": {
                    "description": "The new device targeting",
                    "type": "string",
                    "enum": [
                      "any",
                      "desktop",
                      "mobile"
                    ]
                  },
                  "enabled": {
                    "description": "Turn the rule on or off",
                    "type": "boolean"
                  },
                  "attributeConditions": {
                    "description": "The complete new condition set, replacing the old one. Pass [] to clear it",
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "required": [
                        "key",
                        "op"
                      ],
                      "properties": {
                        "op": {
                          "description": "eq / neq: equal or not equal to value. contains: value appears in the attribute. exists: the attribute is present at all",
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "contains",
                            "exists"
                          ]
                        },
                        "key": {
                          "description": "The attribute name, in the client’s own vocabulary",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 128
                        },
                        "value": {
                          "description": "What to compare against. Required except on exists, where it is refused",
                          "type": "string",
                          "maxLength": 512
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "surveyId",
                    "enabled",
                    "urlMatch",
                    "device",
                    "trigger",
                    "frequency",
                    "attributeConditions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Rule id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "device": {
                      "description": "Which devices the rule applies to. any is the rule that does not care and is the default",
                      "type": "string",
                      "enum": [
                        "any",
                        "desktop",
                        "mobile"
                      ]
                    },
                    "enabled": {
                      "description": "Whether the rule is live",
                      "type": "boolean"
                    },
                    "trigger": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "description": "Which kind of trigger this is",
                          "type": "string",
                          "enum": [
                            "immediate",
                            "delay",
                            "event"
                          ]
                        },
                        "name": {
                          "description": "The client’s own event name, on an event trigger",
                          "type": "string"
                        },
                        "seconds": {
                          "description": "Delay in seconds, on a delay trigger",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "surveyId": {
                      "description": "The survey this rule delivers",
                      "type": "string",
                      "format": "uuid"
                    },
                    "urlMatch": {
                      "description": "Which pages match",
                      "type": "object",
                      "required": [
                        "kind",
                        "value"
                      ],
                      "properties": {
                        "kind": {
                          "description": "exact: the whole URL, character for character. prefix: the URL starts with the value. contains: the value appears anywhere in the URL. regex: a JavaScript regular expression, applied unanchored — write ^ yourself if you mean the start",
                          "type": "string",
                          "enum": [
                            "exact",
                            "prefix",
                            "contains",
                            "regex"
                          ]
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "frequency": {
                      "type": "object",
                      "required": [
                        "kind"
                      ],
                      "properties": {
                        "kind": {
                          "type": "string",
                          "enum": [
                            "once",
                            "until_answered",
                            "always"
                          ]
                        },
                        "cooldownDays": {
                          "description": "Days between showings, when set",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "attributeConditions": {
                      "description": "Conditions on the visitor’s attributes, ALL of which must hold",
                      "type": "array",
                      "maxItems": 20,
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "op"
                        ],
                        "properties": {
                          "op": {
                            "description": "eq / neq: equal or not equal to value. contains: value appears in the attribute. exists: the attribute is present at all",
                            "type": "string",
                            "enum": [
                              "eq",
                              "neq",
                              "contains",
                              "exists"
                            ]
                          },
                          "key": {
                            "description": "The attribute name, in the client’s own vocabulary",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 128
                          },
                          "value": {
                            "description": "What to compare against. Required except on exists, where it is refused",
                            "type": "string",
                            "maxLength": 512
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/statuses": {
      "get": {
        "operationId": "support_status_list",
        "summary": "List this product status dictionary in display order.",
        "description": "List this product status dictionary in display order. A product that never opened settings gets the four defaults seeded on the first call. Archived statuses are hidden unless asked for",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_status_list",
        "parameters": [
          {
            "name": "includeArchived",
            "in": "query",
            "required": false,
            "description": "Also return archived statuses (default false)",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "statuses"
                  ],
                  "properties": {
                    "statuses": {
                      "description": "The product status dictionary, in display order",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "color",
                          "order",
                          "category",
                          "archived"
                        ],
                        "properties": {
                          "id": {
                            "description": "Status id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "description": "Status name, unique within the product",
                            "type": "string"
                          },
                          "color": {
                            "description": "Display colour as a hex string",
                            "type": "string"
                          },
                          "order": {
                            "description": "Sort order within the status dictionary",
                            "type": "integer"
                          },
                          "archived": {
                            "description": "Archived statuses stay readable but are not offered as targets",
                            "type": "boolean"
                          },
                          "category": {
                            "description": "Lifecycle bucket the status belongs to",
                            "type": "string",
                            "enum": [
                              "open",
                              "pending",
                              "resolved",
                              "closed"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "support_status_create",
        "summary": "Add a status to this product status dictionary.",
        "description": "Add a status to this product status dictionary. The name is what people see; the category is what automation and reporting read, and it cannot change once threads sit on the status",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_status_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Status name as the customer wants to see it. Unique within the product",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "color": {
                    "description": "Display colour as a six-digit hex string, e.g. #2563eb",
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "order": {
                    "description": "Sort order within the status dictionary, lowest first",
                    "type": "integer",
                    "minimum": 0
                  },
                  "category": {
                    "description": "Lifecycle bucket the status belongs to. Automation and reporting read the category, never the name — so it cannot be changed once threads sit on the status",
                    "type": "string",
                    "enum": [
                      "open",
                      "pending",
                      "resolved",
                      "closed"
                    ]
                  }
                },
                "required": [
                  "name",
                  "color",
                  "order",
                  "category"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "color",
                    "order",
                    "category",
                    "archived"
                  ],
                  "properties": {
                    "id": {
                      "description": "Status id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "Status name, unique within the product",
                      "type": "string"
                    },
                    "color": {
                      "description": "Display colour as a hex string",
                      "type": "string"
                    },
                    "order": {
                      "description": "Sort order within the status dictionary",
                      "type": "integer"
                    },
                    "archived": {
                      "description": "Archived statuses stay readable but are not offered as targets",
                      "type": "boolean"
                    },
                    "category": {
                      "description": "Lifecycle bucket the status belongs to",
                      "type": "string",
                      "enum": [
                        "open",
                        "pending",
                        "resolved",
                        "closed"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/statuses/{id}": {
      "patch": {
        "operationId": "support_status_update",
        "summary": "Rename, recolour or reorder a status.",
        "description": "Rename, recolour or reorder a status. The category may only change while no thread references the status: changing it later would rewrite the history of every metric derived from it. A status belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_status_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Status id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "Status name as the customer wants to see it. Unique within the product",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "color": {
                    "description": "Display colour as a six-digit hex string, e.g. #2563eb",
                    "type": "string",
                    "pattern": "^#[0-9a-fA-F]{6}$"
                  },
                  "order": {
                    "description": "Sort order within the status dictionary, lowest first",
                    "type": "integer",
                    "minimum": 0
                  },
                  "category": {
                    "description": "New lifecycle bucket. Refused while any thread references the status",
                    "type": "string",
                    "enum": [
                      "open",
                      "pending",
                      "resolved",
                      "closed"
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "color",
                    "order",
                    "category",
                    "archived"
                  ],
                  "properties": {
                    "id": {
                      "description": "Status id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "Status name, unique within the product",
                      "type": "string"
                    },
                    "color": {
                      "description": "Display colour as a hex string",
                      "type": "string"
                    },
                    "order": {
                      "description": "Sort order within the status dictionary",
                      "type": "integer"
                    },
                    "archived": {
                      "description": "Archived statuses stay readable but are not offered as targets",
                      "type": "boolean"
                    },
                    "category": {
                      "description": "Lifecycle bucket the status belongs to",
                      "type": "string",
                      "enum": [
                        "open",
                        "pending",
                        "resolved",
                        "closed"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/statuses/{id}/archive": {
      "post": {
        "operationId": "support_status_archive",
        "summary": "Retire a status.",
        "description": "Retire a status. There is no way to delete one: every thread on it moves to the target status in the same transaction, so no thread is ever left on an archived status. The target must be a different, live status of this product",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_status_archive",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Status id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "targetStatusId": {
                    "description": "Live status every thread on the archived status moves to, in the same transaction",
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "targetStatusId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "color",
                    "order",
                    "category",
                    "archived"
                  ],
                  "properties": {
                    "id": {
                      "description": "Status id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "Status name, unique within the product",
                      "type": "string"
                    },
                    "color": {
                      "description": "Display colour as a hex string",
                      "type": "string"
                    },
                    "order": {
                      "description": "Sort order within the status dictionary",
                      "type": "integer"
                    },
                    "archived": {
                      "description": "Archived statuses stay readable but are not offered as targets",
                      "type": "boolean"
                    },
                    "category": {
                      "description": "Lifecycle bucket the status belongs to",
                      "type": "string",
                      "enum": [
                        "open",
                        "pending",
                        "resolved",
                        "closed"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/surveys": {
      "get": {
        "operationId": "support_survey_list",
        "summary": "List this product’s surveys, newest first, optionally narrowed to one lifecycle state (draft, published or archived), with pagination",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_survey_list",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only surveys in this lifecycle state",
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "published",
                "archived"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1..100 (default 25)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of surveys to skip",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "surveys",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "limit": {
                      "description": "Page size that was applied",
                      "type": "integer"
                    },
                    "offset": {
                      "description": "Offset that was applied",
                      "type": "integer"
                    },
                    "surveys": {
                      "description": "The requested page of surveys, newest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "status",
                          "questions",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Survey id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "description": "What this survey is called",
                            "type": "string"
                          },
                          "status": {
                            "description": "draft: editable, not answerable. published: answerable, frozen. archived: terminal, neither editable nor answerable, and there is no way back",
                            "type": "string",
                            "enum": [
                              "draft",
                              "published",
                              "archived"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          },
                          "questions": {
                            "description": "The ordered question set, exactly as stored",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "type",
                                "label"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                "skip": {
                                  "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                                  "type": "object",
                                  "additionalProperties": {
                                    "type": "string",
                                    "minLength": 1
                                  }
                                },
                                "type": {
                                  "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                                  "type": "string",
                                  "enum": [
                                    "reaction",
                                    "text",
                                    "radio",
                                    "checkbox",
                                    "rating",
                                    "nps",
                                    "statement"
                                  ]
                                },
                                "label": {
                                  "description": "The question as the respondent reads it",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 1000
                                },
                                "scale": {
                                  "description": "The rating scale. rating only — nps is fixed 0..10",
                                  "type": "object",
                                  "required": [
                                    "min",
                                    "max"
                                  ],
                                  "properties": {
                                    "max": {
                                      "description": "Top of the scale, at most 10",
                                      "type": "integer",
                                      "minimum": 2,
                                      "maximum": 10
                                    },
                                    "min": {
                                      "description": "Bottom of the scale: 0 or 1",
                                      "type": "number",
                                      "enum": [
                                        0,
                                        1
                                      ]
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "options": {
                                  "description": "The choices. radio and checkbox only",
                                  "type": "array",
                                  "minItems": 1,
                                  "maxItems": 50,
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "id",
                                      "label"
                                    ],
                                    "properties": {
                                      "id": {
                                        "description": "Client-owned id of the option, unique within the question",
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 64
                                      },
                                      "label": {
                                        "description": "What the respondent reads",
                                        "type": "string",
                                        "minLength": 1,
                                        "maxLength": 500
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "required": {
                                  "description": "When true, a response marked completed must answer it. Never valid on a statement",
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "updatedAt": {
                            "description": "ISO-8601 last-modification timestamp",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "support_survey_create",
        "summary": "Open a new survey.",
        "description": "Open a new survey. It starts as a draft — editable and not yet answerable — whatever questions travel with it. There is no way to create one already published: publishing runs the structure validator, and a create that skipped it would be a second way in",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_survey_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "What this survey is called. It becomes the title of an escalated feedback thread",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "questions": {
                    "description": "The initial question set. Omit it to open an empty draft and fill it in later",
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "type",
                        "label"
                      ],
                      "properties": {
                        "id": {
                          "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "skip": {
                          "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                          "type": "object",
                          "additionalProperties": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "type": {
                          "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                          "type": "string",
                          "enum": [
                            "reaction",
                            "text",
                            "radio",
                            "checkbox",
                            "rating",
                            "nps",
                            "statement"
                          ]
                        },
                        "label": {
                          "description": "The question as the respondent reads it",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1000
                        },
                        "scale": {
                          "description": "The rating scale. rating only — nps is fixed 0..10",
                          "type": "object",
                          "required": [
                            "min",
                            "max"
                          ],
                          "properties": {
                            "max": {
                              "description": "Top of the scale, at most 10",
                              "type": "integer",
                              "minimum": 2,
                              "maximum": 10
                            },
                            "min": {
                              "description": "Bottom of the scale: 0 or 1",
                              "type": "number",
                              "enum": [
                                0,
                                1
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "options": {
                          "description": "The choices. radio and checkbox only",
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 50,
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "label"
                            ],
                            "properties": {
                              "id": {
                                "description": "Client-owned id of the option, unique within the question",
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 64
                              },
                              "label": {
                                "description": "What the respondent reads",
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 500
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": {
                          "description": "When true, a response marked completed must answer it. Never valid on a statement",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "status",
                    "questions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Survey id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "What this survey is called",
                      "type": "string"
                    },
                    "status": {
                      "description": "draft: editable, not answerable. published: answerable, frozen. archived: terminal, neither editable nor answerable, and there is no way back",
                      "type": "string",
                      "enum": [
                        "draft",
                        "published",
                        "archived"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "questions": {
                      "description": "The ordered question set, exactly as stored",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "label"
                        ],
                        "properties": {
                          "id": {
                            "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "skip": {
                            "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "type": {
                            "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                            "type": "string",
                            "enum": [
                              "reaction",
                              "text",
                              "radio",
                              "checkbox",
                              "rating",
                              "nps",
                              "statement"
                            ]
                          },
                          "label": {
                            "description": "The question as the respondent reads it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 1000
                          },
                          "scale": {
                            "description": "The rating scale. rating only — nps is fixed 0..10",
                            "type": "object",
                            "required": [
                              "min",
                              "max"
                            ],
                            "properties": {
                              "max": {
                                "description": "Top of the scale, at most 10",
                                "type": "integer",
                                "minimum": 2,
                                "maximum": 10
                              },
                              "min": {
                                "description": "Bottom of the scale: 0 or 1",
                                "type": "number",
                                "enum": [
                                  0,
                                  1
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "options": {
                            "description": "The choices. radio and checkbox only",
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 50,
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "label"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Client-owned id of the option, unique within the question",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                "label": {
                                  "description": "What the respondent reads",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 500
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": {
                            "description": "When true, a response marked completed must answer it. Never valid on a statement",
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/surveys/{id}": {
      "get": {
        "operationId": "support_survey_get",
        "summary": "Get one survey by id, with its whole question set.",
        "description": "Get one survey by id, with its whole question set. A survey belonging to another product is reported as not found. Through the public edge only a PUBLISHED survey is readable — a draft or an archived one is reported as not found there",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_survey_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Survey id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "status",
                    "questions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Survey id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "What this survey is called",
                      "type": "string"
                    },
                    "status": {
                      "description": "draft: editable, not answerable. published: answerable, frozen. archived: terminal, neither editable nor answerable, and there is no way back",
                      "type": "string",
                      "enum": [
                        "draft",
                        "published",
                        "archived"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "questions": {
                      "description": "The ordered question set, exactly as stored",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "label"
                        ],
                        "properties": {
                          "id": {
                            "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "skip": {
                            "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "type": {
                            "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                            "type": "string",
                            "enum": [
                              "reaction",
                              "text",
                              "radio",
                              "checkbox",
                              "rating",
                              "nps",
                              "statement"
                            ]
                          },
                          "label": {
                            "description": "The question as the respondent reads it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 1000
                          },
                          "scale": {
                            "description": "The rating scale. rating only — nps is fixed 0..10",
                            "type": "object",
                            "required": [
                              "min",
                              "max"
                            ],
                            "properties": {
                              "max": {
                                "description": "Top of the scale, at most 10",
                                "type": "integer",
                                "minimum": 2,
                                "maximum": 10
                              },
                              "min": {
                                "description": "Bottom of the scale: 0 or 1",
                                "type": "number",
                                "enum": [
                                  0,
                                  1
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "options": {
                            "description": "The choices. radio and checkbox only",
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 50,
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "label"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Client-owned id of the option, unique within the question",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                "label": {
                                  "description": "What the respondent reads",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 500
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": {
                            "description": "When true, a response marked completed must answer it. Never valid on a statement",
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "support_survey_update",
        "summary": "Edit a survey’s name or question set.",
        "description": "Edit a survey’s name or question set. Only a draft is editable — publishing freezes the structure, because answers are keyed by question id and rewriting the questions under them would change what every collected response was answering. To edit a live survey, unpublish it first. questions replaces the whole set; pass an empty array to clear it",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_survey_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Survey id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "New name",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "questions": {
                    "description": "The complete new question set, replacing the old one. Pass [] to empty the draft",
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "required": [
                        "id",
                        "type",
                        "label"
                      ],
                      "properties": {
                        "id": {
                          "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64
                        },
                        "skip": {
                          "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                          "type": "object",
                          "additionalProperties": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "type": {
                          "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                          "type": "string",
                          "enum": [
                            "reaction",
                            "text",
                            "radio",
                            "checkbox",
                            "rating",
                            "nps",
                            "statement"
                          ]
                        },
                        "label": {
                          "description": "The question as the respondent reads it",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 1000
                        },
                        "scale": {
                          "description": "The rating scale. rating only — nps is fixed 0..10",
                          "type": "object",
                          "required": [
                            "min",
                            "max"
                          ],
                          "properties": {
                            "max": {
                              "description": "Top of the scale, at most 10",
                              "type": "integer",
                              "minimum": 2,
                              "maximum": 10
                            },
                            "min": {
                              "description": "Bottom of the scale: 0 or 1",
                              "type": "number",
                              "enum": [
                                0,
                                1
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "options": {
                          "description": "The choices. radio and checkbox only",
                          "type": "array",
                          "minItems": 1,
                          "maxItems": 50,
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "label"
                            ],
                            "properties": {
                              "id": {
                                "description": "Client-owned id of the option, unique within the question",
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 64
                              },
                              "label": {
                                "description": "What the respondent reads",
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 500
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "required": {
                          "description": "When true, a response marked completed must answer it. Never valid on a statement",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "status",
                    "questions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Survey id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "What this survey is called",
                      "type": "string"
                    },
                    "status": {
                      "description": "draft: editable, not answerable. published: answerable, frozen. archived: terminal, neither editable nor answerable, and there is no way back",
                      "type": "string",
                      "enum": [
                        "draft",
                        "published",
                        "archived"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "questions": {
                      "description": "The ordered question set, exactly as stored",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "label"
                        ],
                        "properties": {
                          "id": {
                            "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "skip": {
                            "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "type": {
                            "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                            "type": "string",
                            "enum": [
                              "reaction",
                              "text",
                              "radio",
                              "checkbox",
                              "rating",
                              "nps",
                              "statement"
                            ]
                          },
                          "label": {
                            "description": "The question as the respondent reads it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 1000
                          },
                          "scale": {
                            "description": "The rating scale. rating only — nps is fixed 0..10",
                            "type": "object",
                            "required": [
                              "min",
                              "max"
                            ],
                            "properties": {
                              "max": {
                                "description": "Top of the scale, at most 10",
                                "type": "integer",
                                "minimum": 2,
                                "maximum": 10
                              },
                              "min": {
                                "description": "Bottom of the scale: 0 or 1",
                                "type": "number",
                                "enum": [
                                  0,
                                  1
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "options": {
                            "description": "The choices. radio and checkbox only",
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 50,
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "label"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Client-owned id of the option, unique within the question",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                "label": {
                                  "description": "What the respondent reads",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 500
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": {
                            "description": "When true, a response marked completed must answer it. Never valid on a statement",
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/surveys/{id}/archive": {
      "post": {
        "operationId": "support_survey_archive",
        "summary": "Switch a survey off for good, from either draft or published.",
        "description": "Switch a survey off for good, from either draft or published. Archiving is terminal — there is no way back in v2 — and it deletes nothing: every response already collected stays readable",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_survey_archive",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Survey id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "status",
                    "questions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Survey id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "What this survey is called",
                      "type": "string"
                    },
                    "status": {
                      "description": "draft: editable, not answerable. published: answerable, frozen. archived: terminal, neither editable nor answerable, and there is no way back",
                      "type": "string",
                      "enum": [
                        "draft",
                        "published",
                        "archived"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "questions": {
                      "description": "The ordered question set, exactly as stored",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "label"
                        ],
                        "properties": {
                          "id": {
                            "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "skip": {
                            "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "type": {
                            "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                            "type": "string",
                            "enum": [
                              "reaction",
                              "text",
                              "radio",
                              "checkbox",
                              "rating",
                              "nps",
                              "statement"
                            ]
                          },
                          "label": {
                            "description": "The question as the respondent reads it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 1000
                          },
                          "scale": {
                            "description": "The rating scale. rating only — nps is fixed 0..10",
                            "type": "object",
                            "required": [
                              "min",
                              "max"
                            ],
                            "properties": {
                              "max": {
                                "description": "Top of the scale, at most 10",
                                "type": "integer",
                                "minimum": 2,
                                "maximum": 10
                              },
                              "min": {
                                "description": "Bottom of the scale: 0 or 1",
                                "type": "number",
                                "enum": [
                                  0,
                                  1
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "options": {
                            "description": "The choices. radio and checkbox only",
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 50,
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "label"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Client-owned id of the option, unique within the question",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                "label": {
                                  "description": "What the respondent reads",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 500
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": {
                            "description": "When true, a response marked completed must answer it. Never valid on a statement",
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/surveys/{id}/publish": {
      "post": {
        "operationId": "support_survey_publish",
        "summary": "Publish a draft survey, which is what makes it answerable and what freezes its structure.",
        "description": "Publish a draft survey, which is what makes it answerable and what freezes its structure. Publishing validates the whole question set: it must be non-empty, question ids must be unique, radio and checkbox questions must offer options, a statement may not be required, and every skip must target a later question or the literal \"end\". A survey that is already published or archived is refused",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_survey_publish",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Survey id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "status",
                    "questions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Survey id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "What this survey is called",
                      "type": "string"
                    },
                    "status": {
                      "description": "draft: editable, not answerable. published: answerable, frozen. archived: terminal, neither editable nor answerable, and there is no way back",
                      "type": "string",
                      "enum": [
                        "draft",
                        "published",
                        "archived"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "questions": {
                      "description": "The ordered question set, exactly as stored",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "label"
                        ],
                        "properties": {
                          "id": {
                            "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "skip": {
                            "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "type": {
                            "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                            "type": "string",
                            "enum": [
                              "reaction",
                              "text",
                              "radio",
                              "checkbox",
                              "rating",
                              "nps",
                              "statement"
                            ]
                          },
                          "label": {
                            "description": "The question as the respondent reads it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 1000
                          },
                          "scale": {
                            "description": "The rating scale. rating only — nps is fixed 0..10",
                            "type": "object",
                            "required": [
                              "min",
                              "max"
                            ],
                            "properties": {
                              "max": {
                                "description": "Top of the scale, at most 10",
                                "type": "integer",
                                "minimum": 2,
                                "maximum": 10
                              },
                              "min": {
                                "description": "Bottom of the scale: 0 or 1",
                                "type": "number",
                                "enum": [
                                  0,
                                  1
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "options": {
                            "description": "The choices. radio and checkbox only",
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 50,
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "label"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Client-owned id of the option, unique within the question",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                "label": {
                                  "description": "What the respondent reads",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 500
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": {
                            "description": "When true, a response marked completed must answer it. Never valid on a statement",
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/surveys/{id}/stats": {
      "get": {
        "operationId": "support_survey_stats",
        "summary": "Aggregate one survey’s responses over a time window: how many came in and how many reached the end, then per question — option counts for radio and checkbox, mean and distribution for rating and nps, an answered count for the rest.",
        "description": "Aggregate one survey’s responses over a time window: how many came in and how many reached the end, then per question — option counts for radio and checkbox, mean and distribution for rating and nps, an answered count for the rest. For the FIRST nps question it also returns promoters (9-10), passives (7-8), detractors (0-6) and the NPS score: percentage of promoters minus percentage of detractors over everyone who answered, rounded once. The window defaults to the last 30 days — omitting from does not mean \"since the beginning\"",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_survey_stats",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Survey id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Start of the window, ISO-8601, inclusive. Defaults to 30 days ago — omitting it means \"recently\", never \"since the beginning\"",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "End of the window, ISO-8601, inclusive. Defaults to now",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "surveyId",
                    "from",
                    "to",
                    "responses",
                    "questions",
                    "nps"
                  ],
                  "properties": {
                    "to": {
                      "description": "ISO-8601 end of the window that was actually applied",
                      "type": "string"
                    },
                    "nps": {
                      "description": "The NPS block, or null when the survey asks no nps question",
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "questionId",
                            "answered",
                            "promoters",
                            "passives",
                            "detractors",
                            "score"
                          ],
                          "properties": {
                            "score": {
                              "description": "Percentage of promoters minus percentage of detractors, over everyone who answered — passives dilute rather than vanish — rounded once on the difference. Null when nobody answered, which is not the same as zero",
                              "anyOf": [
                                {
                                  "type": "integer"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "answered": {
                              "description": "How many responses gave a value in 0..10",
                              "type": "integer"
                            },
                            "passives": {
                              "description": "Answers of 7 or 8",
                              "type": "integer"
                            },
                            "promoters": {
                              "description": "Answers of 9 or 10",
                              "type": "integer"
                            },
                            "detractors": {
                              "description": "Answers of 6 or below",
                              "type": "integer"
                            },
                            "questionId": {
                              "description": "The first nps question of the survey — the one this scores",
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "from": {
                      "description": "ISO-8601 start of the window that was actually applied",
                      "type": "string"
                    },
                    "surveyId": {
                      "description": "The survey these numbers describe",
                      "type": "string",
                      "format": "uuid"
                    },
                    "questions": {
                      "description": "Every question of the survey, answered or not",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "questionId",
                          "type",
                          "label",
                          "answered",
                          "options",
                          "average",
                          "distribution"
                        ],
                        "properties": {
                          "type": {
                            "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                            "type": "string",
                            "enum": [
                              "reaction",
                              "text",
                              "radio",
                              "checkbox",
                              "rating",
                              "nps",
                              "statement"
                            ]
                          },
                          "label": {
                            "description": "The question as the respondent read it",
                            "type": "string"
                          },
                          "average": {
                            "description": "rating and nps: the mean to two decimals, or null when nothing was answered. Null for every other type",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "options": {
                            "description": "radio and checkbox: every option the question declares, in its declared order, including the ones nobody picked. Null for every other type",
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "optionId",
                                    "label",
                                    "count"
                                  ],
                                  "properties": {
                                    "count": {
                                      "description": "How many responses picked it",
                                      "type": "integer"
                                    },
                                    "label": {
                                      "description": "The option label, as the survey declares it",
                                      "type": "string"
                                    },
                                    "optionId": {
                                      "description": "The option this count belongs to",
                                      "type": "string"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "answered": {
                            "description": "How many responses answered it. An empty checkbox selection is not an answer",
                            "type": "integer"
                          },
                          "questionId": {
                            "description": "The question this aggregate belongs to",
                            "type": "string"
                          },
                          "distribution": {
                            "description": "rating and nps: how many responses gave each value, ascending. Null for every other type",
                            "anyOf": [
                              {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "required": [
                                    "score",
                                    "count"
                                  ],
                                  "properties": {
                                    "count": {
                                      "description": "How many responses gave it",
                                      "type": "integer"
                                    },
                                    "score": {
                                      "description": "The value that was given",
                                      "type": "integer"
                                    }
                                  },
                                  "additionalProperties": false
                                }
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "responses": {
                      "description": "The response counts over the window",
                      "type": "object",
                      "required": [
                        "total",
                        "completed"
                      ],
                      "properties": {
                        "total": {
                          "description": "Responses submitted in the window",
                          "type": "integer"
                        },
                        "completed": {
                          "description": "How many of them reached the end",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/surveys/{id}/unpublish": {
      "post": {
        "operationId": "support_survey_unpublish",
        "summary": "Return a published survey to draft so it can be edited.",
        "description": "Return a published survey to draft so it can be edited. It stops accepting responses immediately; the responses already collected are untouched. A survey that is not published is refused",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_survey_unpublish",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Survey id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "status",
                    "questions",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Survey id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "name": {
                      "description": "What this survey is called",
                      "type": "string"
                    },
                    "status": {
                      "description": "draft: editable, not answerable. published: answerable, frozen. archived: terminal, neither editable nor answerable, and there is no way back",
                      "type": "string",
                      "enum": [
                        "draft",
                        "published",
                        "archived"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "questions": {
                      "description": "The ordered question set, exactly as stored",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "label"
                        ],
                        "properties": {
                          "id": {
                            "description": "Client-owned id of the question, unique within the survey. Answers are keyed by it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64
                          },
                          "skip": {
                            "description": "Branching, radio only: option id -> the question id to jump to, or 'end' to finish. Targets must be later questions; publish refuses anything else",
                            "type": "object",
                            "additionalProperties": {
                              "type": "string",
                              "minLength": 1
                            }
                          },
                          "type": {
                            "description": "reaction: a free string the client owns (an emoji). text: free prose. radio: one option. checkbox: any number of options. rating: an integer on a declared scale. nps: an integer 0..10. statement: displayed, never answered",
                            "type": "string",
                            "enum": [
                              "reaction",
                              "text",
                              "radio",
                              "checkbox",
                              "rating",
                              "nps",
                              "statement"
                            ]
                          },
                          "label": {
                            "description": "The question as the respondent reads it",
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 1000
                          },
                          "scale": {
                            "description": "The rating scale. rating only — nps is fixed 0..10",
                            "type": "object",
                            "required": [
                              "min",
                              "max"
                            ],
                            "properties": {
                              "max": {
                                "description": "Top of the scale, at most 10",
                                "type": "integer",
                                "minimum": 2,
                                "maximum": 10
                              },
                              "min": {
                                "description": "Bottom of the scale: 0 or 1",
                                "type": "number",
                                "enum": [
                                  0,
                                  1
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "options": {
                            "description": "The choices. radio and checkbox only",
                            "type": "array",
                            "minItems": 1,
                            "maxItems": 50,
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "label"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Client-owned id of the option, unique within the question",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 64
                                },
                                "label": {
                                  "description": "What the respondent reads",
                                  "type": "string",
                                  "minLength": 1,
                                  "maxLength": 500
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "required": {
                            "description": "When true, a response marked completed must answer it. Never valid on a statement",
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/threads": {
      "get": {
        "operationId": "support_thread_list",
        "summary": "List support threads for this product, newest first — by creation time by default, or by last modification with sort='updated'.",
        "description": "List support threads for this product, newest first — by creation time by default, or by last modification with sort='updated'. Every filter lives here: type, status, status category, assignee, external author, creation window, rating range (ratingMin/ratingMax, inclusive — a thread nobody rated matches neither bound), plus pagination",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_thread_list",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Only threads of this type",
            "schema": {
              "type": "string",
              "enum": [
                "ticket",
                "feedback"
              ]
            }
          },
          {
            "name": "statusId",
            "in": "query",
            "required": false,
            "description": "Only threads sitting on this exact status",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Only threads whose status belongs to this category. Resolved through a join on the status dictionary — the category is never stored on the thread",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "pending",
                "resolved",
                "closed"
              ]
            }
          },
          {
            "name": "assignedAgentId",
            "in": "query",
            "required": false,
            "description": "Only threads assigned to this agent",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "authorExternalId",
            "in": "query",
            "required": false,
            "description": "Only threads opened by this external author, matched verbatim",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "createdFrom",
            "in": "query",
            "required": false,
            "description": "Only threads created at or after this ISO-8601 timestamp",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdTo",
            "in": "query",
            "required": false,
            "description": "Only threads created at or before this ISO-8601 timestamp",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "ratingMin",
            "in": "query",
            "required": false,
            "description": "Only threads rated at or above this score (0..10, inclusive). An unrated thread never matches a rating filter — not even at the bottom of the scale",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "ratingMax",
            "in": "query",
            "required": false,
            "description": "Only threads rated at or below this score (0..10, inclusive). An unrated thread never matches a rating filter — not even at the bottom of the scale",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10
            }
          },
          {
            "name": "labelIds",
            "in": "query",
            "required": false,
            "description": "Only threads carrying ALL of these labels. Every other filter here narrows the result and so does this one: each additional label id makes the answer smaller, never bigger",
            "style": "form",
            "explode": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Ordering of the page, newest first either way (default 'created')",
            "schema": {
              "type": "string",
              "enum": [
                "created",
                "updated"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1..100 (default 25)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of threads to skip",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "threads",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "limit": {
                      "description": "Page size that was applied",
                      "type": "integer"
                    },
                    "offset": {
                      "description": "Offset that was applied",
                      "type": "integer"
                    },
                    "threads": {
                      "description": "The requested page of threads, newest first by the requested sort",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "title",
                          "statusId",
                          "status",
                          "priority",
                          "authorExternalId",
                          "authorDisplay",
                          "assignedAgentId",
                          "metadata",
                          "rating",
                          "labels",
                          "createdAt",
                          "updatedAt",
                          "lastReplyAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Thread id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "type": {
                            "description": "ticket: the end user wants something fixed. feedback: unsolicited input",
                            "type": "string",
                            "enum": [
                              "ticket",
                              "feedback"
                            ]
                          },
                          "title": {
                            "description": "Thread subject",
                            "type": "string"
                          },
                          "labels": {
                            "description": "Every label on the thread, by name",
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "name",
                                "color",
                                "createdAt"
                              ],
                              "properties": {
                                "id": {
                                  "description": "Label id",
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "name": {
                                  "description": "Label name, unique within the product",
                                  "type": "string"
                                },
                                "color": {
                                  "description": "Display colour as a hex string, or null if uncoloured",
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "createdAt": {
                                  "description": "ISO-8601 creation timestamp",
                                  "type": "string"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "rating": {
                            "description": "The score the client supplied at creation, or null while the thread is unrated",
                            "anyOf": [
                              {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 10
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status": {
                            "description": "The status itself, joined in at read time",
                            "type": "object",
                            "required": [
                              "id",
                              "name",
                              "color",
                              "order",
                              "category",
                              "archived"
                            ],
                            "properties": {
                              "id": {
                                "description": "Status id",
                                "type": "string",
                                "format": "uuid"
                              },
                              "name": {
                                "description": "Status name, unique within the product",
                                "type": "string"
                              },
                              "color": {
                                "description": "Display colour as a hex string",
                                "type": "string"
                              },
                              "order": {
                                "description": "Sort order within the status dictionary",
                                "type": "integer"
                              },
                              "archived": {
                                "description": "Archived statuses stay readable but are not offered as targets",
                                "type": "boolean"
                              },
                              "category": {
                                "description": "Lifecycle bucket the status belongs to",
                                "type": "string",
                                "enum": [
                                  "open",
                                  "pending",
                                  "resolved",
                                  "closed"
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "metadata": {
                            "description": "Free-form client-owned JSON",
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "priority": {
                            "description": "Thread priority",
                            "type": "string",
                            "enum": [
                              "low",
                              "normal",
                              "high",
                              "urgent"
                            ]
                          },
                          "statusId": {
                            "description": "Id of the status the thread sits on",
                            "type": "string",
                            "format": "uuid"
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          },
                          "updatedAt": {
                            "description": "ISO-8601 last-modification timestamp",
                            "type": "string"
                          },
                          "lastReplyAt": {
                            "description": "ISO-8601 timestamp of the last reply, or null while there are none",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "authorDisplay": {
                            "description": "Display name for the external author, if given",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "assignedAgentId": {
                            "description": "Assigned agent, or null while unassigned",
                            "anyOf": [
                              {
                                "type": "string",
                                "format": "uuid"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "authorExternalId": {
                            "description": "The external author, byte-identical to what was stored",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "support_thread_create",
        "summary": "Open a support thread on behalf of an external end user.",
        "description": "Open a support thread on behalf of an external end user. The author is an opaque identifier from the client's own user base and is stored verbatim. The thread opens on the product's default open status; there is no status argument. An optional rating — an integer 0..10, both ends inclusive — may travel with it and is stored verbatim too; omit it for an unrated thread, because 0 is a real score at the bottom of the scale",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_thread_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "description": "ticket: the end user wants something fixed. feedback: unsolicited input",
                    "type": "string",
                    "enum": [
                      "ticket",
                      "feedback"
                    ]
                  },
                  "title": {
                    "description": "Short human-readable subject of the thread",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "authorExternalId": {
                    "description": "Opaque identifier of the external end user in the client's own user base. Stored verbatim: never resolved, normalised or enriched, and it is not a Lessly identity",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "authorDisplay": {
                    "description": "Optional display name for the external author, as the client already knows it",
                    "type": "string",
                    "maxLength": 255
                  },
                  "metadata": {
                    "description": "Free-form client-owned JSON attached to the thread",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "labelIds": {
                    "description": "Labels to put on the new thread",
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "rating": {
                    "description": "Optional score the client attached when the thread was opened: an integer 0..10, both ends inclusive, stored verbatim and never recomputed. Omit it for an unrated thread — 0 is a real score at the bottom of the scale, not a way of saying \"no rating\"",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  }
                },
                "required": [
                  "type",
                  "title",
                  "authorExternalId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "title",
                    "statusId",
                    "status",
                    "priority",
                    "authorExternalId",
                    "authorDisplay",
                    "assignedAgentId",
                    "metadata",
                    "rating",
                    "labels",
                    "createdAt",
                    "updatedAt",
                    "lastReplyAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Thread id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "type": {
                      "description": "ticket: the end user wants something fixed. feedback: unsolicited input",
                      "type": "string",
                      "enum": [
                        "ticket",
                        "feedback"
                      ]
                    },
                    "title": {
                      "description": "Thread subject",
                      "type": "string"
                    },
                    "labels": {
                      "description": "Every label on the thread, by name",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "color",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Label id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "description": "Label name, unique within the product",
                            "type": "string"
                          },
                          "color": {
                            "description": "Display colour as a hex string, or null if uncoloured",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "rating": {
                      "description": "The score the client supplied at creation, or null while the thread is unrated",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "description": "The status itself, joined in at read time",
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "color",
                        "order",
                        "category",
                        "archived"
                      ],
                      "properties": {
                        "id": {
                          "description": "Status id",
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "description": "Status name, unique within the product",
                          "type": "string"
                        },
                        "color": {
                          "description": "Display colour as a hex string",
                          "type": "string"
                        },
                        "order": {
                          "description": "Sort order within the status dictionary",
                          "type": "integer"
                        },
                        "archived": {
                          "description": "Archived statuses stay readable but are not offered as targets",
                          "type": "boolean"
                        },
                        "category": {
                          "description": "Lifecycle bucket the status belongs to",
                          "type": "string",
                          "enum": [
                            "open",
                            "pending",
                            "resolved",
                            "closed"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "metadata": {
                      "description": "Free-form client-owned JSON",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "priority": {
                      "description": "Thread priority",
                      "type": "string",
                      "enum": [
                        "low",
                        "normal",
                        "high",
                        "urgent"
                      ]
                    },
                    "statusId": {
                      "description": "Id of the status the thread sits on",
                      "type": "string",
                      "format": "uuid"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "lastReplyAt": {
                      "description": "ISO-8601 timestamp of the last reply, or null while there are none",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "authorDisplay": {
                      "description": "Display name for the external author, if given",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignedAgentId": {
                      "description": "Assigned agent, or null while unassigned",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorExternalId": {
                      "description": "The external author, byte-identical to what was stored",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/threads/{id}": {
      "get": {
        "operationId": "support_thread_get",
        "summary": "Get one support thread by id, with its status joined in.",
        "description": "Get one support thread by id, with its status joined in. A thread belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_thread_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Thread id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "title",
                    "statusId",
                    "status",
                    "priority",
                    "authorExternalId",
                    "authorDisplay",
                    "assignedAgentId",
                    "metadata",
                    "rating",
                    "labels",
                    "createdAt",
                    "updatedAt",
                    "lastReplyAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Thread id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "type": {
                      "description": "ticket: the end user wants something fixed. feedback: unsolicited input",
                      "type": "string",
                      "enum": [
                        "ticket",
                        "feedback"
                      ]
                    },
                    "title": {
                      "description": "Thread subject",
                      "type": "string"
                    },
                    "labels": {
                      "description": "Every label on the thread, by name",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "color",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Label id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "description": "Label name, unique within the product",
                            "type": "string"
                          },
                          "color": {
                            "description": "Display colour as a hex string, or null if uncoloured",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "rating": {
                      "description": "The score the client supplied at creation, or null while the thread is unrated",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "description": "The status itself, joined in at read time",
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "color",
                        "order",
                        "category",
                        "archived"
                      ],
                      "properties": {
                        "id": {
                          "description": "Status id",
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "description": "Status name, unique within the product",
                          "type": "string"
                        },
                        "color": {
                          "description": "Display colour as a hex string",
                          "type": "string"
                        },
                        "order": {
                          "description": "Sort order within the status dictionary",
                          "type": "integer"
                        },
                        "archived": {
                          "description": "Archived statuses stay readable but are not offered as targets",
                          "type": "boolean"
                        },
                        "category": {
                          "description": "Lifecycle bucket the status belongs to",
                          "type": "string",
                          "enum": [
                            "open",
                            "pending",
                            "resolved",
                            "closed"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "metadata": {
                      "description": "Free-form client-owned JSON",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "priority": {
                      "description": "Thread priority",
                      "type": "string",
                      "enum": [
                        "low",
                        "normal",
                        "high",
                        "urgent"
                      ]
                    },
                    "statusId": {
                      "description": "Id of the status the thread sits on",
                      "type": "string",
                      "format": "uuid"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "lastReplyAt": {
                      "description": "ISO-8601 timestamp of the last reply, or null while there are none",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "authorDisplay": {
                      "description": "Display name for the external author, if given",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignedAgentId": {
                      "description": "Assigned agent, or null while unassigned",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorExternalId": {
                      "description": "The external author, byte-identical to what was stored",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "support_thread_update",
        "summary": "Edit a thread: its title, its priority, its labels and its client-owned metadata.",
        "description": "Edit a thread: its title, its priority, its labels and its client-owned metadata. Moving a thread between statuses and putting an agent on it have their own tools and are not possible here. labelIds replaces the entire label set — pass an empty array to clear it, and a label belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_thread_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Thread id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "description": "New subject of the thread",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "priority": {
                    "description": "New priority",
                    "type": "string",
                    "enum": [
                      "low",
                      "normal",
                      "high",
                      "urgent"
                    ]
                  },
                  "labelIds": {
                    "description": "The complete new label set. Pass an empty array to remove every label",
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "metadata": {
                    "description": "Replaces the whole client-owned metadata object",
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "title",
                    "statusId",
                    "status",
                    "priority",
                    "authorExternalId",
                    "authorDisplay",
                    "assignedAgentId",
                    "metadata",
                    "rating",
                    "labels",
                    "createdAt",
                    "updatedAt",
                    "lastReplyAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Thread id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "type": {
                      "description": "ticket: the end user wants something fixed. feedback: unsolicited input",
                      "type": "string",
                      "enum": [
                        "ticket",
                        "feedback"
                      ]
                    },
                    "title": {
                      "description": "Thread subject",
                      "type": "string"
                    },
                    "labels": {
                      "description": "Every label on the thread, by name",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "color",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Label id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "description": "Label name, unique within the product",
                            "type": "string"
                          },
                          "color": {
                            "description": "Display colour as a hex string, or null if uncoloured",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "rating": {
                      "description": "The score the client supplied at creation, or null while the thread is unrated",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "description": "The status itself, joined in at read time",
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "color",
                        "order",
                        "category",
                        "archived"
                      ],
                      "properties": {
                        "id": {
                          "description": "Status id",
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "description": "Status name, unique within the product",
                          "type": "string"
                        },
                        "color": {
                          "description": "Display colour as a hex string",
                          "type": "string"
                        },
                        "order": {
                          "description": "Sort order within the status dictionary",
                          "type": "integer"
                        },
                        "archived": {
                          "description": "Archived statuses stay readable but are not offered as targets",
                          "type": "boolean"
                        },
                        "category": {
                          "description": "Lifecycle bucket the status belongs to",
                          "type": "string",
                          "enum": [
                            "open",
                            "pending",
                            "resolved",
                            "closed"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "metadata": {
                      "description": "Free-form client-owned JSON",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "priority": {
                      "description": "Thread priority",
                      "type": "string",
                      "enum": [
                        "low",
                        "normal",
                        "high",
                        "urgent"
                      ]
                    },
                    "statusId": {
                      "description": "Id of the status the thread sits on",
                      "type": "string",
                      "format": "uuid"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "lastReplyAt": {
                      "description": "ISO-8601 timestamp of the last reply, or null while there are none",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "authorDisplay": {
                      "description": "Display name for the external author, if given",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignedAgentId": {
                      "description": "Assigned agent, or null while unassigned",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorExternalId": {
                      "description": "The external author, byte-identical to what was stored",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/threads/{id}/assignment": {
      "post": {
        "operationId": "support_thread_assign",
        "summary": "Put a support agent on a thread, or pass null to return it to the unassigned queue — clearing an assignment is an ordinary operation, not an error.",
        "description": "Put a support agent on a thread, or pass null to return it to the unassigned queue — clearing an assignment is an ordinary operation, not an error. An agent belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_thread_assign",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Thread id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "agentId": {
                    "description": "Support agent of this product to put on the thread, or null to return it to the unassigned queue. An agent of another product is reported as not found",
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "agentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "title",
                    "statusId",
                    "status",
                    "priority",
                    "authorExternalId",
                    "authorDisplay",
                    "assignedAgentId",
                    "metadata",
                    "rating",
                    "labels",
                    "createdAt",
                    "updatedAt",
                    "lastReplyAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Thread id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "type": {
                      "description": "ticket: the end user wants something fixed. feedback: unsolicited input",
                      "type": "string",
                      "enum": [
                        "ticket",
                        "feedback"
                      ]
                    },
                    "title": {
                      "description": "Thread subject",
                      "type": "string"
                    },
                    "labels": {
                      "description": "Every label on the thread, by name",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "color",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Label id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "description": "Label name, unique within the product",
                            "type": "string"
                          },
                          "color": {
                            "description": "Display colour as a hex string, or null if uncoloured",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "rating": {
                      "description": "The score the client supplied at creation, or null while the thread is unrated",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "description": "The status itself, joined in at read time",
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "color",
                        "order",
                        "category",
                        "archived"
                      ],
                      "properties": {
                        "id": {
                          "description": "Status id",
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "description": "Status name, unique within the product",
                          "type": "string"
                        },
                        "color": {
                          "description": "Display colour as a hex string",
                          "type": "string"
                        },
                        "order": {
                          "description": "Sort order within the status dictionary",
                          "type": "integer"
                        },
                        "archived": {
                          "description": "Archived statuses stay readable but are not offered as targets",
                          "type": "boolean"
                        },
                        "category": {
                          "description": "Lifecycle bucket the status belongs to",
                          "type": "string",
                          "enum": [
                            "open",
                            "pending",
                            "resolved",
                            "closed"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "metadata": {
                      "description": "Free-form client-owned JSON",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "priority": {
                      "description": "Thread priority",
                      "type": "string",
                      "enum": [
                        "low",
                        "normal",
                        "high",
                        "urgent"
                      ]
                    },
                    "statusId": {
                      "description": "Id of the status the thread sits on",
                      "type": "string",
                      "format": "uuid"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "lastReplyAt": {
                      "description": "ISO-8601 timestamp of the last reply, or null while there are none",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "authorDisplay": {
                      "description": "Display name for the external author, if given",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignedAgentId": {
                      "description": "Assigned agent, or null while unassigned",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorExternalId": {
                      "description": "The external author, byte-identical to what was stored",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/threads/{id}/status": {
      "post": {
        "operationId": "support_thread_status_set",
        "summary": "Move a thread to a status.",
        "description": "Move a thread to a status. Any status may follow any other — there are no transition rules. The category is never a parameter: it comes from the status the thread lands on. A status belonging to another product is reported as not found, and an archived status is refused",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_thread_status_set",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Thread id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "statusId": {
                    "description": "Destination status of this product. Any status may follow any other — v1 has no transition rules. An archived status is refused",
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "statusId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "type",
                    "title",
                    "statusId",
                    "status",
                    "priority",
                    "authorExternalId",
                    "authorDisplay",
                    "assignedAgentId",
                    "metadata",
                    "rating",
                    "labels",
                    "createdAt",
                    "updatedAt",
                    "lastReplyAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Thread id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "type": {
                      "description": "ticket: the end user wants something fixed. feedback: unsolicited input",
                      "type": "string",
                      "enum": [
                        "ticket",
                        "feedback"
                      ]
                    },
                    "title": {
                      "description": "Thread subject",
                      "type": "string"
                    },
                    "labels": {
                      "description": "Every label on the thread, by name",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "color",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Label id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "name": {
                            "description": "Label name, unique within the product",
                            "type": "string"
                          },
                          "color": {
                            "description": "Display colour as a hex string, or null if uncoloured",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "rating": {
                      "description": "The score the client supplied at creation, or null while the thread is unrated",
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 10
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "description": "The status itself, joined in at read time",
                      "type": "object",
                      "required": [
                        "id",
                        "name",
                        "color",
                        "order",
                        "category",
                        "archived"
                      ],
                      "properties": {
                        "id": {
                          "description": "Status id",
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "description": "Status name, unique within the product",
                          "type": "string"
                        },
                        "color": {
                          "description": "Display colour as a hex string",
                          "type": "string"
                        },
                        "order": {
                          "description": "Sort order within the status dictionary",
                          "type": "integer"
                        },
                        "archived": {
                          "description": "Archived statuses stay readable but are not offered as targets",
                          "type": "boolean"
                        },
                        "category": {
                          "description": "Lifecycle bucket the status belongs to",
                          "type": "string",
                          "enum": [
                            "open",
                            "pending",
                            "resolved",
                            "closed"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "metadata": {
                      "description": "Free-form client-owned JSON",
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "priority": {
                      "description": "Thread priority",
                      "type": "string",
                      "enum": [
                        "low",
                        "normal",
                        "high",
                        "urgent"
                      ]
                    },
                    "statusId": {
                      "description": "Id of the status the thread sits on",
                      "type": "string",
                      "format": "uuid"
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-modification timestamp",
                      "type": "string"
                    },
                    "lastReplyAt": {
                      "description": "ISO-8601 timestamp of the last reply, or null while there are none",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "authorDisplay": {
                      "description": "Display name for the external author, if given",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "assignedAgentId": {
                      "description": "Assigned agent, or null while unassigned",
                      "anyOf": [
                        {
                          "type": "string",
                          "format": "uuid"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "authorExternalId": {
                      "description": "The external author, byte-identical to what was stored",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/webhook-deliveries": {
      "get": {
        "operationId": "support_webhook_deliveries_list",
        "summary": "List webhook delivery attempts for this product, newest first.",
        "description": "List webhook delivery attempts for this product, newest first. Filter by endpoint, by state (pending, delivered, failed), by event type or by the time the delivery was opened. Each row carries the exact JSON body that was sent, the last HTTP status and, while attempts remain, when the next one is due",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_webhook_deliveries_list",
        "parameters": [
          {
            "name": "webhookId",
            "in": "query",
            "required": false,
            "description": "Only deliveries for this endpoint",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Only deliveries in this state: pending, delivered or failed",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "delivered",
                "failed"
              ]
            }
          },
          {
            "name": "eventType",
            "in": "query",
            "required": false,
            "description": "Only deliveries of this event type",
            "schema": {
              "type": "string",
              "enum": [
                "support.message.created",
                "support.thread.status-changed",
                "support.thread.assigned",
                "support.survey.published",
                "support.response.created"
              ]
            }
          },
          {
            "name": "createdFrom",
            "in": "query",
            "required": false,
            "description": "Only deliveries opened at or after this ISO-8601 time",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "createdTo",
            "in": "query",
            "required": false,
            "description": "Only deliveries opened at or before this ISO-8601 time",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1..200 (default 50)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Number of deliveries to skip",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deliveries",
                    "limit",
                    "offset"
                  ],
                  "properties": {
                    "limit": {
                      "description": "Page size that was applied",
                      "type": "integer"
                    },
                    "offset": {
                      "description": "Offset that was applied",
                      "type": "integer"
                    },
                    "deliveries": {
                      "description": "The requested page, newest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "webhookId",
                          "eventType",
                          "idempotencyKey",
                          "payload",
                          "attempt",
                          "state",
                          "responseStatus",
                          "error",
                          "deliveredAt",
                          "nextRetryAt",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Delivery id — the value in the X-Support-Delivery-Id header",
                            "type": "string",
                            "format": "uuid"
                          },
                          "error": {
                            "description": "Why the last attempt failed, or null. Never carries the signing key",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "state": {
                            "description": "pending while attempts remain, delivered once the endpoint answered 2xx, failed when every attempt was used up",
                            "type": "string",
                            "enum": [
                              "pending",
                              "delivered",
                              "failed"
                            ]
                          },
                          "attempt": {
                            "description": "How many attempts have been made, 0 before the first",
                            "type": "integer"
                          },
                          "payload": {
                            "description": "The JSON body that was sent. Identifiers and metadata only — never message text",
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "createdAt": {
                            "description": "ISO-8601 time the delivery was opened",
                            "type": "string"
                          },
                          "eventType": {
                            "description": "Event type that was delivered",
                            "type": "string"
                          },
                          "webhookId": {
                            "description": "The endpoint this delivery was for",
                            "type": "string",
                            "format": "uuid"
                          },
                          "deliveredAt": {
                            "description": "ISO-8601 time of the successful attempt, or null",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "nextRetryAt": {
                            "description": "ISO-8601 time the next attempt is due, or null when there is none",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "idempotencyKey": {
                            "description": "The key the receiver deduplicates on. A redelivery of this event carries the same value",
                            "type": "string"
                          },
                          "responseStatus": {
                            "description": "HTTP status of the last attempt, or null if the request never got an answer",
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/webhook-deliveries/redeliver": {
      "post": {
        "operationId": "support_webhook_redeliver",
        "summary": "Send a past delivery to its endpoint again, with the original payload and the original idempotencyKey — a receiver that already processed it can recognise and ignore the repeat.",
        "description": "Send a past delivery to its endpoint again, with the original payload and the original idempotencyKey — a receiver that already processed it can recognise and ignore the repeat. The original delivery row is kept as history and a new one is opened for this attempt. If the endpoint has since been disabled or unsubscribed from the event, nothing is delivered",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_webhook_redeliver",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "description": "Id of the delivery to send again",
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "delivery"
                  ],
                  "properties": {
                    "delivery": {
                      "description": "The new delivery, opened in pending state. It carries the original idempotencyKey, so a receiver that already processed the first one can ignore it",
                      "type": "object",
                      "required": [
                        "id",
                        "webhookId",
                        "eventType",
                        "idempotencyKey",
                        "payload",
                        "attempt",
                        "state",
                        "responseStatus",
                        "error",
                        "deliveredAt",
                        "nextRetryAt",
                        "createdAt"
                      ],
                      "properties": {
                        "id": {
                          "description": "Delivery id — the value in the X-Support-Delivery-Id header",
                          "type": "string",
                          "format": "uuid"
                        },
                        "error": {
                          "description": "Why the last attempt failed, or null. Never carries the signing key",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "description": "pending while attempts remain, delivered once the endpoint answered 2xx, failed when every attempt was used up",
                          "type": "string",
                          "enum": [
                            "pending",
                            "delivered",
                            "failed"
                          ]
                        },
                        "attempt": {
                          "description": "How many attempts have been made, 0 before the first",
                          "type": "integer"
                        },
                        "payload": {
                          "description": "The JSON body that was sent. Identifiers and metadata only — never message text",
                          "type": "object",
                          "additionalProperties": {}
                        },
                        "createdAt": {
                          "description": "ISO-8601 time the delivery was opened",
                          "type": "string"
                        },
                        "eventType": {
                          "description": "Event type that was delivered",
                          "type": "string"
                        },
                        "webhookId": {
                          "description": "The endpoint this delivery was for",
                          "type": "string",
                          "format": "uuid"
                        },
                        "deliveredAt": {
                          "description": "ISO-8601 time of the successful attempt, or null",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "nextRetryAt": {
                          "description": "ISO-8601 time the next attempt is due, or null when there is none",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "idempotencyKey": {
                          "description": "The key the receiver deduplicates on. A redelivery of this event carries the same value",
                          "type": "string"
                        },
                        "responseStatus": {
                          "description": "HTTP status of the last attempt, or null if the request never got an answer",
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/webhooks": {
      "get": {
        "operationId": "support_webhook_list",
        "summary": "List the endpoints this product has registered, oldest first.",
        "description": "List the endpoints this product has registered, oldest first. Signing secrets are never included — only the short prefix that tells two endpoints apart",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_webhook_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "webhooks"
                  ],
                  "properties": {
                    "webhooks": {
                      "description": "The endpoints this product has registered, oldest first",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "url",
                          "eventTypes",
                          "status",
                          "description",
                          "secretPrefix",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "description": "Webhook id",
                            "type": "string",
                            "format": "uuid"
                          },
                          "url": {
                            "description": "HTTPS endpoint events are POSTed to",
                            "type": "string"
                          },
                          "status": {
                            "description": "active or disabled",
                            "type": "string",
                            "enum": [
                              "active",
                              "disabled"
                            ]
                          },
                          "createdAt": {
                            "description": "ISO-8601 creation timestamp",
                            "type": "string"
                          },
                          "updatedAt": {
                            "description": "ISO-8601 last-update timestamp",
                            "type": "string"
                          },
                          "eventTypes": {
                            "description": "Event types this endpoint subscribes to",
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "description": {
                            "description": "Free-form note, or null",
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "secretPrefix": {
                            "description": "First characters of the signing secret, to tell endpoints apart. Never the whole secret",
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "support_webhook_create",
        "summary": "Register an HTTPS endpoint to receive Support events for this product, and mint its signing secret.",
        "description": "Register an HTTPS endpoint to receive Support events for this product, and mint its signing secret. The secret is returned here in clear and NOWHERE ELSE — exactly once, so store it now: it cannot be read back and can only be replaced by rotating it. Plain http:// endpoints are rejected",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_webhook_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "HTTPS endpoint the event is POSTed to. Plain http:// is rejected",
                    "type": "string",
                    "format": "uri"
                  },
                  "eventTypes": {
                    "description": "Event types this endpoint subscribes to. One or more of support.message.created, support.thread.status-changed, support.thread.assigned, support.survey.published, support.response.created",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "support.message.created",
                        "support.thread.status-changed",
                        "support.thread.assigned",
                        "support.survey.published",
                        "support.response.created"
                      ]
                    }
                  },
                  "description": {
                    "description": "Free-form note about what this endpoint is for, up to 1000 characters",
                    "type": "string",
                    "maxLength": 1000
                  }
                },
                "required": [
                  "url",
                  "eventTypes"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "eventTypes",
                    "status",
                    "description",
                    "secretPrefix",
                    "createdAt",
                    "updatedAt",
                    "secret"
                  ],
                  "properties": {
                    "id": {
                      "description": "Webhook id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "url": {
                      "description": "HTTPS endpoint events are POSTed to",
                      "type": "string"
                    },
                    "secret": {
                      "description": "The signing secret in clear. Shown exactly once, here — store it now; it cannot be read back and can only be replaced by rotating it",
                      "type": "string"
                    },
                    "status": {
                      "description": "active or disabled",
                      "type": "string",
                      "enum": [
                        "active",
                        "disabled"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-update timestamp",
                      "type": "string"
                    },
                    "eventTypes": {
                      "description": "Event types this endpoint subscribes to",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "description": {
                      "description": "Free-form note, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secretPrefix": {
                      "description": "First characters of the signing secret, to tell endpoints apart. Never the whole secret",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/webhooks/{id}": {
      "delete": {
        "operationId": "support_webhook_delete",
        "summary": "Remove a registered endpoint and the delivery history that points at it.",
        "description": "Remove a registered endpoint and the delivery history that points at it. To stop delivery without losing the registration, set its status to disabled instead",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_webhook_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "description": "Id of the endpoint that was removed",
                      "type": "string",
                      "format": "uuid"
                    },
                    "deleted": {
                      "description": "Always true — the endpoint is gone",
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "support_webhook_get",
        "summary": "Get one registered endpoint by id.",
        "description": "Get one registered endpoint by id. The signing secret is not part of the answer. An endpoint belonging to another product is reported as not found",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_webhook_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "eventTypes",
                    "status",
                    "description",
                    "secretPrefix",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Webhook id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "url": {
                      "description": "HTTPS endpoint events are POSTed to",
                      "type": "string"
                    },
                    "status": {
                      "description": "active or disabled",
                      "type": "string",
                      "enum": [
                        "active",
                        "disabled"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-update timestamp",
                      "type": "string"
                    },
                    "eventTypes": {
                      "description": "Event types this endpoint subscribes to",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "description": {
                      "description": "Free-form note, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secretPrefix": {
                      "description": "First characters of the signing secret, to tell endpoints apart. Never the whole secret",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "support_webhook_update",
        "summary": "Edit a registered endpoint: its url, the event types it subscribes to, its description or its status.",
        "description": "Edit a registered endpoint: its url, the event types it subscribes to, its description or its status. Setting status to disabled keeps the registration and stops delivery. Omit a field to leave it alone; pass null to clear the description. The signing secret is not editable here — rotate it instead",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_webhook_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "HTTPS endpoint the event is POSTed to. Plain http:// is rejected",
                    "type": "string",
                    "format": "uri"
                  },
                  "eventTypes": {
                    "description": "Event types this endpoint subscribes to. One or more of support.message.created, support.thread.status-changed, support.thread.assigned, support.survey.published, support.response.created",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "support.message.created",
                        "support.thread.status-changed",
                        "support.thread.assigned",
                        "support.survey.published",
                        "support.response.created"
                      ]
                    }
                  },
                  "description": {
                    "description": "Free-form note about what this endpoint is for, up to 1000 characters",
                    "anyOf": [
                      {
                        "description": "Free-form note about what this endpoint is for, up to 1000 characters",
                        "type": "string",
                        "maxLength": 1000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "description": "active delivers events; disabled keeps the registration and stops delivery",
                    "type": "string",
                    "enum": [
                      "active",
                      "disabled"
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "eventTypes",
                    "status",
                    "description",
                    "secretPrefix",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "description": "Webhook id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "url": {
                      "description": "HTTPS endpoint events are POSTed to",
                      "type": "string"
                    },
                    "status": {
                      "description": "active or disabled",
                      "type": "string",
                      "enum": [
                        "active",
                        "disabled"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-update timestamp",
                      "type": "string"
                    },
                    "eventTypes": {
                      "description": "Event types this endpoint subscribes to",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "description": {
                      "description": "Free-form note, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secretPrefix": {
                      "description": "First characters of the signing secret, to tell endpoints apart. Never the whole secret",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/support/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "support_webhook_rotate_secret",
        "summary": "Replace the signing secret of an endpoint and return the new one in clear, exactly once.",
        "description": "Replace the signing secret of an endpoint and return the new one in clear, exactly once. The old secret stops verifying immediately — there is no grace window, so update the receiver before rotating",
        "tags": [
          "Support"
        ],
        "x-mcp-tool": "support_webhook_rotate_secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "eventTypes",
                    "status",
                    "description",
                    "secretPrefix",
                    "createdAt",
                    "updatedAt",
                    "secret"
                  ],
                  "properties": {
                    "id": {
                      "description": "Webhook id",
                      "type": "string",
                      "format": "uuid"
                    },
                    "url": {
                      "description": "HTTPS endpoint events are POSTed to",
                      "type": "string"
                    },
                    "secret": {
                      "description": "The signing secret in clear. Shown exactly once, here — store it now; it cannot be read back and can only be replaced by rotating it",
                      "type": "string"
                    },
                    "status": {
                      "description": "active or disabled",
                      "type": "string",
                      "enum": [
                        "active",
                        "disabled"
                      ]
                    },
                    "createdAt": {
                      "description": "ISO-8601 creation timestamp",
                      "type": "string"
                    },
                    "updatedAt": {
                      "description": "ISO-8601 last-update timestamp",
                      "type": "string"
                    },
                    "eventTypes": {
                      "description": "Event types this endpoint subscribes to",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "description": {
                      "description": "Free-form note, or null",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secretPrefix": {
                      "description": "First characters of the signing secret, to tell endpoints apart. Never the whole secret",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/catalog": {
      "get": {
        "operationId": "tracking_event-names_list",
        "summary": "List the event-name catalog for the current product with counts, first/last seen, sampled prop keys, and status.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_event-names_list",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status; omit for all",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "archived"
              ]
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match on the event name",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort column (default count)",
            "schema": {
              "type": "string",
              "enum": [
                "count",
                "last_seen",
                "first_seen",
                "name"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort direction (default desc)",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "names"
                  ],
                  "properties": {
                    "names": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "count",
                          "firstSeen",
                          "lastSeen",
                          "propsKeys",
                          "status",
                          "isConversion"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "count": {
                            "type": "number"
                          },
                          "status": {
                            "type": "string"
                          },
                          "lastSeen": {
                            "type": "string"
                          },
                          "firstSeen": {
                            "type": "string"
                          },
                          "propsKeys": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "isConversion": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/catalog/archive": {
      "post": {
        "operationId": "tracking_event-names_archive",
        "summary": "Archive an event name (hides it from dashboards only; ingestion and counts continue unchanged).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_event-names_archive",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "The event name to archive/unarchive",
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "status"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "archived"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/catalog/unarchive": {
      "post": {
        "operationId": "tracking_event-names_unarchive",
        "summary": "Unarchive an event name (restores its visibility in dashboards).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_event-names_unarchive",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "The event name to archive/unarchive",
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "name",
                    "status"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "archived"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/domains": {
      "get": {
        "operationId": "tracking_domains_list",
        "summary": "List the product's custom domains and tracking-host bindings",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_domains_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "domains",
                    "bindings"
                  ],
                  "properties": {
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "domainId",
                          "domain",
                          "mode",
                          "createdAt",
                          "extensionCount"
                        ],
                        "properties": {
                          "mode": {
                            "type": "string",
                            "enum": [
                              "external",
                              "managed"
                            ]
                          },
                          "domain": {
                            "type": "string"
                          },
                          "domainId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "extensionCount": {
                            "type": "number"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "bindings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "productId",
                          "domainId",
                          "bindingId",
                          "host",
                          "status",
                          "statusDetail",
                          "records",
                          "ownerExtension",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "host": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "active",
                              "failed"
                            ]
                          },
                          "records": {
                            "type": "array",
                            "items": {}
                          },
                          "domainId": {
                            "type": "string"
                          },
                          "bindingId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "productId": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "statusDetail": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "ownerExtension": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "tracking_domains_create",
        "summary": "Claim a first-party tracking host under a product domain",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_domains_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domainId": {
                    "type": "string"
                  },
                  "host": {
                    "type": "string"
                  },
                  "records": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "recordType",
                        "target"
                      ],
                      "properties": {
                        "ttl": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "target": {
                          "type": "string"
                        },
                        "recordType": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "domainId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "binding",
                    "instructions"
                  ],
                  "properties": {
                    "binding": {
                      "type": "object",
                      "required": [
                        "productId",
                        "domainId",
                        "bindingId",
                        "host",
                        "status",
                        "statusDetail",
                        "records",
                        "ownerExtension",
                        "createdAt",
                        "updatedAt"
                      ],
                      "properties": {
                        "host": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "active",
                            "failed"
                          ]
                        },
                        "records": {
                          "type": "array",
                          "items": {}
                        },
                        "domainId": {
                          "type": "string"
                        },
                        "bindingId": {
                          "type": "string"
                        },
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "productId": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "statusDetail": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "ownerExtension": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "instructions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/domains/{bindingId}": {
      "delete": {
        "operationId": "tracking_domains_delete",
        "summary": "Release a tracking-host binding",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_domains_delete",
        "parameters": [
          {
            "name": "bindingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "tracking_domains_get",
        "summary": "Get one tracking-host binding and its status",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_domains_get",
        "parameters": [
          {
            "name": "bindingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "domainId",
                    "bindingId",
                    "host",
                    "status",
                    "statusDetail",
                    "records",
                    "ownerExtension",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "active",
                        "failed"
                      ]
                    },
                    "records": {
                      "type": "array",
                      "items": {}
                    },
                    "domainId": {
                      "type": "string"
                    },
                    "bindingId": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "statusDetail": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ownerExtension": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/domains/{bindingId}/verify": {
      "post": {
        "operationId": "tracking_domains_verify",
        "summary": "Run an immediate liveness check for a pending binding",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_domains_verify",
        "parameters": [
          {
            "name": "bindingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "domainId",
                    "bindingId",
                    "host",
                    "status",
                    "statusDetail",
                    "records",
                    "ownerExtension",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "active",
                        "failed"
                      ]
                    },
                    "records": {
                      "type": "array",
                      "items": {}
                    },
                    "domainId": {
                      "type": "string"
                    },
                    "bindingId": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "statusDetail": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ownerExtension": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/connection": {
      "get": {
        "operationId": "tracking_googleads_connection_status",
        "summary": "Google Ads connection status for the current product: whether a Google Ads account is connected and which account (loginCustomerId / customerId), or whether it still needs account selection or re-auth.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_connection_status",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "state",
                        "loginCustomerId",
                        "customerId"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "const": "connected"
                        },
                        "customerId": {
                          "type": "string"
                        },
                        "loginCustomerId": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "const": "pending_account_selection"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "const": "reauth_required"
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "required": [
                        "state"
                      ],
                      "properties": {
                        "state": {
                          "type": "string",
                          "const": "not_connected"
                        }
                      },
                      "additionalProperties": false
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/feedback/config": {
      "get": {
        "operationId": "tracking_googleads_feedback_config_get",
        "summary": "Get the Google Ads conversion-feedback config for the current product (enabled, mode, lookbackDays, event→conversion-action rules, accountCurrency — the connected account's currency, best-effort, null if unavailable — useful for defaulting a fixed-value rule's currency, and dynamicValueEvents — the revenue-eligible event-names that may use the Dynamic value source).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_feedback_config_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "enabled",
                    "mode",
                    "lookbackDays",
                    "rules",
                    "enhancedConversions",
                    "accountCurrency",
                    "dynamicValueEvents"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "existing_pixel",
                        "fresh_pixel"
                      ]
                    },
                    "rules": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "event",
                          "conversionAction",
                          "enabled",
                          "value"
                        ],
                        "properties": {
                          "event": {
                            "type": "string"
                          },
                          "value": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "source"
                                ],
                                "properties": {
                                  "source": {
                                    "type": "string",
                                    "const": "revenue"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "source"
                                ],
                                "properties": {
                                  "source": {
                                    "type": "string",
                                    "const": "dynamic"
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "required": [
                                  "source",
                                  "amountMinor",
                                  "currency"
                                ],
                                "properties": {
                                  "source": {
                                    "type": "string",
                                    "const": "fixed"
                                  },
                                  "currency": {
                                    "type": "string"
                                  },
                                  "amountMinor": {
                                    "type": "number"
                                  }
                                },
                                "additionalProperties": false
                              }
                            ]
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "conversionAction": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "lookbackDays": {
                      "type": "number"
                    },
                    "accountCurrency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dynamicValueEvents": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enhancedConversions": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "tracking_googleads_feedback_config_set",
        "summary": "Set the Google Ads conversion-feedback config (enable/disable, mode, lookback, rules, enhancedConversions).",
        "description": "Set the Google Ads conversion-feedback config (enable/disable, mode, lookback, rules, enhancedConversions). enhancedConversions adds hashed email/phone as additive match keys alongside gclid. Returns the config plus safety guidance. Rules are validated against the account's conversion actions.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_feedback_config_set",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "enabled": {
                    "description": "Master switch for conversion feedback (default off)",
                    "type": "boolean"
                  },
                  "mode": {
                    "description": "existing_pixel = fill gaps; fresh_pixel = our data only",
                    "type": "string",
                    "enum": [
                      "existing_pixel",
                      "fresh_pixel"
                    ]
                  },
                  "lookbackDays": {
                    "description": "Click lookback window for gclid match (<=90)",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 90
                  },
                  "rules": {
                    "description": "Map a tracked event to a Google conversion action with a per-rule value (net revenue or a fixed amount)",
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "event",
                        "conversionAction",
                        "enabled",
                        "value"
                      ],
                      "properties": {
                        "event": {
                          "description": "Any tracked event-name for this product (validated against the event-name catalog)",
                          "type": "string",
                          "minLength": 1
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "object",
                              "required": [
                                "source"
                              ],
                              "properties": {
                                "source": {
                                  "type": "string",
                                  "const": "revenue"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "source"
                              ],
                              "properties": {
                                "source": {
                                  "type": "string",
                                  "const": "dynamic"
                                }
                              },
                              "additionalProperties": false
                            },
                            {
                              "type": "object",
                              "required": [
                                "source",
                                "currency"
                              ],
                              "properties": {
                                "source": {
                                  "type": "string",
                                  "const": "fixed"
                                },
                                "currency": {
                                  "description": "ISO-4217 currency code, e.g. USD",
                                  "type": "string",
                                  "pattern": "^[A-Z]{3}$"
                                },
                                "amountMinor": {
                                  "description": "Fixed conversion value in minor units (e.g. cents); 0 = value-less lead conversion",
                                  "type": "integer",
                                  "default": 0,
                                  "minimum": 0
                                }
                              },
                              "additionalProperties": false
                            }
                          ]
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "conversionAction": {
                          "description": "Google conversion action resource: customers/<cid>/conversionActions/<id>",
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "enhancedConversions": {
                    "description": "Enhanced conversions: also send hashed email/phone as additive match keys alongside gclid (default off)",
                    "type": "boolean"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "config",
                    "guidance"
                  ],
                  "properties": {
                    "config": {
                      "type": "object",
                      "required": [
                        "productId",
                        "enabled",
                        "mode",
                        "lookbackDays",
                        "rules",
                        "enhancedConversions"
                      ],
                      "properties": {
                        "mode": {
                          "type": "string",
                          "enum": [
                            "existing_pixel",
                            "fresh_pixel"
                          ]
                        },
                        "rules": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "event",
                              "conversionAction",
                              "enabled",
                              "value"
                            ],
                            "properties": {
                              "event": {
                                "type": "string"
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "object",
                                    "required": [
                                      "source"
                                    ],
                                    "properties": {
                                      "source": {
                                        "type": "string",
                                        "const": "revenue"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "required": [
                                      "source"
                                    ],
                                    "properties": {
                                      "source": {
                                        "type": "string",
                                        "const": "dynamic"
                                      }
                                    },
                                    "additionalProperties": false
                                  },
                                  {
                                    "type": "object",
                                    "required": [
                                      "source",
                                      "amountMinor",
                                      "currency"
                                    ],
                                    "properties": {
                                      "source": {
                                        "type": "string",
                                        "const": "fixed"
                                      },
                                      "currency": {
                                        "type": "string"
                                      },
                                      "amountMinor": {
                                        "type": "number"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                ]
                              },
                              "enabled": {
                                "type": "boolean"
                              },
                              "conversionAction": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "enabled": {
                          "type": "boolean"
                        },
                        "productId": {
                          "type": "string"
                        },
                        "lookbackDays": {
                          "type": "number"
                        },
                        "accountCurrency": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "enhancedConversions": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "guidance": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/feedback/conversion-actions": {
      "get": {
        "operationId": "tracking_googleads_conversion_actions",
        "summary": "List the connected Google Ads account's conversion actions (resource, name, category, status) so you can map a tracked event to a Google conversion action with a per-rule value (net revenue or a fixed amount).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_conversion_actions",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "resourceName",
                      "id",
                      "name",
                      "category",
                      "status"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "category": {
                        "type": "string"
                      },
                      "resourceName": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/feedback/run": {
      "post": {
        "operationId": "tracking_googleads_feedback_run",
        "summary": "Manually run one conversion-feedback upload pass for the current product now (uploads newly-attributed conversions across all enabled rules since the last run).",
        "description": "Manually run one conversion-feedback upload pass for the current product now (uploads newly-attributed conversions across all enabled rules since the last run). Useful for testing; the daily cron runs this automatically.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_feedback_run",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "selected",
                    "matched",
                    "noGclid",
                    "zeroValue",
                    "uploaded",
                    "failed"
                  ],
                  "properties": {
                    "failed": {
                      "type": "number"
                    },
                    "matched": {
                      "type": "number"
                    },
                    "noGclid": {
                      "type": "number"
                    },
                    "skipped": {
                      "type": "string",
                      "enum": [
                        "disabled",
                        "no_rules",
                        "not_connected"
                      ]
                    },
                    "selected": {
                      "type": "number"
                    },
                    "uploaded": {
                      "type": "number"
                    },
                    "productId": {
                      "type": "string"
                    },
                    "zeroValue": {
                      "type": "number"
                    },
                    "partialFailureError": {}
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/feedback/status": {
      "get": {
        "operationId": "tracking_googleads_feedback_status",
        "summary": "Google Ads conversion-feedback status for the current product: enabled/mode, rule count, cumulative uploaded/failed counts, last-run coverage (selected vs matched vs uploaded, plus noGclid so gclid-match coverage is visible), safety guidance, accountCurrency (the connected account's currency, best-effort, null if unavailable), and dynamicValueEvents (the revenue-eligible event-names that may use the Dynamic value source).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_feedback_status",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "enabled",
                    "mode",
                    "lookbackDays",
                    "enhancedConversions",
                    "ruleCount",
                    "uploaded",
                    "failed",
                    "lastRun",
                    "guidance",
                    "accountCurrency",
                    "dynamicValueEvents"
                  ],
                  "properties": {
                    "mode": {
                      "type": "string",
                      "enum": [
                        "existing_pixel",
                        "fresh_pixel"
                      ]
                    },
                    "failed": {
                      "type": "number"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "lastRun": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "status",
                            "selected",
                            "matched",
                            "noGclid",
                            "zeroValue",
                            "uploaded",
                            "failed",
                            "ranAt"
                          ],
                          "properties": {
                            "ranAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "failed": {
                              "type": "number"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "ok",
                                "partial",
                                "not_connected"
                              ]
                            },
                            "matched": {
                              "type": "number"
                            },
                            "noGclid": {
                              "type": "number"
                            },
                            "selected": {
                              "type": "number"
                            },
                            "uploaded": {
                              "type": "number"
                            },
                            "zeroValue": {
                              "type": "number"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "guidance": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "uploaded": {
                      "type": "number"
                    },
                    "ruleCount": {
                      "type": "number"
                    },
                    "lookbackDays": {
                      "type": "number"
                    },
                    "accountCurrency": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "dynamicValueEvents": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "enhancedConversions": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/feedback/uploads": {
      "get": {
        "operationId": "tracking_googleads_feedback_uploads",
        "summary": "List the most recent Google Ads offline-conversion uploads for the current product (per-row ledger: conversionKey, gclid, conversionAction, conversionDatetime, valueMicros, currency, orderId, status, error, uploadedAt).",
        "description": "List the most recent Google Ads offline-conversion uploads for the current product (per-row ledger: conversionKey, gclid, conversionAction, conversionDatetime, valueMicros, currency, orderId, status, error, uploadedAt). Newest first. Query: limit (default 100, max 500).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_feedback_uploads",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "conversionKey",
                      "gclid",
                      "conversionAction",
                      "conversionDatetime",
                      "valueMicros",
                      "currency",
                      "orderId",
                      "status",
                      "error",
                      "uploadedAt"
                    ],
                    "properties": {
                      "error": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "gclid": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "orderId": {
                        "type": "string"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "uploadedAt": {
                        "type": "string"
                      },
                      "valueMicros": {
                        "type": "number"
                      },
                      "conversionKey": {
                        "type": "string"
                      },
                      "conversionAction": {
                        "type": "string"
                      },
                      "conversionDatetime": {
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/reports/roas": {
      "get": {
        "operationId": "tracking_googleads_roas_report",
        "summary": "Google Ads ROAS/CPA per campaign->ad_group->ad joining frozen cost rollups with attributed revenue.",
        "description": "Google Ads ROAS/CPA per campaign->ad_group->ad joining frozen cost rollups with attributed revenue. Attributed ROAS/CPA at campaign level; cost + platform metrics at every level. Currency-isolated; never summed across currencies. Query: from,to (ISO, required), model (last_click|first_click), lookbackDays (1-365), domain?, customerId?.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_roas_report",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "last_click",
                "first_click"
              ],
              "default": "last_click"
            }
          },
          {
            "name": "lookbackDays",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "from",
                    "to",
                    "model",
                    "lookbackDays",
                    "domain",
                    "accounts",
                    "unmatchedAttributed",
                    "computedAt"
                  ],
                  "properties": {
                    "to": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string",
                      "enum": [
                        "last_click",
                        "first_click"
                      ]
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "customerId",
                          "currency",
                          "costLastSyncedAt",
                          "stale",
                          "campaigns"
                        ],
                        "properties": {
                          "stale": {
                            "type": "boolean"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "campaigns": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "level",
                                "customerId",
                                "campaignId",
                                "adGroupId",
                                "adId",
                                "name",
                                "cost",
                                "attributed",
                                "roas",
                                "cpa",
                                "children"
                              ],
                              "properties": {
                                "cpa": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "adId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "cost": {
                                  "type": "object",
                                  "required": [
                                    "currency",
                                    "costMinor",
                                    "impressions",
                                    "clicks",
                                    "platformConversions",
                                    "platformConversionsValueMinor"
                                  ],
                                  "properties": {
                                    "clicks": {
                                      "type": "number"
                                    },
                                    "currency": {
                                      "type": "string"
                                    },
                                    "costMinor": {
                                      "type": "number"
                                    },
                                    "impressions": {
                                      "type": "number"
                                    },
                                    "platformConversions": {
                                      "type": "number"
                                    },
                                    "platformConversionsValueMinor": {
                                      "type": "number"
                                    }
                                  },
                                  "additionalProperties": false
                                },
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "roas": {
                                  "type": [
                                    "number",
                                    "null"
                                  ]
                                },
                                "level": {
                                  "type": "string",
                                  "enum": [
                                    "campaign",
                                    "ad_group",
                                    "ad"
                                  ]
                                },
                                "status": {
                                  "type": "string"
                                },
                                "children": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "level",
                                      "customerId",
                                      "campaignId",
                                      "adGroupId",
                                      "adId",
                                      "name",
                                      "cost",
                                      "attributed",
                                      "roas",
                                      "cpa",
                                      "children"
                                    ],
                                    "properties": {
                                      "cpa": {
                                        "type": [
                                          "number",
                                          "null"
                                        ]
                                      },
                                      "adId": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "cost": {
                                        "type": "object",
                                        "required": [
                                          "currency",
                                          "costMinor",
                                          "impressions",
                                          "clicks",
                                          "platformConversions",
                                          "platformConversionsValueMinor"
                                        ],
                                        "properties": {
                                          "clicks": {
                                            "type": "number"
                                          },
                                          "currency": {
                                            "type": "string"
                                          },
                                          "costMinor": {
                                            "type": "number"
                                          },
                                          "impressions": {
                                            "type": "number"
                                          },
                                          "platformConversions": {
                                            "type": "number"
                                          },
                                          "platformConversionsValueMinor": {
                                            "type": "number"
                                          }
                                        },
                                        "additionalProperties": false
                                      },
                                      "name": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "roas": {
                                        "type": [
                                          "number",
                                          "null"
                                        ]
                                      },
                                      "level": {
                                        "type": "string",
                                        "enum": [
                                          "campaign",
                                          "ad_group",
                                          "ad"
                                        ]
                                      },
                                      "status": {
                                        "type": "string"
                                      },
                                      "children": {
                                        "type": "array",
                                        "items": {}
                                      },
                                      "adGroupId": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      },
                                      "attributed": {
                                        "anyOf": [
                                          {
                                            "type": "object",
                                            "required": [
                                              "revenue",
                                              "accountCurrencyNetMinor",
                                              "conversions",
                                              "matchedBy"
                                            ],
                                            "properties": {
                                              "revenue": {
                                                "type": "array",
                                                "items": {
                                                  "type": "object",
                                                  "required": [
                                                    "currency",
                                                    "grossMinor",
                                                    "refundedMinor",
                                                    "netMinor"
                                                  ],
                                                  "properties": {
                                                    "currency": {
                                                      "type": "string"
                                                    },
                                                    "netMinor": {
                                                      "type": "number"
                                                    },
                                                    "grossMinor": {
                                                      "type": "number"
                                                    },
                                                    "refundedMinor": {
                                                      "type": "number"
                                                    }
                                                  },
                                                  "additionalProperties": false
                                                }
                                              },
                                              "matchedBy": {
                                                "anyOf": [
                                                  {
                                                    "type": "string",
                                                    "enum": [
                                                      "campaign_id",
                                                      "campaign_name",
                                                      "gclid"
                                                    ]
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "conversions": {
                                                "type": "number"
                                              },
                                              "accountCurrencyNetMinor": {
                                                "type": "number"
                                              }
                                            },
                                            "additionalProperties": false
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "campaignId": {
                                        "type": "string"
                                      },
                                      "customerId": {
                                        "type": "string"
                                      },
                                      "channelType": {
                                        "type": [
                                          "string",
                                          "null"
                                        ]
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "adGroupId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "attributed": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "required": [
                                        "revenue",
                                        "accountCurrencyNetMinor",
                                        "conversions",
                                        "matchedBy"
                                      ],
                                      "properties": {
                                        "revenue": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "required": [
                                              "currency",
                                              "grossMinor",
                                              "refundedMinor",
                                              "netMinor"
                                            ],
                                            "properties": {
                                              "currency": {
                                                "type": "string"
                                              },
                                              "netMinor": {
                                                "type": "number"
                                              },
                                              "grossMinor": {
                                                "type": "number"
                                              },
                                              "refundedMinor": {
                                                "type": "number"
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "matchedBy": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "enum": [
                                                "campaign_id",
                                                "campaign_name",
                                                "gclid"
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "conversions": {
                                          "type": "number"
                                        },
                                        "accountCurrencyNetMinor": {
                                          "type": "number"
                                        }
                                      },
                                      "additionalProperties": false
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "campaignId": {
                                  "type": "string"
                                },
                                "customerId": {
                                  "type": "string"
                                },
                                "channelType": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "customerId": {
                            "type": "string"
                          },
                          "costLastSyncedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "computedAt": {
                      "type": "string"
                    },
                    "lookbackDays": {
                      "type": "number"
                    },
                    "unmatchedAttributed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "utmCampaign",
                          "revenue",
                          "conversions"
                        ],
                        "properties": {
                          "revenue": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "currency",
                                "grossMinor",
                                "refundedMinor",
                                "netMinor"
                              ],
                              "properties": {
                                "currency": {
                                  "type": "string"
                                },
                                "netMinor": {
                                  "type": "number"
                                },
                                "grossMinor": {
                                  "type": "number"
                                },
                                "refundedMinor": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "conversions": {
                            "type": "number"
                          },
                          "utmCampaign": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/reports/us-vs-platform": {
      "get": {
        "operationId": "tracking_googleads_us_vs_platform",
        "summary": "Per-campaign comparison: our attributed revenue/conversions vs Google-reported conversions and conversions_value, within each account currency.",
        "description": "Per-campaign comparison: our attributed revenue/conversions vs Google-reported conversions and conversions_value, within each account currency. Query: from,to (ISO, required), model, lookbackDays, domain?, customerId?.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_us_vs_platform",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "last_click",
                "first_click"
              ],
              "default": "last_click"
            }
          },
          {
            "name": "lookbackDays",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "customerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "from",
                    "to",
                    "model",
                    "lookbackDays",
                    "domain",
                    "accounts",
                    "computedAt"
                  ],
                  "properties": {
                    "to": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string",
                      "enum": [
                        "last_click",
                        "first_click"
                      ]
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "customerId",
                          "currency",
                          "costLastSyncedAt",
                          "stale",
                          "rows"
                        ],
                        "properties": {
                          "rows": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "customerId",
                                "campaignId",
                                "name",
                                "currency",
                                "ourRevenueNetMinor",
                                "ourConversions",
                                "platformConversionsValueMinor",
                                "platformConversions"
                              ],
                              "properties": {
                                "name": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "currency": {
                                  "type": "string"
                                },
                                "campaignId": {
                                  "type": "string"
                                },
                                "customerId": {
                                  "type": "string"
                                },
                                "ourConversions": {
                                  "type": "number"
                                },
                                "ourRevenueNetMinor": {
                                  "type": "number"
                                },
                                "platformConversions": {
                                  "type": "number"
                                },
                                "platformConversionsValueMinor": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "stale": {
                            "type": "boolean"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "customerId": {
                            "type": "string"
                          },
                          "costLastSyncedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "computedAt": {
                      "type": "string"
                    },
                    "lookbackDays": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/sync": {
      "post": {
        "operationId": "tracking_googleads_sync_now",
        "summary": "Pull the current product's Google Ads campaign/ad-group/ad structure and daily spend/metrics into the reporting tables now (backfill window).",
        "description": "Pull the current product's Google Ads campaign/ad-group/ad structure and daily spend/metrics into the reporting tables now (backfill window). Returns per-table row counts. Skips gracefully if the account is pending selection or needs re-auth.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_sync_now",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "window",
                    "rows",
                    "lastSyncedAt"
                  ],
                  "properties": {
                    "rows": {
                      "type": "object",
                      "required": [
                        "campaigns",
                        "adGroups",
                        "ads",
                        "campaignDaily",
                        "adGroupDaily",
                        "adDaily"
                      ],
                      "properties": {
                        "ads": {
                          "type": "number"
                        },
                        "adDaily": {
                          "type": "number"
                        },
                        "adGroups": {
                          "type": "number"
                        },
                        "campaigns": {
                          "type": "number"
                        },
                        "adGroupDaily": {
                          "type": "number"
                        },
                        "campaignDaily": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "reason": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "ok",
                        "skipped"
                      ]
                    },
                    "window": {
                      "type": "object",
                      "required": [
                        "start",
                        "end"
                      ],
                      "properties": {
                        "end": {
                          "type": "string"
                        },
                        "start": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "lastSyncedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/googleads/tracking-health": {
      "get": {
        "operationId": "tracking_googleads_tracking_health",
        "summary": "Google Ads URL-tracking health for the current product over a date range: how many Google paid clicks arrived, how many carried our ValueTrack URL parameters (marker _lt_campaign) vs how many were UNTAGGED (template not installed / broken), the breakage rate, whether the template is verified live, first/last untagged times, sample offending landing URLs.",
        "description": "Google Ads URL-tracking health for the current product over a date range: how many Google paid clicks arrived, how many carried our ValueTrack URL parameters (marker _lt_campaign) vs how many were UNTAGGED (template not installed / broken), the breakage rate, whether the template is verified live, first/last untagged times, sample offending landing URLs. Read-only; computed on the fly from stored events (no Google Ads API call). dataQuality describes how complete the figures above are and holds no metric of its own: dataQuality.cookielessPaidClicks is how many of the paid clicks arrived cookieless (the visitor declined consent) — counted INSIDE paidClicks, never added to it, because a cookieless paid click is a real click and belongs in the breakage denominator. It is broken out so breakageRate is not read as one homogeneous population. Clicks from sites running no consent banner at all are NOT counted as cookieless: nobody was ever asked there, which is not the same as being told no.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_googleads_tracking_health",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Range start (ISO); defaults to 30 days ago",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Range end (ISO); defaults to now",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "from",
                    "to",
                    "paidClicks",
                    "taggedClicks",
                    "untaggedClicks",
                    "breakageRate",
                    "dataQuality",
                    "installed",
                    "firstUntaggedAt",
                    "lastUntaggedAt",
                    "sampleUntaggedUrls",
                    "truncated"
                  ],
                  "properties": {
                    "to": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "installed": {
                      "type": "boolean"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "paidClicks": {
                      "type": "number"
                    },
                    "dataQuality": {
                      "type": "object",
                      "required": [
                        "cookielessPaidClicks"
                      ],
                      "properties": {
                        "cookielessPaidClicks": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "breakageRate": {
                      "type": "number"
                    },
                    "taggedClicks": {
                      "type": "number"
                    },
                    "lastUntaggedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "untaggedClicks": {
                      "type": "number"
                    },
                    "firstUntaggedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "sampleUntaggedUrls": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/identity/health": {
      "get": {
        "operationId": "tracking_identity_health",
        "summary": "Identity match-rate metric: share of identified profiles and share with an ad touchpoint (proxy = has >=1 click_id identifier).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_identity_health",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "totalProfiles",
                    "identifiedProfiles",
                    "identifiedRate",
                    "adTouchpointProfiles",
                    "adTouchpointRate",
                    "computedAt"
                  ],
                  "properties": {
                    "computedAt": {
                      "type": "string"
                    },
                    "totalProfiles": {
                      "type": "number"
                    },
                    "identifiedRate": {
                      "type": "number"
                    },
                    "adTouchpointRate": {
                      "type": "number"
                    },
                    "identifiedProfiles": {
                      "type": "number"
                    },
                    "adTouchpointProfiles": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/install/domains": {
      "get": {
        "operationId": "tracking_install-domains_list",
        "summary": "List install-verification domains for the current product with per-domain \"script seen\" status, plus auto-discovered domains sending events",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_install-domains_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "registered",
                    "discovered",
                    "windowDays"
                  ],
                  "properties": {
                    "discovered": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "domain",
                          "seen",
                          "lastSeen",
                          "registered"
                        ],
                        "properties": {
                          "seen": {
                            "type": "boolean"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "lastSeen": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "registered": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "registered": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "domain",
                          "seen",
                          "lastSeen",
                          "registered"
                        ],
                        "properties": {
                          "seen": {
                            "type": "boolean"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "lastSeen": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "registered": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "windowDays": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "tracking_install-domains_create",
        "summary": "Register a domain in the install-verification checklist for the current product",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_install-domains_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "description": "Domain to add to the install checklist (e.g. acme.com)",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "required": [
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "domain"
                  ],
                  "properties": {
                    "domain": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/install/domains/{domain}": {
      "delete": {
        "operationId": "tracking_install-domains_delete",
        "summary": "Remove a domain from the install-verification checklist for the current product",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_install-domains_delete",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "Registered domain to remove from the checklist",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/link/domains": {
      "get": {
        "operationId": "tracking_link-domains_list",
        "summary": "List the cross-domain linking group (domains whose links the tracking script decorates with the visitor id) for the current product",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_link-domains_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "domains"
                  ],
                  "properties": {
                    "domains": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "tracking_link-domains_create",
        "summary": "Add a root domain to the cross-domain linking group for the current product",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_link-domains_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "description": "Root domain to add to the cross-domain linking group (e.g. acme.io)",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  }
                },
                "required": [
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "domain"
                  ],
                  "properties": {
                    "domain": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/link/domains/{domain}": {
      "delete": {
        "operationId": "tracking_link-domains_delete",
        "summary": "Remove a root domain from the cross-domain linking group for the current product",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_link-domains_delete",
        "parameters": [
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "Root domain to remove from the cross-domain linking group",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/live": {
      "get": {
        "operationId": "tracking_live-events_list",
        "summary": "List the most recent tracking events for the current product (live visitor stream).",
        "description": "List the most recent tracking events for the current product (live visitor stream). Cursor-paged for incremental polling.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_live-events_list",
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from a previous response; omit for the newest events",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "description": "Filter to a single domain (e.g. acme.com)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max events to return (default 50, max 200)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events",
                    "cursor"
                  ],
                  "properties": {
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "ts",
                          "name",
                          "domain",
                          "url",
                          "title",
                          "country",
                          "anonymousId",
                          "source"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "ts": {
                            "type": "string"
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "domain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": "object",
                            "required": [
                              "utmSource",
                              "utmMedium",
                              "utmCampaign",
                              "referrer",
                              "clickIdType"
                            ],
                            "properties": {
                              "referrer": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "utmMedium": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "utmSource": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "clickIdType": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "utmCampaign": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "anonymousId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/profiles": {
      "get": {
        "operationId": "tracking_profiles_list",
        "summary": "List/search people (profiles) for the product; filter by email and status, cursor-paged.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_profiles_list",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Exact email to find (case-insensitive), or a prefix when emailMatch=prefix",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "emailMatch",
            "in": "query",
            "required": false,
            "description": "How to match the email filter",
            "schema": {
              "type": "string",
              "enum": [
                "exact",
                "prefix"
              ],
              "default": "exact"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by profile status",
            "schema": {
              "type": "string",
              "enum": [
                "anonymous",
                "identified",
                "customer"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Max profiles per page (default 25, max 100)",
            "schema": {
              "type": "integer",
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque pagination cursor from a previous response",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "profiles",
                    "cursor"
                  ],
                  "properties": {
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "profiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "profileId",
                          "status",
                          "emails",
                          "firstSeenAt",
                          "lastSeenAt",
                          "acquisition"
                        ],
                        "properties": {
                          "emails": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "anonymous",
                              "identified",
                              "customer"
                            ]
                          },
                          "profileId": {
                            "type": "string"
                          },
                          "lastSeenAt": {
                            "type": "string"
                          },
                          "acquisition": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "utmSource",
                                  "utmMedium",
                                  "utmCampaign",
                                  "clickIdType",
                                  "firstSeenAt"
                                ],
                                "properties": {
                                  "utmMedium": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmSource": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "clickIdType": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "firstSeenAt": {
                                    "type": "string"
                                  },
                                  "utmCampaign": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "firstSeenAt": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/profiles/{profileId}": {
      "delete": {
        "operationId": "tracking_profiles_delete",
        "summary": "GDPR erasure: permanently delete a person and their events from Postgres and record an erasure request.",
        "description": "GDPR erasure: permanently delete a person and their events from Postgres and record an erasure request. Archived events are flagged as a deletion gap.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_profiles_delete",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "description": "The profile id (uuid)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "profileId",
                    "deleted",
                    "archive"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean",
                      "const": true
                    },
                    "archive": {
                      "type": "object",
                      "required": [
                        "status",
                        "erasureRequestId",
                        "note"
                      ],
                      "properties": {
                        "note": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "const": "gap_flagged"
                        },
                        "erasureRequestId": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "deleted": {
                      "type": "object",
                      "required": [
                        "profile",
                        "identifiers",
                        "merges",
                        "events"
                      ],
                      "properties": {
                        "events": {
                          "type": "number"
                        },
                        "merges": {
                          "type": "number"
                        },
                        "profile": {
                          "type": "number"
                        },
                        "identifiers": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "profileId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "tracking_profiles_get",
        "summary": "Get one person: profile, identity signals, and their chronological journey (query-time join over the person's anonymous ids).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_profiles_get",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "description": "The profile id (uuid)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "journeyCursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor to page further back through the journey",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "journeyLimit",
            "in": "query",
            "required": false,
            "description": "Journey events per page (default 100, max 200)",
            "schema": {
              "type": "integer",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "profile",
                    "acquisition",
                    "signals",
                    "journey",
                    "ltv"
                  ],
                  "properties": {
                    "ltv": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "profileId",
                            "entries",
                            "computedAt"
                          ],
                          "properties": {
                            "entries": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "required": [
                                  "currency",
                                  "grossMinor",
                                  "refundedMinor",
                                  "netMinor",
                                  "firstPaymentAt",
                                  "lastPaymentAt"
                                ],
                                "properties": {
                                  "currency": {
                                    "type": "string"
                                  },
                                  "netMinor": {
                                    "type": "number"
                                  },
                                  "grossMinor": {
                                    "type": "number"
                                  },
                                  "lastPaymentAt": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "refundedMinor": {
                                    "type": "number"
                                  },
                                  "firstPaymentAt": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              }
                            },
                            "profileId": {
                              "type": "string"
                            },
                            "computedAt": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "journey": {
                      "type": "object",
                      "required": [
                        "events",
                        "cursor"
                      ],
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "ref",
                              "ts",
                              "name",
                              "domain",
                              "url",
                              "title",
                              "referrer",
                              "country",
                              "sessionId",
                              "source",
                              "props"
                            ],
                            "properties": {
                              "ts": {
                                "type": "string"
                              },
                              "ref": {
                                "type": "string"
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "props": {
                                "type": "object",
                                "additionalProperties": {}
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "domain": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "source": {
                                "type": "object",
                                "required": [
                                  "utmSource",
                                  "utmMedium",
                                  "utmCampaign",
                                  "utmTerm",
                                  "utmContent",
                                  "clickIdType",
                                  "clickId"
                                ],
                                "properties": {
                                  "clickId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmTerm": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmMedium": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmSource": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmContent": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "clickIdType": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmCampaign": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "country": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "referrer": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sessionId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "profile": {
                      "type": "object",
                      "required": [
                        "profileId",
                        "status",
                        "firstSeenAt",
                        "lastSeenAt",
                        "createdAt"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "anonymous",
                            "identified",
                            "customer"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "profileId": {
                          "type": "string"
                        },
                        "lastSeenAt": {
                          "type": "string"
                        },
                        "firstSeenAt": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "signals": {
                      "type": "object",
                      "required": [
                        "emails",
                        "phones",
                        "clickIds",
                        "domains"
                      ],
                      "properties": {
                        "emails": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "phones": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "domains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "clickIds": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "type",
                              "value"
                            ],
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "acquisition": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "utmSource",
                            "utmMedium",
                            "utmCampaign",
                            "clickIdType",
                            "firstSeenAt"
                          ],
                          "properties": {
                            "utmMedium": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "utmSource": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "clickIdType": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "firstSeenAt": {
                              "type": "string"
                            },
                            "utmCampaign": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/profiles/{profileId}/export": {
      "get": {
        "operationId": "tracking_profiles_export",
        "summary": "Export a person as JSON: profile + identity signals + full journey (capped at 50k events; truncated flag set if exceeded).",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_profiles_export",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "description": "The profile id (uuid)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "profile",
                    "acquisition",
                    "signals",
                    "journey",
                    "truncated",
                    "exportedAt"
                  ],
                  "properties": {
                    "journey": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "ref",
                          "ts",
                          "name",
                          "domain",
                          "url",
                          "title",
                          "referrer",
                          "country",
                          "sessionId",
                          "source",
                          "props"
                        ],
                        "properties": {
                          "ts": {
                            "type": "string"
                          },
                          "ref": {
                            "type": "string"
                          },
                          "url": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "props": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "title": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "domain": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "source": {
                            "type": "object",
                            "required": [
                              "utmSource",
                              "utmMedium",
                              "utmCampaign",
                              "utmTerm",
                              "utmContent",
                              "clickIdType",
                              "clickId"
                            ],
                            "properties": {
                              "clickId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "utmTerm": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "utmMedium": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "utmSource": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "utmContent": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "clickIdType": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "utmCampaign": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": false
                          },
                          "country": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "referrer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "sessionId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "profile": {
                      "type": "object",
                      "required": [
                        "profileId",
                        "status",
                        "firstSeenAt",
                        "lastSeenAt",
                        "createdAt"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "anonymous",
                            "identified",
                            "customer"
                          ]
                        },
                        "createdAt": {
                          "type": "string"
                        },
                        "profileId": {
                          "type": "string"
                        },
                        "lastSeenAt": {
                          "type": "string"
                        },
                        "firstSeenAt": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "signals": {
                      "type": "object",
                      "required": [
                        "emails",
                        "phones",
                        "clickIds",
                        "domains"
                      ],
                      "properties": {
                        "emails": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "phones": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "domains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "clickIds": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "type",
                              "value"
                            ],
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "exportedAt": {
                      "type": "string"
                    },
                    "acquisition": {
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "utmSource",
                            "utmMedium",
                            "utmCampaign",
                            "clickIdType",
                            "firstSeenAt"
                          ],
                          "properties": {
                            "utmMedium": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "utmSource": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "clickIdType": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "firstSeenAt": {
                              "type": "string"
                            },
                            "utmCampaign": {
                              "type": [
                                "string",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/reports/attributed-journey/{profileId}": {
      "get": {
        "operationId": "tracking_reports_attributed_journey",
        "summary": "One person's journey with, for their originating conversion, the attribution decision explained (winning touchpoint + why) under the requested model and lookback window.",
        "description": "One person's journey with, for their originating conversion, the attribution decision explained (winning touchpoint + why) under the requested model and lookback window. Attribution is never locked in — changing model/window re-reads the same history.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_reports_attributed_journey",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "description": "The profile id (uuid)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "last_click",
                "first_click"
              ],
              "default": "last_click"
            }
          },
          {
            "name": "lookbackDays",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "profileId",
                    "journey",
                    "decisions"
                  ],
                  "properties": {
                    "journey": {
                      "type": "object",
                      "required": [
                        "events"
                      ],
                      "properties": {
                        "events": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "ref",
                              "ts",
                              "name",
                              "domain",
                              "url",
                              "title",
                              "referrer",
                              "country",
                              "sessionId",
                              "source",
                              "props"
                            ],
                            "properties": {
                              "ts": {
                                "type": "string"
                              },
                              "ref": {
                                "type": "string"
                              },
                              "url": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "name": {
                                "type": "string"
                              },
                              "props": {
                                "type": "object",
                                "additionalProperties": {}
                              },
                              "title": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "domain": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "source": {
                                "type": "object",
                                "required": [
                                  "utmSource",
                                  "utmMedium",
                                  "utmCampaign",
                                  "utmTerm",
                                  "utmContent",
                                  "clickIdType",
                                  "clickId"
                                ],
                                "properties": {
                                  "clickId": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmTerm": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmMedium": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmSource": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmContent": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "clickIdType": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmCampaign": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              "country": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "referrer": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "sessionId": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            },
                            "additionalProperties": false
                          }
                        }
                      },
                      "additionalProperties": false
                    },
                    "decisions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "conversionTs",
                          "revenue",
                          "model",
                          "lookbackDays",
                          "winnerRef",
                          "winningTouchpoint",
                          "reason"
                        ],
                        "properties": {
                          "model": {
                            "type": "string",
                            "enum": [
                              "last_click",
                              "first_click"
                            ]
                          },
                          "reason": {
                            "type": "string"
                          },
                          "revenue": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "currency",
                                "grossMinor",
                                "refundedMinor",
                                "netMinor"
                              ],
                              "properties": {
                                "currency": {
                                  "type": "string"
                                },
                                "netMinor": {
                                  "type": "number"
                                },
                                "grossMinor": {
                                  "type": "number"
                                },
                                "refundedMinor": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "winnerRef": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "conversionTs": {
                            "type": "string"
                          },
                          "lookbackDays": {
                            "type": "number"
                          },
                          "winningTouchpoint": {
                            "anyOf": [
                              {
                                "type": "object",
                                "required": [
                                  "channel",
                                  "utmSource",
                                  "utmMedium",
                                  "utmCampaign",
                                  "clickIdType",
                                  "ts"
                                ],
                                "properties": {
                                  "ts": {
                                    "type": "string"
                                  },
                                  "channel": {
                                    "type": "string",
                                    "enum": [
                                      "paid",
                                      "organic",
                                      "direct",
                                      "email"
                                    ]
                                  },
                                  "utmMedium": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmSource": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "clickIdType": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "utmCampaign": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  }
                                },
                                "additionalProperties": false
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "profileId": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/reports/event-volume": {
      "get": {
        "operationId": "tracking_reports_event_volume",
        "summary": "Traffic for a date range as TWO headline figures plus a data-quality block.",
        "description": "Traffic for a date range as TWO headline figures plus a data-quality block. totalEvents counts events. visitorsDeduplicatedPerUtcDay counts PEOPLE, over both populations at once: visitors who consented are deduplicated by their anonymous_id, visitors who declined by a server-derived daily_visitor_key. It is one COUNT DISTINCT, not a sum of two figures, and there is no second set of numbers to add to it. READ THE FIELD NAME LITERALLY — the caveat is the metric, not a footnote. The daily key is rebuilt from a salt that is destroyed every UTC midnight, so the same declining visitor gets a DIFFERENT key tomorrow and is counted again. Consequences you must state whenever you report this number over more than one day: (1) weekly and monthly unique-visitor counts are OVERSTATED, and the longer the window the worse it gets — a visitor who comes back on ten days counts as ten people; (2) returning-visitor, retention, frequency and loyalty analysis DO NOT WORK on this traffic at all, because the identity that would link the days was never created. This is not a defect awaiting a fix and no post-processing recovers the real figure; Plausible, PostHog and Matomo concede the same limitation about their own daily keys. dataQuality.visitorsOverstated tells you whether it bites for the window you asked for (true when the range spans more than one UTC day and there is declining traffic in it), and dataQuality.utcDaysInRange is how many UTC days the range spans. For an exact people count, ask for a single UTC day. dataQuality describes how COMPLETE the two headline figures are and contains no metric of its own — never present anything inside it as a headline number and never add it to anything. cookielessShare and noBannerShare are the fractions of events that arrived from declining visitors and from sites running no consent banner. consentGrantedEvents + cookielessEvents + noBannerEvents = totalEvents. noBannerEvents (nobody was ever asked) is deliberately kept apart from cookielessEvents (the visitor declined); merging them would tell a customer people refused when nobody was asked. identifiedEvents is a DIFFERENT cut — events carrying an anonymous_id — that overlaps the consent buckets and is NOT the complement of cookielessEvents; never add those two together.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_reports_event_volume",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "from",
                    "to",
                    "domain",
                    "totalEvents",
                    "visitorsDeduplicatedPerUtcDay",
                    "dataQuality",
                    "computedAt"
                  ],
                  "properties": {
                    "to": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "computedAt": {
                      "type": "string"
                    },
                    "dataQuality": {
                      "type": "object",
                      "required": [
                        "cookielessShare",
                        "noBannerShare",
                        "consentGrantedEvents",
                        "cookielessEvents",
                        "noBannerEvents",
                        "identifiedEvents",
                        "visitorsOverstated",
                        "utcDaysInRange"
                      ],
                      "properties": {
                        "noBannerShare": {
                          "type": "number"
                        },
                        "noBannerEvents": {
                          "type": "number"
                        },
                        "utcDaysInRange": {
                          "type": "number"
                        },
                        "cookielessShare": {
                          "type": "number"
                        },
                        "cookielessEvents": {
                          "type": "number"
                        },
                        "identifiedEvents": {
                          "type": "number"
                        },
                        "visitorsOverstated": {
                          "type": "boolean"
                        },
                        "consentGrantedEvents": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "totalEvents": {
                      "type": "number"
                    },
                    "visitorsDeduplicatedPerUtcDay": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/reports/revenue-by-source": {
      "get": {
        "operationId": "tracking_reports_revenue_by_source",
        "summary": "Revenue attributed by channel + UTM breakdown for a date range, under a chosen attribution model and lookback window.",
        "description": "Revenue attributed by channel + UTM breakdown for a date range, under a chosen attribution model and lookback window. Includes a distinct unattributed row, totals, and a count-based match rate. Revenue is per-currency (never summed across currencies); refunds are netted explicitly.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_reports_revenue_by_source",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Cohort window start (ISO); selects conversions by subscription start",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "Cohort window end (ISO)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "description": "Attribution model",
            "schema": {
              "type": "string",
              "enum": [
                "last_click",
                "first_click"
              ],
              "default": "last_click"
            }
          },
          {
            "name": "lookbackDays",
            "in": "query",
            "required": false,
            "description": "Lookback window in days (default 30)",
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "description": "Only consider touchpoints on this domain",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "from",
                    "to",
                    "model",
                    "lookbackDays",
                    "domain",
                    "channels",
                    "unattributed",
                    "totals",
                    "matchRate",
                    "computedAt"
                  ],
                  "properties": {
                    "to": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string",
                      "enum": [
                        "last_click",
                        "first_click"
                      ]
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "totals": {
                      "type": "object",
                      "required": [
                        "revenue",
                        "customers"
                      ],
                      "properties": {
                        "revenue": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "currency",
                              "grossMinor",
                              "refundedMinor",
                              "netMinor"
                            ],
                            "properties": {
                              "currency": {
                                "type": "string"
                              },
                              "netMinor": {
                                "type": "number"
                              },
                              "grossMinor": {
                                "type": "number"
                              },
                              "refundedMinor": {
                                "type": "number"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "customers": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "channel",
                          "revenue",
                          "customers",
                          "utmBreakdown"
                        ],
                        "properties": {
                          "channel": {
                            "type": "string",
                            "enum": [
                              "paid",
                              "organic",
                              "direct",
                              "email"
                            ]
                          },
                          "revenue": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "currency",
                                "grossMinor",
                                "refundedMinor",
                                "netMinor"
                              ],
                              "properties": {
                                "currency": {
                                  "type": "string"
                                },
                                "netMinor": {
                                  "type": "number"
                                },
                                "grossMinor": {
                                  "type": "number"
                                },
                                "refundedMinor": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "customers": {
                            "type": "number"
                          },
                          "utmBreakdown": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "utmSource",
                                "utmMedium",
                                "utmCampaign",
                                "clickIdType",
                                "revenue",
                                "customers"
                              ],
                              "properties": {
                                "revenue": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "required": [
                                      "currency",
                                      "grossMinor",
                                      "refundedMinor",
                                      "netMinor"
                                    ],
                                    "properties": {
                                      "currency": {
                                        "type": "string"
                                      },
                                      "netMinor": {
                                        "type": "number"
                                      },
                                      "grossMinor": {
                                        "type": "number"
                                      },
                                      "refundedMinor": {
                                        "type": "number"
                                      }
                                    },
                                    "additionalProperties": false
                                  }
                                },
                                "customers": {
                                  "type": "number"
                                },
                                "utmMedium": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "utmSource": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "clickIdType": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "utmCampaign": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "matchRate": {
                      "type": "number"
                    },
                    "computedAt": {
                      "type": "string"
                    },
                    "lookbackDays": {
                      "type": "number"
                    },
                    "unattributed": {
                      "type": "object",
                      "required": [
                        "revenue",
                        "customers"
                      ],
                      "properties": {
                        "revenue": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "currency",
                              "grossMinor",
                              "refundedMinor",
                              "netMinor"
                            ],
                            "properties": {
                              "currency": {
                                "type": "string"
                              },
                              "netMinor": {
                                "type": "number"
                              },
                              "grossMinor": {
                                "type": "number"
                              },
                              "refundedMinor": {
                                "type": "number"
                              }
                            },
                            "additionalProperties": false
                          }
                        },
                        "customers": {
                          "type": "number"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/reports/source-people": {
      "get": {
        "operationId": "tracking_reports_source_people",
        "summary": "List the people (profiles) behind one channel / UTM row from the revenue-by-source report, under the same model + window.",
        "description": "List the people (profiles) behind one channel / UTM row from the revenue-by-source report, under the same model + window. Keyset-paginated; each person carries their attributed lifetime revenue per currency.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_reports_source_people",
        "parameters": [
          {
            "name": "channel",
            "in": "query",
            "required": true,
            "description": "Channel to drill into",
            "schema": {
              "type": "string",
              "enum": [
                "paid",
                "organic",
                "direct",
                "email"
              ]
            }
          },
          {
            "name": "utmSource",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "utmMedium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "utmCampaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clickIdType",
            "in": "query",
            "required": false,
            "description": "Native click-id type of the breakdown row to drill into (e.g. 'gclid'). Tri-state: omit for no filter (all click ids), pass a value to match it, or list 'clickIdType' in utmNulls to match the IS-NULL row.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "utmNulls",
            "in": "query",
            "required": false,
            "description": "Comma-separated dimension names (utmSource,utmMedium,utmCampaign,clickIdType) that must be IS NULL",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "last_click",
                "first_click"
              ],
              "default": "last_click"
            }
          },
          {
            "name": "lookbackDays",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque keyset cursor from a previous page",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "People per page (default 50, max 200)",
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "people",
                    "cursor"
                  ],
                  "properties": {
                    "cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "people": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "profileId",
                          "status",
                          "firstSeenAt",
                          "lastSeenAt",
                          "attributedRevenue"
                        ],
                        "properties": {
                          "status": {
                            "type": "string"
                          },
                          "profileId": {
                            "type": "string"
                          },
                          "lastSeenAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "firstSeenAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "attributedRevenue": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "currency",
                                "grossMinor",
                                "refundedMinor",
                                "netMinor"
                              ],
                              "properties": {
                                "currency": {
                                  "type": "string"
                                },
                                "netMinor": {
                                  "type": "number"
                                },
                                "grossMinor": {
                                  "type": "number"
                                },
                                "refundedMinor": {
                                  "type": "number"
                                }
                              },
                              "additionalProperties": false
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tracking/snippet": {
      "get": {
        "operationId": "tracking_snippets_get",
        "summary": "Get the tracking snippet for the caller's current product.",
        "description": "Get the tracking snippet for the caller's current product. Install it unconditionally. Do NOT wrap it in a consent gate and do NOT load it only after consent is granted: the tracker reads the visitor consent decision itself and switches to a cookieless mode that writes no cookies and sends no identifiers when statistics consent is declined or not yet given. Gating this tag makes declining and undecided visitors invisible entirely — the failure this behaviour exists to prevent.",
        "tags": [
          "Tracking"
        ],
        "x-mcp-tool": "tracking_snippets_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "scriptUrl",
                    "host",
                    "snippet",
                    "minimalSnippet"
                  ],
                  "properties": {
                    "host": {
                      "type": "string"
                    },
                    "snippet": {
                      "type": "string"
                    },
                    "scriptUrl": {
                      "type": "string"
                    },
                    "minimalSnippet": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/api-keys": {
      "get": {
        "operationId": "users_apikeys_list",
        "summary": "List this product's API keys, newest first — id, label, type, visible prefix and revocation state.",
        "description": "List this product's API keys, newest first — id, label, type, visible prefix and revocation state. A server key's secret is never here; a publishable key's full value is, because it is not a secret.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_apikeys_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "keys"
                  ],
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "type",
                          "prefix",
                          "value",
                          "createdAt",
                          "revokedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "server",
                              "publishable"
                            ]
                          },
                          "value": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "prefix": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "revokedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "users_apikeys_create",
        "summary": "Issue an API key for this product.",
        "description": "Issue an API key for this product. type='server' mints a secret backend key (usk_…) returned EXACTLY ONCE — it authenticates the code-exchange leg and is stored only as a hash, so a lost key must be replaced, never recovered. type='publishable' mints a non-secret browser key (upk_…) that only names this product and stays readable afterwards.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_apikeys_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "A label only humans read — which backend or environment holds this key.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "type": {
                    "description": "'server' mints a SECRET key (usk_…) for the Product's backend — returned exactly once and stored hashed. 'publishable' mints a non-secret key (upk_…) that identifies this product in browser flows and stays readable.",
                    "type": "string",
                    "enum": [
                      "server",
                      "publishable"
                    ]
                  }
                },
                "required": [
                  "name",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "type",
                    "prefix",
                    "value",
                    "createdAt",
                    "revokedAt",
                    "key"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string",
                      "enum": [
                        "server",
                        "publishable"
                      ]
                    },
                    "value": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "prefix": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "revokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/api-keys/{id}": {
      "delete": {
        "operationId": "users_apikeys_revoke",
        "summary": "Revoke an API key immediately.",
        "description": "Revoke an API key immediately. A revoked server key stops authenticating code exchanges on the next request; there is no grace period and no un-revoke.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_apikeys_revoke",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the key to revoke. Revocation is immediate and final.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "revoked"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "revoked": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/audit": {
      "get": {
        "operationId": "users_audit_list",
        "summary": "Read this product's audit log, newest first.",
        "description": "Read this product's audit log, newest first. Every management-plane mutation writes one entry (user.created, user.updated, user.deleted, user.banned, user.unbanned) with the actor, target and timestamp. Filter by action, target and time range; paginate with the opaque `nextCursor`.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_audit_list",
        "parameters": [
          {
            "name": "action",
            "in": "query",
            "required": false,
            "description": "Exact action to filter by, e.g. 'user.banned'. Omit for all actions.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "targetType",
            "in": "query",
            "required": false,
            "description": "Target kind to filter by, e.g. 'user'.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "targetId",
            "in": "query",
            "required": false,
            "description": "Exact id of the audited target, e.g. a user id.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "ISO-8601 lower bound (inclusive) on the event timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "ISO-8601 upper bound (exclusive) on the event timestamp.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1-100. Default 25.",
            "schema": {
              "allOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from a previous response's `nextCursor`. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "events",
                    "nextCursor"
                  ],
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "productId",
                          "actorType",
                          "actorId",
                          "action",
                          "targetType",
                          "targetId",
                          "ip",
                          "userAgent",
                          "metadata",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "ip": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "action": {
                            "type": "string"
                          },
                          "actorId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "metadata": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "targetId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "actorType": {
                            "type": "string",
                            "enum": [
                              "operator",
                              "system",
                              "end_user"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "productId": {
                            "type": "string"
                          },
                          "userAgent": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "targetType": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/config": {
      "get": {
        "operationId": "users_config_get",
        "summary": "Read this product's end-user auth configuration (signup mode, password policy, session lifetime).",
        "description": "Read this product's end-user auth configuration (signup mode, password policy, session lifetime). Returns the defaults when nothing has been configured yet.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_config_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "signupMode",
                    "passwordPolicy",
                    "sessionTtlHours",
                    "accessTokenTtlMinutes",
                    "refreshSlidingDays",
                    "refreshAbsoluteDays",
                    "redirectUriAllowlist",
                    "allowedOrigins",
                    "protection",
                    "captcha",
                    "email",
                    "recovery",
                    "emailChange",
                    "invite",
                    "waitlist",
                    "retention",
                    "testMode",
                    "mfa",
                    "passkeys",
                    "notifications",
                    "oauth",
                    "captchaSecretConfigured",
                    "status",
                    "lifecycleBlocked",
                    "lifecycleArchived"
                  ],
                  "properties": {
                    "mfa": {
                      "type": "object",
                      "required": [
                        "backupCodeCount",
                        "resetDelayHours",
                        "sensitiveAuthAgeMinutes",
                        "maxSecondFactorAttempts",
                        "maxBackupCodeAttempts",
                        "required",
                        "stepUpGrantMinutes"
                      ],
                      "properties": {
                        "required": {
                          "description": "Whether a second factor is MANDATORY for this product. When true, a user may not unenroll their last verified factor. Default false.",
                          "type": "boolean"
                        },
                        "backupCodeCount": {
                          "description": "How many single-use backup codes a batch contains. Default 10.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 20
                        },
                        "resetDelayHours": {
                          "description": "Mandatory delay on an operator-initiated factor reset, in hours — the abort window the user is emailed. Default 72.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 720
                        },
                        "stepUpGrantMinutes": {
                          "description": "How long a passed step-up challenge stays spendable, in minutes. The grant is SINGLE-USE regardless. Default 5.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 60
                        },
                        "maxBackupCodeAttempts": {
                          "description": "Wrong BACKUP codes before the account is locked, counted separately from TOTP. Default 5.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        },
                        "maxSecondFactorAttempts": {
                          "description": "Wrong second-factor codes before the account is locked. Default 5.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        },
                        "sensitiveAuthAgeMinutes": {
                          "description": "How recently the caller must have authenticated to enroll or regenerate a factor, in minutes. Default 10.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1440
                        }
                      },
                      "additionalProperties": false
                    },
                    "email": {
                      "type": "object",
                      "required": [
                        "from",
                        "codeEnabled",
                        "linkEnabled",
                        "linkBaseUrl",
                        "codeTtlMinutes",
                        "maxCodeAttempts",
                        "resendCooldownSeconds",
                        "resendDailyCap"
                      ],
                      "properties": {
                        "from": {
                          "description": "Sender for auth email, e.g. \"Acme <auth@acme.com>\". MUST be on a domain verified in this product's mail toolkit. While it is null, email_code/email_link are not offered as strategies.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "codeEnabled": {
                          "description": "Offer the 6-digit code strategy (email_code). Default true.",
                          "type": "boolean"
                        },
                        "linkBaseUrl": {
                          "description": "Base URL magic links point at, e.g. \"https://public.lessly.com/{productId}/users\". Null uses the deployment default.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "linkEnabled": {
                          "description": "Offer the magic-link strategy (email_link). Default true.",
                          "type": "boolean"
                        },
                        "codeTtlMinutes": {
                          "description": "How long an emailed code or link stays usable, in minutes. Default 15.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 60
                        },
                        "resendDailyCap": {
                          "description": "Auth emails one address may receive per day. Default 10.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 200
                        },
                        "maxCodeAttempts": {
                          "description": "Wrong-code entries allowed per token before it is spent. Default 5.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 20
                        },
                        "resendCooldownSeconds": {
                          "description": "Minimum seconds between two auth emails to one address. Floor of 60 is enforced regardless. Default 60.",
                          "type": "integer",
                          "minimum": 60,
                          "maximum": 3600
                        }
                      },
                      "additionalProperties": false
                    },
                    "oauth": {
                      "type": "object",
                      "required": [
                        "providers"
                      ],
                      "properties": {
                        "providers": {
                          "type": "object",
                          "required": [
                            "google",
                            "github"
                          ],
                          "properties": {
                            "github": {
                              "type": "object",
                              "required": [
                                "enabled",
                                "clientId",
                                "secretConfigured"
                              ],
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "clientId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "secretConfigured": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "google": {
                              "type": "object",
                              "required": [
                                "enabled",
                                "clientId",
                                "secretConfigured"
                              ],
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "clientId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "secretConfigured": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "invite": {
                      "type": "object",
                      "required": [
                        "ttlDays",
                        "resendCooldownMinutes"
                      ],
                      "properties": {
                        "ttlDays": {
                          "description": "How long an invite link stays usable, in days. Default 14.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 90
                        },
                        "resendCooldownMinutes": {
                          "description": "Minimum minutes between two invite emails to one address. Default 60.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10080
                        }
                      },
                      "additionalProperties": false
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused"
                      ]
                    },
                    "captcha": {
                      "type": "object",
                      "required": [
                        "provider",
                        "enabled",
                        "siteKey",
                        "riskElevated"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "siteKey": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "provider": {
                          "type": "string",
                          "enum": [
                            "turnstile"
                          ]
                        },
                        "riskElevated": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "passkeys": {
                      "type": "object",
                      "required": [
                        "enabled",
                        "rpId",
                        "rpName",
                        "requireUserVerification"
                      ],
                      "properties": {
                        "rpId": {
                          "description": "The WebAuthn Relying Party ID — the product's own domain, without a scheme or port. Leave null to derive it from `allowedOrigins`, which works whenever they all sit on one host. Set it to the shared PARENT domain when they do not (`example.com` covering `app.example.com` and `www.example.com`); it must cover EVERY allowed origin or passkeys stay off. CHANGING IT ORPHANS every credential already enrolled — an authenticator only ever asserts a credential back to the RP ID it was created for.",
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 253
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rpName": {
                          "description": "The user-visible relying-party name the operating system's passkey prompt shows. Defaults to the RP ID.",
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 255
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "enabled": {
                          "description": "Whether this product is a WebAuthn relying party: passkeys can be enrolled and offered as a sign-in strategy. Default false. Switching it on is not enough on its own — the product also needs at least one browser origin in `allowedOrigins` for the RP ID to be derived from.",
                          "type": "boolean"
                        },
                        "requireUserVerification": {
                          "description": "Whether the authenticator must verify the user (biometric, PIN) rather than merely being present. Default false, which asks for verification but accepts an assertion without it — at `aal1`. A verified assertion always mints `aal2`, whatever this says; setting it true refuses the unverified one outright.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "recovery": {
                      "type": "object",
                      "required": [
                        "enabled",
                        "ttlMinutes"
                      ],
                      "properties": {
                        "enabled": {
                          "description": "Offer the password-recovery flow at all. Default true.",
                          "type": "boolean"
                        },
                        "ttlMinutes": {
                          "description": "How long a reset link stays usable, in minutes. Default 60.",
                          "type": "integer",
                          "minimum": 5,
                          "maximum": 1440
                        }
                      },
                      "additionalProperties": false
                    },
                    "testMode": {
                      "type": "object",
                      "required": [
                        "enabled"
                      ],
                      "properties": {
                        "enabled": {
                          "description": "Opt this product into test mode. Refused outright on a production deployment — the environment gate is checked first and cannot be configured away. Turning it on is audited and raises an alert. Default false.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "waitlist": {
                      "type": "object",
                      "required": [
                        "widget",
                        "doubleOptIn",
                        "retentionDays",
                        "confirmTtlHours"
                      ],
                      "properties": {
                        "widget": {
                          "description": "The embeddable widget’s copy and colours.",
                          "type": "object",
                          "required": [
                            "title",
                            "description",
                            "buttonLabel",
                            "successMessage",
                            "consentText",
                            "policyVersion",
                            "policyUrl",
                            "accentColor"
                          ],
                          "properties": {
                            "title": {
                              "description": "Heading above the widget form.",
                              "type": "string",
                              "maxLength": 120
                            },
                            "policyUrl": {
                              "description": "Link rendered beside the consent text. Null renders no link.",
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 2048
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "accentColor": {
                              "description": "CSS colour for the button and the focus ring.",
                              "type": "string",
                              "maxLength": 32
                            },
                            "buttonLabel": {
                              "description": "Submit button copy.",
                              "type": "string",
                              "maxLength": 60
                            },
                            "consentText": {
                              "description": "Consent checkbox copy. Null renders no checkbox, and the signup records the consent proof as `unspecified`.",
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "description": {
                              "description": "One line under the heading.",
                              "type": "string",
                              "maxLength": 400
                            },
                            "policyVersion": {
                              "description": "The privacy-policy version the widget records in each consent proof.",
                              "type": "string",
                              "maxLength": 64
                            },
                            "successMessage": {
                              "description": "Shown after a submission. ONE message for every outcome: the signup route answers identically whether or not the address was already on the list.",
                              "type": "string",
                              "maxLength": 400
                            }
                          },
                          "additionalProperties": false
                        },
                        "doubleOptIn": {
                          "description": "Require a confirmation email before a waitlist signup counts. Default false — the entry is created either way, but an unconfirmed one is reported separately and is never invited.",
                          "type": "boolean"
                        },
                        "retentionDays": {
                          "description": "How long an UNCONVERTED waitlist entry — still pending, or invited and never registered — is kept, counted from SIGN-UP, before the sweep erases it. Default 180: Lessly Privacy Policy §6 promises deletion 6 months from sign-up. The bound stays wide because a client Product answers to its own privacy policy, not ours.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        },
                        "confirmTtlHours": {
                          "description": "How long a double-opt-in confirmation link stays usable, in hours. Default 48.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 168
                        }
                      },
                      "additionalProperties": false
                    },
                    "productId": {
                      "type": "string"
                    },
                    "retention": {
                      "type": "object",
                      "required": [
                        "oneTimeTokenDays",
                        "flowAttemptDays",
                        "expiredSessionDays"
                      ],
                      "properties": {
                        "flowAttemptDays": {
                          "description": "How long an EXPIRED flow attempt is kept after its own expiry. Default 0 — swept as soon as it dies, which is what the reaper did before this window existed.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "oneTimeTokenDays": {
                          "description": "How long a SPENT or EXPIRED one-time token row (an OTP, a magic link, a recovery or abort token) is kept after it stops being usable, for forensics. The secret is a hash and the row is already dead — this only decides how long the trail lives. Default 30.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "expiredSessionDays": {
                          "description": "How long an EXPIRED session and its refresh tokens are kept after expiry. Zero does not shorten any lifetime: a session past either window can never be refreshed again, so the row is already inert. Default 0.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        }
                      },
                      "additionalProperties": false
                    },
                    "protection": {
                      "type": "object",
                      "required": [
                        "maxFailedAttempts",
                        "failedAttemptWindowMinutes",
                        "lockoutMinutes",
                        "identifierAttemptsPerWindow",
                        "ipAttemptsPerWindow",
                        "hibpEnabled"
                      ],
                      "properties": {
                        "hibpEnabled": {
                          "description": "Check passwords against the HaveIBeenPwned breach corpus (k-anonymity). Blocking at sign-up, advisory at sign-in. Default true.",
                          "type": "boolean"
                        },
                        "lockoutMinutes": {
                          "description": "How long an account stays locked. Self-healing — the lock expires on its own. Default 15.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1440
                        },
                        "maxFailedAttempts": {
                          "description": "Failed sign-ins for one identifier before the account is locked. Default 10.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        },
                        "ipAttemptsPerWindow": {
                          "description": "Flow calls allowed per IP per product per window before HTTP 429. Default 120.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10000
                        },
                        "failedAttemptWindowMinutes": {
                          "description": "Sliding window the failed sign-ins are counted over, in minutes. Default 15.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1440
                        },
                        "identifierAttemptsPerWindow": {
                          "description": "Flow calls allowed per identifier per window before HTTP 429. Default 30.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000
                        }
                      },
                      "additionalProperties": false
                    },
                    "signupMode": {
                      "type": "string",
                      "enum": [
                        "public",
                        "invite-only",
                        "waitlist"
                      ]
                    },
                    "emailChange": {
                      "type": "object",
                      "required": [
                        "enabled",
                        "requestTtlHours",
                        "revertTtlDays",
                        "cooldownDays",
                        "overrideDelayHours"
                      ],
                      "properties": {
                        "enabled": {
                          "description": "Allow end users to change their email address. Default true.",
                          "type": "boolean"
                        },
                        "cooldownDays": {
                          "description": "How long after a REVERT further email changes are refused, in days. Default 7.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "revertTtlDays": {
                          "description": "How long the old address may undo the change, in days. Default 30.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 90
                        },
                        "requestTtlHours": {
                          "description": "How long the two confirmation links stay usable, in hours. Default 24.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 168
                        },
                        "overrideDelayHours": {
                          "description": "Mandatory delay on an operator-assisted override, in hours — the abort window the old address is notified with. Default 72.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 720
                        }
                      },
                      "additionalProperties": false
                    },
                    "notifications": {
                      "type": "object",
                      "required": [
                        "passwordChanged",
                        "newDevice",
                        "emailChange",
                        "impersonation"
                      ],
                      "properties": {
                        "newDevice": {
                          "description": "Email the user the first time a session appears from an unseen device. Default true.",
                          "type": "boolean"
                        },
                        "emailChange": {
                          "description": "Email the old address when an email change is requested, completed, reverted or overridden. Default true.",
                          "type": "boolean"
                        },
                        "impersonation": {
                          "description": "Email the user when an operator impersonates their account. Default true.",
                          "type": "boolean"
                        },
                        "passwordChanged": {
                          "description": "Email the user when their password is set or changed. Default true.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "allowedOrigins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "passwordPolicy": {
                      "type": "object",
                      "required": [
                        "minLength",
                        "requireUppercase",
                        "requireNumber",
                        "requireSymbol"
                      ],
                      "properties": {
                        "minLength": {
                          "description": "Minimum password length. Default 8.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 256
                        },
                        "requireNumber": {
                          "description": "Require at least one digit.",
                          "type": "boolean"
                        },
                        "requireSymbol": {
                          "description": "Require at least one non-alphanumeric character.",
                          "type": "boolean"
                        },
                        "requireUppercase": {
                          "description": "Require at least one uppercase letter.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "sessionTtlHours": {
                      "type": "integer"
                    },
                    "lifecycleBlocked": {
                      "type": "boolean"
                    },
                    "lifecycleArchived": {
                      "type": "boolean"
                    },
                    "refreshSlidingDays": {
                      "type": "integer"
                    },
                    "refreshAbsoluteDays": {
                      "type": "integer"
                    },
                    "redirectUriAllowlist": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "accessTokenTtlMinutes": {
                      "type": "integer"
                    },
                    "captchaSecretConfigured": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "users_config_upsert",
        "summary": "Create or update this product's end-user auth configuration.",
        "description": "Create or update this product's end-user auth configuration. Only the fields you pass change; the rest keep their current values. Rejected while the product is paused (archived or blocked by the platform).",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_config_upsert",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "signupMode": {
                    "description": "How end users may join this product: 'public' (anyone), 'invite-only', or 'waitlist'. Default 'public'.",
                    "type": "string",
                    "enum": [
                      "public",
                      "invite-only",
                      "waitlist"
                    ]
                  },
                  "passwordPolicy": {
                    "description": "Password rules for this product. Merged field-by-field into the current policy.",
                    "type": "object",
                    "properties": {
                      "minLength": {
                        "description": "Minimum password length. Default 8.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 256
                      },
                      "requireNumber": {
                        "description": "Require at least one digit.",
                        "type": "boolean"
                      },
                      "requireSymbol": {
                        "description": "Require at least one non-alphanumeric character.",
                        "type": "boolean"
                      },
                      "requireUppercase": {
                        "description": "Require at least one uppercase letter.",
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "sessionTtlHours": {
                    "description": "End-user session lifetime in hours. Default 720 (30 days).",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 8760
                  },
                  "accessTokenTtlMinutes": {
                    "description": "Access JWT lifetime in minutes, 5-60. Default 10. Short on purpose: a revoked session dies within one TTL.",
                    "type": "integer",
                    "minimum": 5,
                    "maximum": 60
                  },
                  "refreshSlidingDays": {
                    "description": "Inactivity window of a session in days — every refresh slides it forward. Default 30.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 365
                  },
                  "refreshAbsoluteDays": {
                    "description": "Hard time-box of a session in days, counted from sign-in and never extended. Default 365.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 3650
                  },
                  "redirectUriAllowlist": {
                    "description": "Callback URIs the browser code handoff may deliver a one-time authorization code to, up to 20. Matched EXACTLY — no wildcards, no prefixes, no fragments — so list every callback in full. Replaces the whole list.",
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string"
                    }
                  },
                  "allowedOrigins": {
                    "description": "Browser origins allowed to drive this product's end-user flows, up to 20. Scheme + host + port only, matched exactly. Replaces the whole list. Empty means \"no browser origin\" once this product has a publishable key.",
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string"
                    }
                  },
                  "protection": {
                    "description": "Rate limits, lockout and breached-password settings. Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "hibpEnabled": {
                        "description": "Check passwords against the HaveIBeenPwned breach corpus (k-anonymity). Blocking at sign-up, advisory at sign-in. Default true.",
                        "type": "boolean"
                      },
                      "lockoutMinutes": {
                        "description": "How long an account stays locked. Self-healing — the lock expires on its own. Default 15.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1440
                      },
                      "maxFailedAttempts": {
                        "description": "Failed sign-ins for one identifier before the account is locked. Default 10.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 100
                      },
                      "ipAttemptsPerWindow": {
                        "description": "Flow calls allowed per IP per product per window before HTTP 429. Default 120.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10000
                      },
                      "failedAttemptWindowMinutes": {
                        "description": "Sliding window the failed sign-ins are counted over, in minutes. Default 15.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1440
                      },
                      "identifierAttemptsPerWindow": {
                        "description": "Flow calls allowed per identifier per window before HTTP 429. Default 30.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1000
                      }
                    },
                    "additionalProperties": false
                  },
                  "captcha": {
                    "description": "Captcha (Cloudflare Turnstile) settings for flow creation. Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Require a captcha token when a flow attempt is created.",
                        "type": "boolean"
                      },
                      "siteKey": {
                        "description": "The public site key the Product renders the widget with.",
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "secretKey": {
                        "description": "WRITE-ONLY. The provider secret used server-side to verify tokens; stored encrypted and never returned. Omit to leave the stored secret untouched, pass null to clear it.",
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "riskElevated": {
                        "description": "Demand a captcha from an identifier that is currently accumulating failed attempts, even when `enabled` is false. Default true.",
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "email": {
                    "description": "Email OTP / magic-link settings. Merged field-by-field. Set `email.from` to a sender on a domain verified in this product's mail toolkit — until then the email strategies are not offered.",
                    "type": "object",
                    "properties": {
                      "from": {
                        "description": "Sender for auth email, e.g. \"Acme <auth@acme.com>\". MUST be on a domain verified in this product's mail toolkit. While it is null, email_code/email_link are not offered as strategies.",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "codeEnabled": {
                        "description": "Offer the 6-digit code strategy (email_code). Default true.",
                        "type": "boolean"
                      },
                      "linkBaseUrl": {
                        "description": "Base URL magic links point at, e.g. \"https://public.lessly.com/{productId}/users\". Null uses the deployment default.",
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "linkEnabled": {
                        "description": "Offer the magic-link strategy (email_link). Default true.",
                        "type": "boolean"
                      },
                      "codeTtlMinutes": {
                        "description": "How long an emailed code or link stays usable, in minutes. Default 15.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      },
                      "resendDailyCap": {
                        "description": "Auth emails one address may receive per day. Default 10.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 200
                      },
                      "maxCodeAttempts": {
                        "description": "Wrong-code entries allowed per token before it is spent. Default 5.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 20
                      },
                      "resendCooldownSeconds": {
                        "description": "Minimum seconds between two auth emails to one address. Floor of 60 is enforced regardless. Default 60.",
                        "type": "integer",
                        "minimum": 60,
                        "maximum": 3600
                      }
                    },
                    "additionalProperties": false
                  },
                  "recovery": {
                    "description": "Password-recovery settings (whether it is offered, how long a reset link lives). Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Offer the password-recovery flow at all. Default true.",
                        "type": "boolean"
                      },
                      "ttlMinutes": {
                        "description": "How long a reset link stays usable, in minutes. Default 60.",
                        "type": "integer",
                        "minimum": 5,
                        "maximum": 1440
                      }
                    },
                    "additionalProperties": false
                  },
                  "emailChange": {
                    "description": "Email-change settings: confirmation lifetime, the old address's revert window, the post-revert cooldown and the operator-override delay. Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Allow end users to change their email address. Default true.",
                        "type": "boolean"
                      },
                      "cooldownDays": {
                        "description": "How long after a REVERT further email changes are refused, in days. Default 7.",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365
                      },
                      "revertTtlDays": {
                        "description": "How long the old address may undo the change, in days. Default 30.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 90
                      },
                      "requestTtlHours": {
                        "description": "How long the two confirmation links stay usable, in hours. Default 24.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 168
                      },
                      "overrideDelayHours": {
                        "description": "Mandatory delay on an operator-assisted override, in hours — the abort window the old address is notified with. Default 72.",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 720
                      }
                    },
                    "additionalProperties": false
                  },
                  "invite": {
                    "description": "Invite lifetime and re-invite cooldown. Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "ttlDays": {
                        "description": "How long an invite link stays usable, in days. Default 14.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 90
                      },
                      "resendCooldownMinutes": {
                        "description": "Minimum minutes between two invite emails to one address. Default 60.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 10080
                      }
                    },
                    "additionalProperties": false
                  },
                  "waitlist": {
                    "description": "Waitlist settings: the double-opt-in toggle, how long a pending entry is retained before the sweep erases it, the confirmation link lifetime, and the embeddable widget’s copy and colours. Merged field-by-field, including inside `widget`.",
                    "type": "object",
                    "properties": {
                      "widget": {
                        "description": "The embeddable widget’s copy and colours. Merged field-by-field, so setting one line leaves the rest alone.",
                        "type": "object",
                        "properties": {
                          "title": {
                            "description": "Heading above the widget form.",
                            "type": "string",
                            "maxLength": 120
                          },
                          "policyUrl": {
                            "description": "Link rendered beside the consent text. Null renders no link.",
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 2048
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "accentColor": {
                            "description": "CSS colour for the button and the focus ring.",
                            "type": "string",
                            "maxLength": 32
                          },
                          "buttonLabel": {
                            "description": "Submit button copy.",
                            "type": "string",
                            "maxLength": 60
                          },
                          "consentText": {
                            "description": "Consent checkbox copy. Null renders no checkbox, and the signup records the consent proof as `unspecified`.",
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 400
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "description": {
                            "description": "One line under the heading.",
                            "type": "string",
                            "maxLength": 400
                          },
                          "policyVersion": {
                            "description": "The privacy-policy version the widget records in each consent proof.",
                            "type": "string",
                            "maxLength": 64
                          },
                          "successMessage": {
                            "description": "Shown after a submission. ONE message for every outcome: the signup route answers identically whether or not the address was already on the list.",
                            "type": "string",
                            "maxLength": 400
                          }
                        },
                        "additionalProperties": false
                      },
                      "doubleOptIn": {
                        "description": "Require a confirmation email before a waitlist signup counts. Default false — the entry is created either way, but an unconfirmed one is reported separately and is never invited.",
                        "type": "boolean"
                      },
                      "retentionDays": {
                        "description": "How long an UNCONVERTED waitlist entry — still pending, or invited and never registered — is kept, counted from SIGN-UP, before the sweep erases it. Default 180: Lessly Privacy Policy §6 promises deletion 6 months from sign-up. The bound stays wide because a client Product answers to its own privacy policy, not ours.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 3650
                      },
                      "confirmTtlHours": {
                        "description": "How long a double-opt-in confirmation link stays usable, in hours. Default 48.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 168
                      }
                    },
                    "additionalProperties": false
                  },
                  "testMode": {
                    "description": "Test mode: whether this product may have TEST USERS — accounts that are excluded from metering, kept out of the default directory listing, never really emailed, and (when the deployment sets one) able to sign in with the fixed magic OTP. REFUSED on a production deployment. Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "enabled": {
                        "description": "Opt this product into test mode. Refused outright on a production deployment — the environment gate is checked first and cannot be configured away. Turning it on is audited and raises an alert. Default false.",
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "retention": {
                    "description": "How long DEAD rows are kept before the retention sweep removes them: spent one-time tokens, expired flow attempts, expired sessions and their refresh tokens. These are grace periods on top of expiry, never lifetimes — an unswept expired row is inert. Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "flowAttemptDays": {
                        "description": "How long an EXPIRED flow attempt is kept after its own expiry. Default 0 — swept as soon as it dies, which is what the reaper did before this window existed.",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365
                      },
                      "oneTimeTokenDays": {
                        "description": "How long a SPENT or EXPIRED one-time token row (an OTP, a magic link, a recovery or abort token) is kept after it stops being usable, for forensics. The secret is a hash and the row is already dead — this only decides how long the trail lives. Default 30.",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365
                      },
                      "expiredSessionDays": {
                        "description": "How long an EXPIRED session and its refresh tokens are kept after expiry. Zero does not shorten any lifetime: a session past either window can never be refreshed again, so the row is already inert. Default 0.",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 365
                      }
                    },
                    "additionalProperties": false
                  },
                  "mfa": {
                    "description": "MFA settings: backup-code batch size, the operator-reset delay, how fresh authentication must be to enroll, and the second-factor lockout ceilings. Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "required": {
                        "description": "Whether a second factor is MANDATORY for this product. When true, a user may not unenroll their last verified factor. Default false.",
                        "type": "boolean"
                      },
                      "backupCodeCount": {
                        "description": "How many single-use backup codes a batch contains. Default 10.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 20
                      },
                      "resetDelayHours": {
                        "description": "Mandatory delay on an operator-initiated factor reset, in hours — the abort window the user is emailed. Default 72.",
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 720
                      },
                      "stepUpGrantMinutes": {
                        "description": "How long a passed step-up challenge stays spendable, in minutes. The grant is SINGLE-USE regardless. Default 5.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 60
                      },
                      "maxBackupCodeAttempts": {
                        "description": "Wrong BACKUP codes before the account is locked, counted separately from TOTP. Default 5.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50
                      },
                      "maxSecondFactorAttempts": {
                        "description": "Wrong second-factor codes before the account is locked. Default 5.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 50
                      },
                      "sensitiveAuthAgeMinutes": {
                        "description": "How recently the caller must have authenticated to enroll or regenerate a factor, in minutes. Default 10.",
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 1440
                      }
                    },
                    "additionalProperties": false
                  },
                  "notifications": {
                    "description": "Which security notification emails this product sends. All on by default. Merged field-by-field.",
                    "type": "object",
                    "properties": {
                      "newDevice": {
                        "description": "Email the user the first time a session appears from an unseen device. Default true.",
                        "type": "boolean"
                      },
                      "emailChange": {
                        "description": "Email the old address when an email change is requested, completed, reverted or overridden. Default true.",
                        "type": "boolean"
                      },
                      "impersonation": {
                        "description": "Email the user when an operator impersonates their account. Default true.",
                        "type": "boolean"
                      },
                      "passwordChanged": {
                        "description": "Email the user when their password is set or changed. Default true.",
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "passkeys": {
                    "description": "Passkey (WebAuthn) settings: whether this product is a relying party, the RP ID and name, and whether an assertion must be user-verified. Merged field-by-field. The `passkey` strategy is offered only when `enabled` is true AND an RP ID resolves.",
                    "type": "object",
                    "properties": {
                      "rpId": {
                        "description": "The WebAuthn Relying Party ID — the product's own domain, without a scheme or port. Leave null to derive it from `allowedOrigins`, which works whenever they all sit on one host. Set it to the shared PARENT domain when they do not (`example.com` covering `app.example.com` and `www.example.com`); it must cover EVERY allowed origin or passkeys stay off. CHANGING IT ORPHANS every credential already enrolled — an authenticator only ever asserts a credential back to the RP ID it was created for.",
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 253
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "rpName": {
                        "description": "The user-visible relying-party name the operating system's passkey prompt shows. Defaults to the RP ID.",
                        "anyOf": [
                          {
                            "type": "string",
                            "maxLength": 255
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "enabled": {
                        "description": "Whether this product is a WebAuthn relying party: passkeys can be enrolled and offered as a sign-in strategy. Default false. Switching it on is not enough on its own — the product also needs at least one browser origin in `allowedOrigins` for the RP ID to be derived from.",
                        "type": "boolean"
                      },
                      "requireUserVerification": {
                        "description": "Whether the authenticator must verify the user (biometric, PIN) rather than merely being present. Default false, which asks for verification but accepts an assertion without it — at `aal1`. A verified assertion always mints `aal2`, whatever this says; setting it true refuses the unverified one outright.",
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  },
                  "oauth": {
                    "description": "OAuth provider credentials and switches, per provider. Merged field-by-field. A provider is offered as a sign-in strategy only when it is enabled AND a full client id + secret pair resolves — from here, or from the deployment's shared development credentials.",
                    "type": "object",
                    "properties": {
                      "github": {
                        "description": "GitHub sign-in credentials and switch.",
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "description": "Offer this provider as a sign-in strategy.",
                            "type": "boolean"
                          },
                          "clientId": {
                            "description": "The OAuth client id from the provider console. Pass null to clear it and fall back to the deployment's shared development credentials, if it has any.",
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "clientSecret": {
                            "description": "WRITE-ONLY. The OAuth client secret; stored encrypted and never returned. Omit to leave the stored secret untouched, pass null to clear it.",
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 512
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      },
                      "google": {
                        "description": "Google sign-in credentials and switch.",
                        "type": "object",
                        "properties": {
                          "enabled": {
                            "description": "Offer this provider as a sign-in strategy.",
                            "type": "boolean"
                          },
                          "clientId": {
                            "description": "The OAuth client id from the provider console. Pass null to clear it and fall back to the deployment's shared development credentials, if it has any.",
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 255
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "clientSecret": {
                            "description": "WRITE-ONLY. The OAuth client secret; stored encrypted and never returned. Omit to leave the stored secret untouched, pass null to clear it.",
                            "anyOf": [
                              {
                                "type": "string",
                                "maxLength": 512
                              },
                              {
                                "type": "null"
                              }
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "signupMode",
                    "passwordPolicy",
                    "sessionTtlHours",
                    "accessTokenTtlMinutes",
                    "refreshSlidingDays",
                    "refreshAbsoluteDays",
                    "redirectUriAllowlist",
                    "allowedOrigins",
                    "protection",
                    "captcha",
                    "email",
                    "recovery",
                    "emailChange",
                    "invite",
                    "waitlist",
                    "retention",
                    "testMode",
                    "mfa",
                    "passkeys",
                    "notifications",
                    "oauth",
                    "captchaSecretConfigured",
                    "status",
                    "lifecycleBlocked",
                    "lifecycleArchived"
                  ],
                  "properties": {
                    "mfa": {
                      "type": "object",
                      "required": [
                        "backupCodeCount",
                        "resetDelayHours",
                        "sensitiveAuthAgeMinutes",
                        "maxSecondFactorAttempts",
                        "maxBackupCodeAttempts",
                        "required",
                        "stepUpGrantMinutes"
                      ],
                      "properties": {
                        "required": {
                          "description": "Whether a second factor is MANDATORY for this product. When true, a user may not unenroll their last verified factor. Default false.",
                          "type": "boolean"
                        },
                        "backupCodeCount": {
                          "description": "How many single-use backup codes a batch contains. Default 10.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 20
                        },
                        "resetDelayHours": {
                          "description": "Mandatory delay on an operator-initiated factor reset, in hours — the abort window the user is emailed. Default 72.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 720
                        },
                        "stepUpGrantMinutes": {
                          "description": "How long a passed step-up challenge stays spendable, in minutes. The grant is SINGLE-USE regardless. Default 5.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 60
                        },
                        "maxBackupCodeAttempts": {
                          "description": "Wrong BACKUP codes before the account is locked, counted separately from TOTP. Default 5.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        },
                        "maxSecondFactorAttempts": {
                          "description": "Wrong second-factor codes before the account is locked. Default 5.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 50
                        },
                        "sensitiveAuthAgeMinutes": {
                          "description": "How recently the caller must have authenticated to enroll or regenerate a factor, in minutes. Default 10.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1440
                        }
                      },
                      "additionalProperties": false
                    },
                    "email": {
                      "type": "object",
                      "required": [
                        "from",
                        "codeEnabled",
                        "linkEnabled",
                        "linkBaseUrl",
                        "codeTtlMinutes",
                        "maxCodeAttempts",
                        "resendCooldownSeconds",
                        "resendDailyCap"
                      ],
                      "properties": {
                        "from": {
                          "description": "Sender for auth email, e.g. \"Acme <auth@acme.com>\". MUST be on a domain verified in this product's mail toolkit. While it is null, email_code/email_link are not offered as strategies.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "codeEnabled": {
                          "description": "Offer the 6-digit code strategy (email_code). Default true.",
                          "type": "boolean"
                        },
                        "linkBaseUrl": {
                          "description": "Base URL magic links point at, e.g. \"https://public.lessly.com/{productId}/users\". Null uses the deployment default.",
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "linkEnabled": {
                          "description": "Offer the magic-link strategy (email_link). Default true.",
                          "type": "boolean"
                        },
                        "codeTtlMinutes": {
                          "description": "How long an emailed code or link stays usable, in minutes. Default 15.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 60
                        },
                        "resendDailyCap": {
                          "description": "Auth emails one address may receive per day. Default 10.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 200
                        },
                        "maxCodeAttempts": {
                          "description": "Wrong-code entries allowed per token before it is spent. Default 5.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 20
                        },
                        "resendCooldownSeconds": {
                          "description": "Minimum seconds between two auth emails to one address. Floor of 60 is enforced regardless. Default 60.",
                          "type": "integer",
                          "minimum": 60,
                          "maximum": 3600
                        }
                      },
                      "additionalProperties": false
                    },
                    "oauth": {
                      "type": "object",
                      "required": [
                        "providers"
                      ],
                      "properties": {
                        "providers": {
                          "type": "object",
                          "required": [
                            "google",
                            "github"
                          ],
                          "properties": {
                            "github": {
                              "type": "object",
                              "required": [
                                "enabled",
                                "clientId",
                                "secretConfigured"
                              ],
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "clientId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "secretConfigured": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            },
                            "google": {
                              "type": "object",
                              "required": [
                                "enabled",
                                "clientId",
                                "secretConfigured"
                              ],
                              "properties": {
                                "enabled": {
                                  "type": "boolean"
                                },
                                "clientId": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "secretConfigured": {
                                  "type": "boolean"
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "additionalProperties": false
                        }
                      },
                      "additionalProperties": false
                    },
                    "invite": {
                      "type": "object",
                      "required": [
                        "ttlDays",
                        "resendCooldownMinutes"
                      ],
                      "properties": {
                        "ttlDays": {
                          "description": "How long an invite link stays usable, in days. Default 14.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 90
                        },
                        "resendCooldownMinutes": {
                          "description": "Minimum minutes between two invite emails to one address. Default 60.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10080
                        }
                      },
                      "additionalProperties": false
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "paused"
                      ]
                    },
                    "captcha": {
                      "type": "object",
                      "required": [
                        "provider",
                        "enabled",
                        "siteKey",
                        "riskElevated"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        },
                        "siteKey": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "provider": {
                          "type": "string",
                          "enum": [
                            "turnstile"
                          ]
                        },
                        "riskElevated": {
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "passkeys": {
                      "type": "object",
                      "required": [
                        "enabled",
                        "rpId",
                        "rpName",
                        "requireUserVerification"
                      ],
                      "properties": {
                        "rpId": {
                          "description": "The WebAuthn Relying Party ID — the product's own domain, without a scheme or port. Leave null to derive it from `allowedOrigins`, which works whenever they all sit on one host. Set it to the shared PARENT domain when they do not (`example.com` covering `app.example.com` and `www.example.com`); it must cover EVERY allowed origin or passkeys stay off. CHANGING IT ORPHANS every credential already enrolled — an authenticator only ever asserts a credential back to the RP ID it was created for.",
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 253
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "rpName": {
                          "description": "The user-visible relying-party name the operating system's passkey prompt shows. Defaults to the RP ID.",
                          "anyOf": [
                            {
                              "type": "string",
                              "maxLength": 255
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "enabled": {
                          "description": "Whether this product is a WebAuthn relying party: passkeys can be enrolled and offered as a sign-in strategy. Default false. Switching it on is not enough on its own — the product also needs at least one browser origin in `allowedOrigins` for the RP ID to be derived from.",
                          "type": "boolean"
                        },
                        "requireUserVerification": {
                          "description": "Whether the authenticator must verify the user (biometric, PIN) rather than merely being present. Default false, which asks for verification but accepts an assertion without it — at `aal1`. A verified assertion always mints `aal2`, whatever this says; setting it true refuses the unverified one outright.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "recovery": {
                      "type": "object",
                      "required": [
                        "enabled",
                        "ttlMinutes"
                      ],
                      "properties": {
                        "enabled": {
                          "description": "Offer the password-recovery flow at all. Default true.",
                          "type": "boolean"
                        },
                        "ttlMinutes": {
                          "description": "How long a reset link stays usable, in minutes. Default 60.",
                          "type": "integer",
                          "minimum": 5,
                          "maximum": 1440
                        }
                      },
                      "additionalProperties": false
                    },
                    "testMode": {
                      "type": "object",
                      "required": [
                        "enabled"
                      ],
                      "properties": {
                        "enabled": {
                          "description": "Opt this product into test mode. Refused outright on a production deployment — the environment gate is checked first and cannot be configured away. Turning it on is audited and raises an alert. Default false.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "waitlist": {
                      "type": "object",
                      "required": [
                        "widget",
                        "doubleOptIn",
                        "retentionDays",
                        "confirmTtlHours"
                      ],
                      "properties": {
                        "widget": {
                          "description": "The embeddable widget’s copy and colours.",
                          "type": "object",
                          "required": [
                            "title",
                            "description",
                            "buttonLabel",
                            "successMessage",
                            "consentText",
                            "policyVersion",
                            "policyUrl",
                            "accentColor"
                          ],
                          "properties": {
                            "title": {
                              "description": "Heading above the widget form.",
                              "type": "string",
                              "maxLength": 120
                            },
                            "policyUrl": {
                              "description": "Link rendered beside the consent text. Null renders no link.",
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 2048
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "accentColor": {
                              "description": "CSS colour for the button and the focus ring.",
                              "type": "string",
                              "maxLength": 32
                            },
                            "buttonLabel": {
                              "description": "Submit button copy.",
                              "type": "string",
                              "maxLength": 60
                            },
                            "consentText": {
                              "description": "Consent checkbox copy. Null renders no checkbox, and the signup records the consent proof as `unspecified`.",
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 400
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "description": {
                              "description": "One line under the heading.",
                              "type": "string",
                              "maxLength": 400
                            },
                            "policyVersion": {
                              "description": "The privacy-policy version the widget records in each consent proof.",
                              "type": "string",
                              "maxLength": 64
                            },
                            "successMessage": {
                              "description": "Shown after a submission. ONE message for every outcome: the signup route answers identically whether or not the address was already on the list.",
                              "type": "string",
                              "maxLength": 400
                            }
                          },
                          "additionalProperties": false
                        },
                        "doubleOptIn": {
                          "description": "Require a confirmation email before a waitlist signup counts. Default false — the entry is created either way, but an unconfirmed one is reported separately and is never invited.",
                          "type": "boolean"
                        },
                        "retentionDays": {
                          "description": "How long an UNCONVERTED waitlist entry — still pending, or invited and never registered — is kept, counted from SIGN-UP, before the sweep erases it. Default 180: Lessly Privacy Policy §6 promises deletion 6 months from sign-up. The bound stays wide because a client Product answers to its own privacy policy, not ours.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 3650
                        },
                        "confirmTtlHours": {
                          "description": "How long a double-opt-in confirmation link stays usable, in hours. Default 48.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 168
                        }
                      },
                      "additionalProperties": false
                    },
                    "productId": {
                      "type": "string"
                    },
                    "retention": {
                      "type": "object",
                      "required": [
                        "oneTimeTokenDays",
                        "flowAttemptDays",
                        "expiredSessionDays"
                      ],
                      "properties": {
                        "flowAttemptDays": {
                          "description": "How long an EXPIRED flow attempt is kept after its own expiry. Default 0 — swept as soon as it dies, which is what the reaper did before this window existed.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "oneTimeTokenDays": {
                          "description": "How long a SPENT or EXPIRED one-time token row (an OTP, a magic link, a recovery or abort token) is kept after it stops being usable, for forensics. The secret is a hash and the row is already dead — this only decides how long the trail lives. Default 30.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "expiredSessionDays": {
                          "description": "How long an EXPIRED session and its refresh tokens are kept after expiry. Zero does not shorten any lifetime: a session past either window can never be refreshed again, so the row is already inert. Default 0.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        }
                      },
                      "additionalProperties": false
                    },
                    "protection": {
                      "type": "object",
                      "required": [
                        "maxFailedAttempts",
                        "failedAttemptWindowMinutes",
                        "lockoutMinutes",
                        "identifierAttemptsPerWindow",
                        "ipAttemptsPerWindow",
                        "hibpEnabled"
                      ],
                      "properties": {
                        "hibpEnabled": {
                          "description": "Check passwords against the HaveIBeenPwned breach corpus (k-anonymity). Blocking at sign-up, advisory at sign-in. Default true.",
                          "type": "boolean"
                        },
                        "lockoutMinutes": {
                          "description": "How long an account stays locked. Self-healing — the lock expires on its own. Default 15.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1440
                        },
                        "maxFailedAttempts": {
                          "description": "Failed sign-ins for one identifier before the account is locked. Default 10.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 100
                        },
                        "ipAttemptsPerWindow": {
                          "description": "Flow calls allowed per IP per product per window before HTTP 429. Default 120.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 10000
                        },
                        "failedAttemptWindowMinutes": {
                          "description": "Sliding window the failed sign-ins are counted over, in minutes. Default 15.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1440
                        },
                        "identifierAttemptsPerWindow": {
                          "description": "Flow calls allowed per identifier per window before HTTP 429. Default 30.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 1000
                        }
                      },
                      "additionalProperties": false
                    },
                    "signupMode": {
                      "type": "string",
                      "enum": [
                        "public",
                        "invite-only",
                        "waitlist"
                      ]
                    },
                    "emailChange": {
                      "type": "object",
                      "required": [
                        "enabled",
                        "requestTtlHours",
                        "revertTtlDays",
                        "cooldownDays",
                        "overrideDelayHours"
                      ],
                      "properties": {
                        "enabled": {
                          "description": "Allow end users to change their email address. Default true.",
                          "type": "boolean"
                        },
                        "cooldownDays": {
                          "description": "How long after a REVERT further email changes are refused, in days. Default 7.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "revertTtlDays": {
                          "description": "How long the old address may undo the change, in days. Default 30.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 90
                        },
                        "requestTtlHours": {
                          "description": "How long the two confirmation links stay usable, in hours. Default 24.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 168
                        },
                        "overrideDelayHours": {
                          "description": "Mandatory delay on an operator-assisted override, in hours — the abort window the old address is notified with. Default 72.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 720
                        }
                      },
                      "additionalProperties": false
                    },
                    "notifications": {
                      "type": "object",
                      "required": [
                        "passwordChanged",
                        "newDevice",
                        "emailChange",
                        "impersonation"
                      ],
                      "properties": {
                        "newDevice": {
                          "description": "Email the user the first time a session appears from an unseen device. Default true.",
                          "type": "boolean"
                        },
                        "emailChange": {
                          "description": "Email the old address when an email change is requested, completed, reverted or overridden. Default true.",
                          "type": "boolean"
                        },
                        "impersonation": {
                          "description": "Email the user when an operator impersonates their account. Default true.",
                          "type": "boolean"
                        },
                        "passwordChanged": {
                          "description": "Email the user when their password is set or changed. Default true.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "allowedOrigins": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "passwordPolicy": {
                      "type": "object",
                      "required": [
                        "minLength",
                        "requireUppercase",
                        "requireNumber",
                        "requireSymbol"
                      ],
                      "properties": {
                        "minLength": {
                          "description": "Minimum password length. Default 8.",
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 256
                        },
                        "requireNumber": {
                          "description": "Require at least one digit.",
                          "type": "boolean"
                        },
                        "requireSymbol": {
                          "description": "Require at least one non-alphanumeric character.",
                          "type": "boolean"
                        },
                        "requireUppercase": {
                          "description": "Require at least one uppercase letter.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    },
                    "sessionTtlHours": {
                      "type": "integer"
                    },
                    "lifecycleBlocked": {
                      "type": "boolean"
                    },
                    "lifecycleArchived": {
                      "type": "boolean"
                    },
                    "refreshSlidingDays": {
                      "type": "integer"
                    },
                    "refreshAbsoluteDays": {
                      "type": "integer"
                    },
                    "redirectUriAllowlist": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "accessTokenTtlMinutes": {
                      "type": "integer"
                    },
                    "captchaSecretConfigured": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/keys": {
      "get": {
        "operationId": "users_keys_list",
        "summary": "List this product's JWT signing keys, newest first: the key id (the `kid` a token header carries), its lifecycle state, and when it was created, retired and revoked.",
        "description": "List this product's JWT signing keys, newest first: the key id (the `kid` a token header carries), its lifecycle state, and when it was created, retired and revoked. `current` signs; `retired` no longer signs but is STILL published in JWKS until `overlapExpiresAt`, so tokens it signed keep verifying; `standby` is the pre-generated successor and is not published; `revoked` was evicted from JWKS immediately. Key material — public or private — is never returned here.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_keys_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "keys"
                  ],
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "kid",
                          "state",
                          "createdAt",
                          "retiredAt",
                          "overlapExpiresAt",
                          "revokedAt"
                        ],
                        "properties": {
                          "kid": {
                            "description": "The RFC 7638 JWK thumbprint — what a token header carries.",
                            "type": "string"
                          },
                          "state": {
                            "description": "`standby` is pre-generated and not published; `current` signs; `retired` is still in JWKS for the overlap; `revoked` was evicted.",
                            "type": "string",
                            "enum": [
                              "standby",
                              "current",
                              "retired",
                              "revoked"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "retiredAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "revokedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "overlapExpiresAt": {
                            "description": "When a retired key leaves JWKS. Null unless the key is retired.",
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/keys/revoke": {
      "post": {
        "operationId": "users_keys_revoke",
        "summary": "THE KEY-COMPROMISE DRILL.",
        "description": "THE KEY-COMPROMISE DRILL. Evict a signing key from the published JWKS IMMEDIATELY — no overlap, no grace — so every token it ever signed stops verifying at once, mint or promote a fresh signing key in its place, and (by default) sign every end user of this product out, because a token the attacker forged with the stolen key is indistinguishable from a real one. Pass `revokeSessions: false` only when you are certain no forged token was issued. Give a reason: it is the only account of the incident the audit log will keep. This is disruptive and irreversible — for routine rotation use users_keys_rotate.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_keys_revoke",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "kid": {
                    "description": "The key to evict, as listed by users_keys_list.",
                    "type": "string",
                    "minLength": 1
                  },
                  "reason": {
                    "description": "Why. Goes into the audit row and is the only account of the incident it keeps.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "revokeSessions": {
                    "description": "Sign every end user of this product out as well. Defaults to TRUE: a compromised signing key could have minted any of those sessions. Pass false ONLY when you know no forged token was ever issued.",
                    "type": "boolean"
                  }
                },
                "required": [
                  "kid"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "revokedKid",
                    "currentKid",
                    "sessionsRevoked"
                  ],
                  "properties": {
                    "currentKid": {
                      "description": "The fresh key minted or promoted in its place.",
                      "type": "string"
                    },
                    "revokedKid": {
                      "type": "string"
                    },
                    "sessionsRevoked": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/keys/rotate": {
      "post": {
        "operationId": "users_keys_rotate",
        "summary": "Rotate this product's JWT signing key with ZERO verifier downtime.",
        "description": "Rotate this product's JWT signing key with ZERO verifier downtime. The standby key (generated now if there is none) becomes the signing key, and the old one is retired into an overlap window — BOTH key ids stay in the published JWKS until `overlapExpiresAt`, so every token signed before the rotation keeps verifying for the rest of its life and no verifier has to re-fetch anything to keep working. The overlap is the product's access-token TTL plus five minutes. After it elapses the old key is revoked automatically and stops verifying. Use users_keys_revoke instead if the key is COMPROMISED and must die now.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_keys_rotate",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "previousKid",
                    "currentKid",
                    "overlapExpiresAt"
                  ],
                  "properties": {
                    "currentKid": {
                      "description": "The key signing from now on.",
                      "type": "string"
                    },
                    "previousKid": {
                      "description": "The key just retired. Null if there was none.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "overlapExpiresAt": {
                      "description": "When the retired key stops verifying. Both kids are in JWKS until then.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/ops/retention": {
      "post": {
        "operationId": "users_ops_retention_get",
        "summary": "What this product keeps and for how long.",
        "description": "What this product keeps and for how long. Returns the EFFECTIVE retention windows (spent one-time tokens, expired flow attempts, expired sessions and their refresh tokens) next to the documented defaults, the separate waitlist-entry window, the single cron that performs every sweep, and — deliberately — the list of what is NEVER swept and why. For the waitlist it also answers the two questions a published retention promise raises: whether this product's window is WIDER than the 180 days Lessly published (`waitlistWiderThanPromised`, a flag rather than a refusal), and whether the job that honours it is actually running — `lastSweep` carries the last pass this replica performed, counting THIS product's erasures only, and is NULL when it has observed none — which is not the same as a pass that erased zero. The windows are GRACE PERIODS ON TOP OF EXPIRY, never lifetimes: every live read carries its own expiry predicate, so an unswept expired row is inert and a window of 0 shortens nothing. Change them with users_config_upsert `retention`.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_ops_retention_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "windows",
                    "defaults",
                    "waitlistRetentionDays",
                    "waitlistPromisedMaxDays",
                    "waitlistWiderThanPromised",
                    "lastSweep",
                    "sweep",
                    "notSwept"
                  ],
                  "properties": {
                    "sweep": {
                      "description": "The single retention job. There is exactly one — it replaced the sessions reaper and the waitlist sweep.",
                      "type": "object",
                      "required": [
                        "functionId",
                        "cron",
                        "removes"
                      ],
                      "properties": {
                        "cron": {
                          "description": "Its schedule, in cron syntax.",
                          "type": "string"
                        },
                        "removes": {
                          "description": "What one pass removes, in the order it removes it.",
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "functionId": {
                          "description": "The Synapse cron function that performs every sweep below.",
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    },
                    "windows": {
                      "description": "This product’s EFFECTIVE windows — what it configured, with the documented default filling anything it did not.",
                      "type": "object",
                      "required": [
                        "oneTimeTokenDays",
                        "flowAttemptDays",
                        "expiredSessionDays"
                      ],
                      "properties": {
                        "flowAttemptDays": {
                          "description": "How long an EXPIRED flow attempt is kept after its own expiry. Default 0 — swept as soon as it dies, which is what the reaper did before this window existed.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "oneTimeTokenDays": {
                          "description": "How long a SPENT or EXPIRED one-time token row (an OTP, a magic link, a recovery or abort token) is kept after it stops being usable, for forensics. The secret is a hash and the row is already dead — this only decides how long the trail lives. Default 30.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "expiredSessionDays": {
                          "description": "How long an EXPIRED session and its refresh tokens are kept after expiry. Zero does not shorten any lifetime: a session past either window can never be refreshed again, so the row is already inert. Default 0.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        }
                      },
                      "additionalProperties": false
                    },
                    "defaults": {
                      "description": "The documented defaults, so a reader can tell a deliberate window from an inherited one without a second call.",
                      "type": "object",
                      "required": [
                        "oneTimeTokenDays",
                        "flowAttemptDays",
                        "expiredSessionDays"
                      ],
                      "properties": {
                        "flowAttemptDays": {
                          "description": "How long an EXPIRED flow attempt is kept after its own expiry. Default 0 — swept as soon as it dies, which is what the reaper did before this window existed.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "oneTimeTokenDays": {
                          "description": "How long a SPENT or EXPIRED one-time token row (an OTP, a magic link, a recovery or abort token) is kept after it stops being usable, for forensics. The secret is a hash and the row is already dead — this only decides how long the trail lives. Default 30.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        },
                        "expiredSessionDays": {
                          "description": "How long an EXPIRED session and its refresh tokens are kept after expiry. Zero does not shorten any lifetime: a session past either window can never be refreshed again, so the row is already inert. Default 0.",
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 365
                        }
                      },
                      "additionalProperties": false
                    },
                    "notSwept": {
                      "description": "What this service deliberately keeps forever, and why. Reading a retention surface that lists only what IS deleted is how an operator concludes the audit log ages out — it does not.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "what",
                          "why"
                        ],
                        "properties": {
                          "why": {
                            "type": "string"
                          },
                          "what": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lastSweep": {
                      "description": "The last sweep this replica performed, or NULL when it has observed none. Null and a run with `erased: 0` are DIFFERENT STATES and must never be collapsed: one means the job is working and there was nothing due, the other means this replica has no evidence the job ran at all. The durable per-entry trail is elsewhere — the append-only `waitlist.erased` audit rows.",
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "finishedAt",
                            "erased",
                            "statuses",
                            "window",
                            "scope"
                          ],
                          "properties": {
                            "scope": {
                              "description": "This is ONE replica’s memory of its own last pass, not the deployment’s — the same honesty as `users_ops_slo_get`. A replica that has never executed the cron reports `null` even though another one may have swept a minute ago, so treat this as a spot check.",
                              "type": "string",
                              "const": "replica"
                            },
                            "erased": {
                              "description": "How many of THIS PRODUCT’s entries that pass erased. The sweep itself runs across every tenant at once — expiry is the passage of time and it has no request tenant to scope to — but the number reported here is bucketed, because a management tool answers about the caller’s own product and never about anybody else’s. A zero next to a non-null run is a result, not a gap: the job ran and nothing was due here.",
                              "type": "integer"
                            },
                            "window": {
                              "description": "Which window decided, in words that name the config field.",
                              "type": "string"
                            },
                            "statuses": {
                              "description": "The statuses in scope. `registered` and `withdrawn` are never swept.",
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            },
                            "finishedAt": {
                              "description": "ISO time the pass finished.",
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "waitlistRetentionDays": {
                      "description": "How long an UNCONVERTED waitlist entry — still pending, or invited and never registered — is kept, counted from SIGN-UP. It lives in the `waitlist` config block rather than in `retention`, because it is not a grace period on a dead row: such an entry never expires on its own, so this window is the whole of what makes it go away — and the sweep ERASES it (audit row, `users/waitlist-entry.erased`) rather than deleting it.",
                      "type": "integer"
                    },
                    "waitlistPromisedMaxDays": {
                      "description": "What Lessly PUBLISHED, in its Privacy Policy §6: a waitlist address that never converted is deleted 6 months from sign-up. It rides along so the window above can be read against the promise it came from, rather than as a number with no provenance.",
                      "type": "integer"
                    },
                    "waitlistWiderThanPromised": {
                      "description": "True when this product configured a window WIDER than the published 180 days. Nothing refuses such a value and nothing clamps it — §6 is Lessly’s own policy and a client Product answers to its own, under which a longer window may be perfectly lawful. This flag exists INSTEAD of that ceiling: a deliberate divergence from what Lessly published must be diagnosable in one call rather than found by comparing two numbers nobody thought to compare.",
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/ops/slo": {
      "post": {
        "operationId": "users_ops_slo_get",
        "summary": "This product's service-level objectives and how it is doing against them RIGHT NOW: sign-in success rate, refresh error rate and mail-send failure rate, each with the objective, the evaluation window, the sample floor below which it is not judged, and the `users/alert.raised` kind a breach fires.",
        "description": "This product's service-level objectives and how it is doing against them RIGHT NOW: sign-in success rate, refresh error rate and mail-send failure rate, each with the objective, the evaluation window, the sample floor below which it is not judged, and the `users/alert.raised` kind a breach fires. Also returns the raw current window (sign-ins, refreshes, detected token reuse, mail sends) and the product's own trailing sign-in failure baseline — the number the per-product anomaly signal compares a spike against. A `status` of `insufficient_data` is NOT health: it means the window is too quiet to judge. The numbers come from ONE replica's in-process window, so treat them as a spot check rather than a fleet-wide error budget.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_ops_slo_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "scope",
                    "window",
                    "slos"
                  ],
                  "properties": {
                    "slos": {
                      "description": "Every published objective and its verdict for this window.",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "title",
                          "description",
                          "comparator",
                          "objective",
                          "windowSeconds",
                          "minSamples",
                          "alertKind",
                          "observed",
                          "samples",
                          "status"
                        ],
                        "properties": {
                          "id": {
                            "description": "Stable id of the objective — the key to quote in a runbook.",
                            "type": "string"
                          },
                          "title": {
                            "description": "Short human name.",
                            "type": "string"
                          },
                          "status": {
                            "description": "`insufficient_data` is NOT `ok`: it means the window is too quiet to judge, which an operator reading a dashboard must be able to tell apart from health.",
                            "type": "string",
                            "enum": [
                              "ok",
                              "breached",
                              "insufficient_data"
                            ]
                          },
                          "samples": {
                            "description": "How many events went into `observed`.",
                            "type": "integer"
                          },
                          "observed": {
                            "description": "What this replica sees in the CURRENT window, in the same unit as `objective`. NULL when nothing was observed.",
                            "type": [
                              "number",
                              "null"
                            ]
                          },
                          "alertKind": {
                            "description": "The `users/alert.raised` kind a breach of this objective fires, for wiring an alert route.",
                            "type": "string"
                          },
                          "objective": {
                            "description": "The published objective, as a ratio in 0..1.",
                            "type": "number"
                          },
                          "comparator": {
                            "description": "Which side of `objective` is healthy: a success rate is at-least, an error rate at-most.",
                            "type": "string",
                            "enum": [
                              "at-least",
                              "at-most"
                            ]
                          },
                          "minSamples": {
                            "description": "Below this many samples the ratio is not judged at all — a quiet window is not an outage.",
                            "type": "integer"
                          },
                          "description": {
                            "description": "What is counted, and what is deliberately NOT counted.",
                            "type": "string"
                          },
                          "windowSeconds": {
                            "description": "The window the observation is computed over.",
                            "type": "integer"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "scope": {
                      "description": "These numbers come from ONE replica’s in-process window, not from the whole deployment. Treat them as a spot check, not as the fleet’s error budget.",
                      "type": "string",
                      "const": "replica"
                    },
                    "window": {
                      "description": "The current window, exactly as the alert hook sees it.",
                      "type": "object",
                      "required": [
                        "windowSeconds",
                        "windowStartedAt",
                        "signIn",
                        "refresh",
                        "mail",
                        "signInFailureBaseline"
                      ],
                      "properties": {
                        "mail": {
                          "type": "object",
                          "required": [
                            "total",
                            "failures",
                            "failureRate"
                          ],
                          "properties": {
                            "total": {
                              "description": "Auth emails handed to mail (a cooldown or daily cap never reaches this).",
                              "type": "integer"
                            },
                            "failures": {
                              "description": "Of those, the ones mail would not take.",
                              "type": "integer"
                            },
                            "failureRate": {
                              "description": "failures / total. NULL when nothing was sent.",
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "signIn": {
                          "type": "object",
                          "required": [
                            "total",
                            "failures",
                            "successRate"
                          ],
                          "properties": {
                            "total": {
                              "description": "SETTLED flow attempts — completed or failed. A pending one is neither.",
                              "type": "integer"
                            },
                            "failures": {
                              "description": "Of those, the ones that failed.",
                              "type": "integer"
                            },
                            "successRate": {
                              "description": "completed / settled. NULL, never 0, when nothing settled.",
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "refresh": {
                          "type": "object",
                          "required": [
                            "total",
                            "errors",
                            "reuses",
                            "errorRate"
                          ],
                          "properties": {
                            "total": {
                              "description": "Refresh attempts.",
                              "type": "integer"
                            },
                            "errors": {
                              "description": "Failed refreshes, detected reuse included.",
                              "type": "integer"
                            },
                            "reuses": {
                              "description": "Detected token REUSE — theft, counted rather than rated.",
                              "type": "integer"
                            },
                            "errorRate": {
                              "description": "errors / total. NULL when nothing was refreshed.",
                              "type": [
                                "number",
                                "null"
                              ]
                            }
                          },
                          "additionalProperties": false
                        },
                        "windowSeconds": {
                          "description": "Length of the evaluation window.",
                          "type": "integer"
                        },
                        "windowStartedAt": {
                          "description": "ISO start of the window these numbers belong to.",
                          "type": "string"
                        },
                        "signInFailureBaseline": {
                          "description": "This product’s OWN trailing sign-in failure rate, over CLOSED windows. What the anomaly signal compares the live window against — NULL until at least one window has closed.",
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/sessions": {
      "get": {
        "operationId": "users_sessions_list",
        "summary": "List the end-user sessions of one user of this product, newest first — one row per device, with its status, device metadata and both expiries (the sliding inactivity window and the hard time-box).",
        "description": "List the end-user sessions of one user of this product, newest first — one row per device, with its status, device metadata and both expiries (the sliding inactivity window and the hard time-box). Revoked and expired sessions are included so an operator can see what happened, not only what is live.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_sessions_list",
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "required": true,
            "description": "The end user whose sessions to list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "sessions"
                  ],
                  "properties": {
                    "sessions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "userId",
                          "status",
                          "userAgent",
                          "ip",
                          "createdAt",
                          "lastRefreshedAt",
                          "expiresAt",
                          "absoluteExpiresAt",
                          "revokedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "ip": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "active",
                              "revoked"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "expiresAt": {
                            "type": "string"
                          },
                          "revokedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "userAgent": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastRefreshedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "absoluteExpiresAt": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/sessions/{sessionId}": {
      "get": {
        "operationId": "users_sessions_get",
        "summary": "Read one end-user session in full: its status, device metadata, both expiries, the assurance level and factors it was established with, why it was revoked if it was, and the operator behind it if it is an impersonated session.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_sessions_get",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "The session to read.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "userId",
                    "status",
                    "userAgent",
                    "ip",
                    "createdAt",
                    "lastRefreshedAt",
                    "expiresAt",
                    "absoluteExpiresAt",
                    "revokedAt",
                    "aal",
                    "amr",
                    "impersonatedBy",
                    "revokedReason"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "ip": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "aal": {
                      "description": "`aal2` only if a verified second factor completed.",
                      "type": "string",
                      "enum": [
                        "aal1",
                        "aal2"
                      ]
                    },
                    "amr": {
                      "description": "The factors this session was established with.",
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "active",
                        "revoked"
                      ]
                    },
                    "userId": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "type": "string"
                    },
                    "revokedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "userAgent": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "revokedReason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "impersonatedBy": {
                      "description": "The operator behind an impersonated session, or null for an ordinary one.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastRefreshedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "absoluteExpiresAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/sessions/impersonate": {
      "post": {
        "operationId": "users_sessions_impersonate",
        "summary": "Start an impersonated session as one user of this product — support access, hard-capped.",
        "description": "Start an impersonated session as one user of this product — support access, hard-capped. Returns an access token that expires within 30 minutes and CANNOT be refreshed; there is no refresh token. While it is in use, every credential, factor, identifier and session mutation is refused, the user is emailed (unless the product turned that notice off), and the whole thing is recorded in the audit trail against you. Give a real reason: it goes into the audit row and into that email.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_sessions_impersonate",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "description": "The end user to sign in as.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "reason": {
                    "description": "Why. Recorded in the audit trail and shown to the user in the notification email — write what you would want to read in an incident review (a ticket number and one sentence).",
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 500
                  }
                },
                "required": [
                  "userId",
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accessToken",
                    "expiresIn",
                    "sessionId",
                    "userId",
                    "expiresAt"
                  ],
                  "properties": {
                    "userId": {
                      "type": "string"
                    },
                    "expiresAt": {
                      "description": "When the session dies. It cannot be extended or refreshed.",
                      "type": "string"
                    },
                    "expiresIn": {
                      "description": "Seconds until the access token expires.",
                      "type": "integer"
                    },
                    "sessionId": {
                      "type": "string"
                    },
                    "accessToken": {
                      "description": "The access JWT of the impersonated session. There is NO refresh token.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/sessions/revoke": {
      "post": {
        "operationId": "users_sessions_revoke",
        "summary": "Revoke end-user sessions: pass `sessionId` to sign out one device, or `userId` to sign out every device of that user.",
        "description": "Revoke end-user sessions: pass `sessionId` to sign out one device, or `userId` to sign out every device of that user. Revocation is immediate in this toolkit's own checked verification; an access token already issued keeps verifying locally until it expires (≤10 minutes by default). Returns how many sessions this call actually revoked — a second call on the same target returns 0.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_sessions_revoke",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "sessionId": {
                    "description": "Revoke exactly this session.",
                    "type": "string",
                    "format": "uuid"
                  },
                  "userId": {
                    "description": "Revoke every session of this user.",
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "revoked"
                  ],
                  "properties": {
                    "revoked": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/stats/get": {
      "post": {
        "operationId": "users_stats_get",
        "summary": "One snapshot of this product's auth deployment: directory users split by DERIVED status (active, waitlisted, banned, soft-deleted, GDPR-erased), sessions that are live right now, verified second factors, the sign-in success rate over `window`, and an abuse block — lockouts (with the MFA subset), failed sign-ins, detected refresh-token reuse and breached-password sightings.",
        "description": "One snapshot of this product's auth deployment: directory users split by DERIVED status (active, waitlisted, banned, soft-deleted, GDPR-erased), sessions that are live right now, verified second factors, the sign-in success rate over `window`, and an abuse block — lockouts (with the MFA subset), failed sign-ins, detected refresh-token reuse and breached-password sightings. The populations are point-in-time; only the sign-in and abuse numbers honour `window`. A rising abuse block against a falling success rate is what credential stuffing looks like from here. `successRate` is null, not 0, when nothing was attempted.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_stats_get",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "window": {
                    "description": "Look-back window for the TIME-BOUNDED numbers — the sign-in counters, the abuse block and `sessions.createdInWindow`: '24h', '7d', '30d' or '90d'. Default '7d'. The user, live-session and factor populations are point-in-time and ignore it.",
                    "type": "string",
                    "enum": [
                      "24h",
                      "7d",
                      "30d",
                      "90d"
                    ]
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "window",
                    "since",
                    "users",
                    "sessions",
                    "factors",
                    "signIns",
                    "abuse"
                  ],
                  "properties": {
                    "abuse": {
                      "description": "Abuse signals over the window. Denied origins are deliberately absent: that check fires on unauthenticated traffic and is served by logs and metrics, not by per-product audit rows.",
                      "type": "object",
                      "required": [
                        "lockouts",
                        "mfaLockouts",
                        "failedSignIns",
                        "refreshReuseDetected",
                        "pwnedPasswordsSeen"
                      ],
                      "properties": {
                        "lockouts": {
                          "description": "Accounts locked by a failed-attempt ceiling — password and second factor both.",
                          "type": "integer"
                        },
                        "mfaLockouts": {
                          "description": "The subset of `lockouts` caused by the SECOND-factor ceiling.",
                          "type": "integer"
                        },
                        "failedSignIns": {
                          "description": "Mirrors `signIns.failed`, so the abuse block reads on its own.",
                          "type": "integer"
                        },
                        "pwnedPasswordsSeen": {
                          "description": "Breach-corpus matches against a user's password.",
                          "type": "integer"
                        },
                        "refreshReuseDetected": {
                          "description": "Refresh tokens spent twice outside the grace window — theft, not staleness. Each one revoked a whole session family.",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "since": {
                      "description": "ISO start of that window — the `created_at` floor every counter used.",
                      "type": "string"
                    },
                    "users": {
                      "description": "Point-in-time directory populations by DERIVED status — `user` has no status column, these are computed from `waitlisted` and the ban/delete/erase timestamps.",
                      "type": "object",
                      "required": [
                        "total",
                        "active",
                        "waitlisted",
                        "banned",
                        "deleted",
                        "erased"
                      ],
                      "properties": {
                        "total": {
                          "description": "Every directory row, GDPR tombstones included.",
                          "type": "integer"
                        },
                        "active": {
                          "description": "Full accounts: not waitlisted, not banned, not deleted, not erased.",
                          "type": "integer"
                        },
                        "banned": {
                          "description": "Banned accounts that are still present.",
                          "type": "integer"
                        },
                        "erased": {
                          "description": "GDPR-erased tombstones: the id survives, the PII does not.",
                          "type": "integer"
                        },
                        "deleted": {
                          "description": "SOFT-deleted and still recoverable — not erased.",
                          "type": "integer"
                        },
                        "waitlisted": {
                          "description": "Waitlist signups with no credential yet.",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "window": {
                      "description": "The window the time-bounded numbers were computed over.",
                      "type": "string",
                      "enum": [
                        "24h",
                        "7d",
                        "30d",
                        "90d"
                      ]
                    },
                    "factors": {
                      "description": "Enrolled second factors (TOTP and backup-code batches).",
                      "type": "object",
                      "required": [
                        "verified",
                        "usersWithFactor"
                      ],
                      "properties": {
                        "verified": {
                          "description": "VERIFIED second factors; an unverified enrollment gates nothing.",
                          "type": "integer"
                        },
                        "usersWithFactor": {
                          "description": "Distinct users holding at least one verified factor.",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    },
                    "signIns": {
                      "description": "Sign-in outcomes over the window, from the audit log.",
                      "type": "object",
                      "required": [
                        "succeeded",
                        "failed",
                        "successRate"
                      ],
                      "properties": {
                        "failed": {
                          "description": "Failed sign-in attempts in the window.",
                          "type": "integer"
                        },
                        "succeeded": {
                          "description": "Successful sign-ins in the window.",
                          "type": "integer"
                        },
                        "successRate": {
                          "description": "succeeded / (succeeded + failed), 4 decimals. NULL — never 0 — when nothing was attempted: an idle window and a totally broken one are opposite facts.",
                          "type": [
                            "number",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    "sessions": {
                      "description": "Device sessions.",
                      "type": "object",
                      "required": [
                        "active",
                        "createdInWindow"
                      ],
                      "properties": {
                        "active": {
                          "description": "Live right now: active, unrevoked and inside BOTH the sliding and absolute expiry.",
                          "type": "integer"
                        },
                        "createdInWindow": {
                          "description": "Sessions established since `since`.",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users": {
      "get": {
        "operationId": "users_users_list",
        "summary": "List the end users of this product, newest first.",
        "description": "List the end users of this product, newest first. Filter by an identifier/name substring and by status. Soft-deleted users are hidden unless `includeDeleted` is true. Paginate with the opaque `nextCursor`.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_list",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match against the user's identifiers (email) and name.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status: 'active' (not banned, not waitlisted), 'banned', or 'waitlisted'. Omit for all.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "banned",
                "waitlisted"
              ]
            }
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "description": "Include soft-deleted users. Default false — deleted users are hidden.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeWaitlisted",
            "in": "query",
            "required": false,
            "description": "Include waitlist signups. Default false: a waitlisted row is somebody who ASKED to join and cannot sign in, so it is not part of the directory an operator browses. Use `status: \"waitlisted\"` to see only them, or `users_waitlist_list` for the funnel.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "includeTestUsers",
            "in": "query",
            "required": false,
            "description": "Include TEST USERS. Default false: a test user is a fixture, not a customer — it is excluded from metering and from this listing for the same reason. Ask for it explicitly when you are debugging the fixtures themselves.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1-100. Default 25.",
            "schema": {
              "allOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from a previous response's `nextCursor`. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "users",
                    "nextCursor"
                  ],
                  "properties": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "productId",
                          "name",
                          "imageUrl",
                          "publicMetadata",
                          "privateMetadata",
                          "unsafeMetadata",
                          "waitlisted",
                          "testUser",
                          "bannedAt",
                          "lockedUntil",
                          "requiresReset",
                          "lastSignInAt",
                          "deletedAt",
                          "erasedAt",
                          "emailChangeLockedUntil",
                          "createdAt",
                          "updatedAt",
                          "identifiers"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bannedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "erasedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "imageUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "testUser": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "deletedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productId": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "waitlisted": {
                            "type": "boolean"
                          },
                          "identifiers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "type",
                                "value",
                                "valueCanonical",
                                "isPrimary",
                                "verificationStatus",
                                "verifiedAt"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ]
                                },
                                "value": {
                                  "type": "string"
                                },
                                "isPrimary": {
                                  "type": "boolean"
                                },
                                "verifiedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "valueCanonical": {
                                  "type": "string"
                                },
                                "verificationStatus": {
                                  "type": "string",
                                  "enum": [
                                    "unverified",
                                    "verified",
                                    "expired"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "lockedUntil": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastSignInAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "requiresReset": {
                            "type": "boolean"
                          },
                          "publicMetadata": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "unsafeMetadata": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "privateMetadata": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "emailChangeLockedUntil": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "users_users_create",
        "summary": "Create an end user of this product with at least one identifier (email).",
        "description": "Create an end user of this product with at least one identifier (email). Optionally store a password HASH — this toolkit never accepts a plaintext password, and nothing verifies the credential until auth flows land in Phase 2. Only one VERIFIED copy of an email may exist per product; unverified duplicates are allowed.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "The user's display name.",
                    "type": "string",
                    "minLength": 1
                  },
                  "imageUrl": {
                    "description": "URL of the user's avatar image.",
                    "type": "string",
                    "format": "uri"
                  },
                  "identifiers": {
                    "description": "The email addresses that reach this user. At least one is required.",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "required": [
                        "type",
                        "value"
                      ],
                      "properties": {
                        "type": {
                          "description": "Identifier kind. Only 'email' exists in this phase.",
                          "type": "string",
                          "enum": [
                            "email"
                          ]
                        },
                        "value": {
                          "description": "The email address. Stored canonicalised (lowercase, NFC) plus raw for display.",
                          "type": "string",
                          "minLength": 1
                        },
                        "verified": {
                          "description": "Record the identifier as already verified (use for trusted imports). Only ONE verified copy of a value may exist per product; unverified duplicates are allowed. Default false.",
                          "type": "boolean"
                        },
                        "isPrimary": {
                          "description": "Mark as the primary identifier of its type. The first identifier of a type defaults to primary.",
                          "type": "boolean"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "password": {
                    "description": "Optional credential to store for this user. Hashes only — this toolkit never accepts a plaintext password. Nothing verifies it until Phase 2.",
                    "type": "object",
                    "properties": {
                      "phcHash": {
                        "description": "A PHC-format password hash (e.g. an argon2id string) to store as-is. Never send a plaintext password.",
                        "type": "string",
                        "minLength": 1
                      },
                      "foreignHash": {
                        "description": "An imported hash from another system, to be lazily rehashed on the first successful sign-in (Phase 2).",
                        "type": "string",
                        "minLength": 1
                      },
                      "foreignHashAlgo": {
                        "description": "Algorithm of `foreignHash`. Required when `foreignHash` is set.",
                        "type": "string",
                        "enum": [
                          "bcrypt",
                          "argon2",
                          "pbkdf2",
                          "scrypt"
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "waitlisted": {
                    "description": "Create the user as a waitlist signup: no way in until promoted. Default false.",
                    "type": "boolean"
                  },
                  "testUser": {
                    "description": "Create this user as a TEST FIXTURE: excluded from metering (it never counts toward retained-users), hidden from the default users_users_list view, never really emailed, and — when the deployment configures one — able to sign in with the fixed magic OTP. REFUSED unless this product has test mode enabled, which a production deployment cannot do. There is no way to set or clear this later. Default false.",
                    "type": "boolean"
                  },
                  "requiresReset": {
                    "description": "Force a password reset before the user can sign in (use for unverifiable imported hashes). Default false.",
                    "type": "boolean"
                  },
                  "publicMetadata": {
                    "description": "Metadata the end user may READ and that may flow into the JWT. Management-plane write only.",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "privateMetadata": {
                    "description": "Metadata visible to the management plane only. Never exposed to the end user.",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "unsafeMetadata": {
                    "description": "Metadata the end user may WRITE in a later phase. Never trust it for authorization.",
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "identifiers"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "name",
                    "imageUrl",
                    "publicMetadata",
                    "privateMetadata",
                    "unsafeMetadata",
                    "waitlisted",
                    "testUser",
                    "bannedAt",
                    "lockedUntil",
                    "requiresReset",
                    "lastSignInAt",
                    "deletedAt",
                    "erasedAt",
                    "emailChangeLockedUntil",
                    "createdAt",
                    "updatedAt",
                    "identifiers"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bannedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "erasedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "testUser": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "waitlisted": {
                      "type": "boolean"
                    },
                    "identifiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "value",
                          "valueCanonical",
                          "isPrimary",
                          "verificationStatus",
                          "verifiedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "email"
                            ]
                          },
                          "value": {
                            "type": "string"
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "verifiedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "valueCanonical": {
                            "type": "string"
                          },
                          "verificationStatus": {
                            "type": "string",
                            "enum": [
                              "unverified",
                              "verified",
                              "expired"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSignInAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiresReset": {
                      "type": "boolean"
                    },
                    "publicMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "unsafeMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "privateMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "emailChangeLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}": {
      "delete": {
        "operationId": "users_users_delete",
        "summary": "Soft-delete an end user: the record is retained with `deletedAt` set and disappears from the default list.",
        "description": "Soft-delete an end user: the record is retained with `deletedAt` set and disappears from the default list. This is NOT GDPR erasure — no data is purged, and the user can still be fetched by id.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_delete",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The opaque user id returned by users_users_create or _list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "name",
                    "imageUrl",
                    "publicMetadata",
                    "privateMetadata",
                    "unsafeMetadata",
                    "waitlisted",
                    "testUser",
                    "bannedAt",
                    "lockedUntil",
                    "requiresReset",
                    "lastSignInAt",
                    "deletedAt",
                    "erasedAt",
                    "emailChangeLockedUntil",
                    "createdAt",
                    "updatedAt",
                    "identifiers"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bannedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "erasedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "testUser": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "waitlisted": {
                      "type": "boolean"
                    },
                    "identifiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "value",
                          "valueCanonical",
                          "isPrimary",
                          "verificationStatus",
                          "verifiedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "email"
                            ]
                          },
                          "value": {
                            "type": "string"
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "verifiedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "valueCanonical": {
                            "type": "string"
                          },
                          "verificationStatus": {
                            "type": "string",
                            "enum": [
                              "unverified",
                              "verified",
                              "expired"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSignInAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiresReset": {
                      "type": "boolean"
                    },
                    "publicMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "unsafeMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "privateMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "emailChangeLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "users_users_get",
        "summary": "Fetch one end user of this product by id, including their identifiers and metadata bags.",
        "description": "Fetch one end user of this product by id, including their identifiers and metadata bags. Soft-deleted users are still returned (with `deletedAt` set).",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_get",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The opaque user id returned by users_users_create or _list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "name",
                    "imageUrl",
                    "publicMetadata",
                    "privateMetadata",
                    "unsafeMetadata",
                    "waitlisted",
                    "testUser",
                    "bannedAt",
                    "lockedUntil",
                    "requiresReset",
                    "lastSignInAt",
                    "deletedAt",
                    "erasedAt",
                    "emailChangeLockedUntil",
                    "createdAt",
                    "updatedAt",
                    "identifiers"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bannedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "erasedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "testUser": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "waitlisted": {
                      "type": "boolean"
                    },
                    "identifiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "value",
                          "valueCanonical",
                          "isPrimary",
                          "verificationStatus",
                          "verifiedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "email"
                            ]
                          },
                          "value": {
                            "type": "string"
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "verifiedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "valueCanonical": {
                            "type": "string"
                          },
                          "verificationStatus": {
                            "type": "string",
                            "enum": [
                              "unverified",
                              "verified",
                              "expired"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSignInAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiresReset": {
                      "type": "boolean"
                    },
                    "publicMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "unsafeMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "privateMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "emailChangeLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "users_users_update",
        "summary": "Update an end user's profile, status flags and metadata bags.",
        "description": "Update an end user's profile, status flags and metadata bags. Only the fields you pass change. A metadata field REPLACES that whole bag — send the full object you want stored. Write matrix in this phase: the management plane writes all three bags (public: end-user readable and may flow into the JWT; private: management plane only; unsafe: end-user writable later and never authoritative for authorization).",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_update",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The user to update.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "description": "The user's display name. Pass null to clear.",
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "imageUrl": {
                    "description": "URL of the user's avatar image. Pass null to clear.",
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "waitlisted": {
                    "description": "Whether the user is still a waitlist signup.",
                    "type": "boolean"
                  },
                  "requiresReset": {
                    "description": "Whether the user must reset their password before signing in.",
                    "type": "boolean"
                  },
                  "lockedUntil": {
                    "description": "ISO-8601 timestamp of a temporary, self-healing lockout — the failed-attempt ceiling sets it and it expires on its own. Pass null to unlock the account immediately (audited as `user.unlocked`).",
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "publicMetadata": {
                    "description": "REPLACES the whole public metadata bag. Management-plane write, end-user read.",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "privateMetadata": {
                    "description": "REPLACES the whole private metadata bag. Management plane only.",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "unsafeMetadata": {
                    "description": "REPLACES the whole unsafe metadata bag. End-user writable in a later phase; never authoritative.",
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "name",
                    "imageUrl",
                    "publicMetadata",
                    "privateMetadata",
                    "unsafeMetadata",
                    "waitlisted",
                    "testUser",
                    "bannedAt",
                    "lockedUntil",
                    "requiresReset",
                    "lastSignInAt",
                    "deletedAt",
                    "erasedAt",
                    "emailChangeLockedUntil",
                    "createdAt",
                    "updatedAt",
                    "identifiers"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bannedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "erasedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "testUser": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "waitlisted": {
                      "type": "boolean"
                    },
                    "identifiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "value",
                          "valueCanonical",
                          "isPrimary",
                          "verificationStatus",
                          "verifiedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "email"
                            ]
                          },
                          "value": {
                            "type": "string"
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "verifiedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "valueCanonical": {
                            "type": "string"
                          },
                          "verificationStatus": {
                            "type": "string",
                            "enum": [
                              "unverified",
                              "verified",
                              "expired"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSignInAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiresReset": {
                      "type": "boolean"
                    },
                    "publicMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "unsafeMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "privateMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "emailChangeLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}/ban": {
      "post": {
        "operationId": "users_users_ban",
        "summary": "Ban an end user by stamping `bannedAt`.",
        "description": "Ban an end user by stamping `bannedAt`. NOTE: sessions do not exist yet — until Phase 2 lands auth flows, this is a flag on the record and nothing is revoked or refused by it. Idempotent: banning an already-banned user refreshes the stamp.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_ban",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The opaque user id returned by users_users_create or _list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "name",
                    "imageUrl",
                    "publicMetadata",
                    "privateMetadata",
                    "unsafeMetadata",
                    "waitlisted",
                    "testUser",
                    "bannedAt",
                    "lockedUntil",
                    "requiresReset",
                    "lastSignInAt",
                    "deletedAt",
                    "erasedAt",
                    "emailChangeLockedUntil",
                    "createdAt",
                    "updatedAt",
                    "identifiers"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bannedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "erasedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "testUser": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "waitlisted": {
                      "type": "boolean"
                    },
                    "identifiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "value",
                          "valueCanonical",
                          "isPrimary",
                          "verificationStatus",
                          "verifiedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "email"
                            ]
                          },
                          "value": {
                            "type": "string"
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "verifiedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "valueCanonical": {
                            "type": "string"
                          },
                          "verificationStatus": {
                            "type": "string",
                            "enum": [
                              "unverified",
                              "verified",
                              "expired"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSignInAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiresReset": {
                      "type": "boolean"
                    },
                    "publicMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "unsafeMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "privateMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "emailChangeLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}/erase": {
      "post": {
        "operationId": "users_users_erase",
        "summary": "GDPR hard erasure (Art.",
        "description": "GDPR hard erasure (Art. 17) of one end user. IRREVERSIBLE and quite different from users_users_delete: the identifier and identity rows are DELETED, the profile fields nulled and all three metadata bags emptied. What survives is a tombstone — the user row with its id and `erasedAt` — so that every foreign reference and webhook consumer holding that id still resolves. The audit trail is KEPT but pseudonymized (the metadata of rows targeting this user is cleared), because a security log that erasure can rewrite is not a security log. The email is freed: registering it again creates a NEW user id. Emits `users/user.erased` so consumers purge their own copies. Idempotent — erasing an already-erased user returns the same tombstone and changes nothing.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_erase",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The opaque user id returned by users_users_create or _list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "name",
                    "imageUrl",
                    "publicMetadata",
                    "privateMetadata",
                    "unsafeMetadata",
                    "waitlisted",
                    "testUser",
                    "bannedAt",
                    "lockedUntil",
                    "requiresReset",
                    "lastSignInAt",
                    "deletedAt",
                    "erasedAt",
                    "emailChangeLockedUntil",
                    "createdAt",
                    "updatedAt",
                    "identifiers"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bannedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "erasedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "testUser": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "waitlisted": {
                      "type": "boolean"
                    },
                    "identifiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "value",
                          "valueCanonical",
                          "isPrimary",
                          "verificationStatus",
                          "verifiedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "email"
                            ]
                          },
                          "value": {
                            "type": "string"
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "verifiedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "valueCanonical": {
                            "type": "string"
                          },
                          "verificationStatus": {
                            "type": "string",
                            "enum": [
                              "unverified",
                              "verified",
                              "expired"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSignInAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiresReset": {
                      "type": "boolean"
                    },
                    "publicMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "unsafeMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "privateMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "emailChangeLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}/factors": {
      "get": {
        "operationId": "users_factors_list",
        "summary": "List the MFA factors an end user has enrolled: `totp` (an authenticator app) and `backup_codes` (single-use recovery codes), each with its status (`unverified` until enrollment was confirmed — an unverified factor gates NOTHING), when it was created and confirmed, and when it was last used.",
        "description": "List the MFA factors an end user has enrolled: `totp` (an authenticator app) and `backup_codes` (single-use recovery codes), each with its status (`unverified` until enrollment was confirmed — an unverified factor gates NOTHING), when it was created and confirmed, and when it was last used. Backup codes also report `remaining`, the number still unspent; a user at 0 can no longer use that factor and should regenerate. NO SECRET IS EVER RETURNED — not the TOTP secret, not a backup code, not a digest of one. A user with no factors returns an empty list, which also means their sign-in completes at `aal1`.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_factors_list",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The end user whose enrolled factors to list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "factors"
                  ],
                  "properties": {
                    "factors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "type",
                          "status",
                          "createdAt",
                          "verifiedAt",
                          "lastUsedAt",
                          "remaining"
                        ],
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "totp",
                              "backup_codes",
                              "webauthn"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "unverified",
                              "verified"
                            ]
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "remaining": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "verifiedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}/factors/reset": {
      "post": {
        "operationId": "users_factors_reset",
        "summary": "OPERATOR RESET of an end user's MFA, for the case the normal recovery cannot serve: the user lost their authenticator AND their backup codes.",
        "description": "OPERATOR RESET of an end user's MFA, for the case the normal recovery cannot serve: the user lost their authenticator AND their backup codes. This does NOT remove anything now. It SCHEDULES the removal behind this product's mandatory delay (config `mfa.resetDelayHours`, default 72) and immediately emails the user's primary address an abort link; if that mailbox is alive and its owner clicks, nothing happens. When the delay elapses, EVERY factor is deleted, every backup code with it, and EVERY SESSION of that user is revoked (a session that reached `aal2` must not outlive the factor that earned it) — after which the user signs in with their first factor alone and enrolls again. Every step is audited (`factor.reset_scheduled` / `_cancelled` / `_applied`) with the `reason` you pass, so do the identity proofing FIRST and write down what it was: this tool is a supervised account takeover, and the trail is what makes it reviewable.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_factors_reset",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The end user whose second factor is being reset.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "description": "What identity proofing was done and under which ticket. Recorded verbatim in the audit row — this is the whole point of the tool being audited.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "scheduledFor"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "scheduledFor": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}/passkeys": {
      "get": {
        "operationId": "users_passkeys_list",
        "summary": "List the passkeys (WebAuthn credentials) an end user has registered: the credential's id, the name the user gave it, its transports (`internal` is a platform passkey on the device itself, `usb`/`nfc`/`ble` a security key, `hybrid` a phone used from another device), the authenticator model's `aaguid`, whether the credential is `backedUp` (synced by the platform, so it survives losing the device), its sign counter and when it was last used.",
        "description": "List the passkeys (WebAuthn credentials) an end user has registered: the credential's id, the name the user gave it, its transports (`internal` is a platform passkey on the device itself, `usb`/`nfc`/`ble` a security key, `hybrid` a phone used from another device), the authenticator model's `aaguid`, whether the credential is `backedUp` (synced by the platform, so it survives losing the device), its sign counter and when it was last used. NO KEY MATERIAL IS EVER RETURNED — the public key is deliberately absent: nothing on this plane needs it, and it is a stable cross-site fingerprint for the device holding it. A user with passkeys signs in without a password, and reaches `aal2` in one gesture whenever their authenticator verified them.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_passkeys_list",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The end user whose passkeys to list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "passkeys"
                  ],
                  "properties": {
                    "passkeys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "transports",
                          "aaguid",
                          "backedUp",
                          "signCount",
                          "createdAt",
                          "lastUsedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "aaguid": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "backedUp": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "signCount": {
                            "type": "integer"
                          },
                          "lastUsedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "transports": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}/passkeys/{passkeyId}": {
      "delete": {
        "operationId": "users_passkeys_revoke",
        "summary": "REVOKE ONE passkey — the support path for a lost or stolen device.",
        "description": "REVOKE ONE passkey — the support path for a lost or stolen device. It takes effect IMMEDIATELY and permanently: that credential can never sign in again, and the user re-registers from a device they still hold. It is REFUSED (`status: 'failed'`, code `passkey_last_way_in`) when this credential is the account's only remaining way in — no other identity and no verified identifier — because removing it would strand the account forever; add another way in first. It cannot CREATE a passkey: there is no admin-side registration in this toolkit at all, since a credential an operator could enroll is one they could keep. Every revoke is audited (`passkey.deleted`) with the `reason` you pass, so do the identity proofing FIRST and write down what it was.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_passkeys_revoke",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The end user whose passkey is being revoked.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "passkeyId",
            "in": "path",
            "required": true,
            "description": "Which credential to revoke — the `id` from `users_passkeys_list`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "reason": {
                    "description": "Why this credential is being revoked, and under which ticket. Recorded verbatim in the audit row — this is the whole point of the tool being audited.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "description": "Present when the revoke was refused — today, only because it was the last way in.",
                      "anyOf": [
                        {
                          "type": "object",
                          "required": [
                            "code",
                            "message"
                          ],
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "message": {
                              "type": "string"
                            }
                          },
                          "additionalProperties": false
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "deleted",
                        "failed"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}/primary-identifier": {
      "post": {
        "operationId": "users_users_set_primary_identifier",
        "summary": "OPERATOR OVERRIDE of a user's primary email address, for the case the normal flow cannot serve: the old address is unreachable (dead mailbox, imported user), so the user cannot approve the change themselves.",
        "description": "OPERATOR OVERRIDE of a user's primary email address, for the case the normal flow cannot serve: the old address is unreachable (dead mailbox, imported user), so the user cannot approve the change themselves. This does NOT swap the address now. It SCHEDULES the swap behind this product's mandatory delay (config `emailChange.overrideDelayHours`, default 72) and immediately emails the OLD address an abort link; if that mailbox is alive and its owner clicks, nothing happens. When the delay elapses the address is swapped, verified, and EVERY SESSION of that user is revoked. Every step is audited (`email_change.override_scheduled` / `_cancelled` / `_applied`) with the `reason` you pass, so do the identity proofing first and write down what it was. Use users_users_update for profile fields; this tool is only for the identity a user signs in with.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_set_primary_identifier",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The user whose primary email address is being replaced.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "description": "The address to make primary. Must not already belong, verified, to another user of this product.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 320
                  },
                  "reason": {
                    "description": "What identity proofing was done and under which ticket. Recorded verbatim in the audit row — this is the whole point of the tool being audited.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  }
                },
                "required": [
                  "email",
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "requestId",
                    "scheduledFor"
                  ],
                  "properties": {
                    "requestId": {
                      "type": "string"
                    },
                    "scheduledFor": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/{userId}/unban": {
      "post": {
        "operationId": "users_users_unban",
        "summary": "Lift a ban by clearing `bannedAt`.",
        "description": "Lift a ban by clearing `bannedAt`. See users_users_ban: the flag has no enforcement until Phase 2. Idempotent.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_unban",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "The opaque user id returned by users_users_create or _list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "productId",
                    "name",
                    "imageUrl",
                    "publicMetadata",
                    "privateMetadata",
                    "unsafeMetadata",
                    "waitlisted",
                    "testUser",
                    "bannedAt",
                    "lockedUntil",
                    "requiresReset",
                    "lastSignInAt",
                    "deletedAt",
                    "erasedAt",
                    "emailChangeLockedUntil",
                    "createdAt",
                    "updatedAt",
                    "identifiers"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "bannedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "erasedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "imageUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "testUser": {
                      "type": "boolean"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "deletedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "waitlisted": {
                      "type": "boolean"
                    },
                    "identifiers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "type",
                          "value",
                          "valueCanonical",
                          "isPrimary",
                          "verificationStatus",
                          "verifiedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "email"
                            ]
                          },
                          "value": {
                            "type": "string"
                          },
                          "isPrimary": {
                            "type": "boolean"
                          },
                          "verifiedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "valueCanonical": {
                            "type": "string"
                          },
                          "verificationStatus": {
                            "type": "string",
                            "enum": [
                              "unverified",
                              "verified",
                              "expired"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "lockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "lastSignInAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiresReset": {
                      "type": "boolean"
                    },
                    "publicMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "unsafeMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "privateMetadata": {
                      "type": "object",
                      "additionalProperties": {}
                    },
                    "emailChangeLockedUntil": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/export": {
      "get": {
        "operationId": "users_users_export",
        "summary": "Export the end users of this product as pages of full records (profile, identifiers, metadata bags), using the same filters as users_users_list.",
        "description": "Export the end users of this product as pages of full records (profile, identifiers, metadata bags), using the same filters as users_users_list. Password hashes are NEVER included — neither a PHC hash nor an imported foreign one. Exporting credentials is deferred to a later phase, behind explicit elevated approval; until that gating exists, a hash cannot leave this toolkit. Every call is AUDITED (action `users.export`, with the filter and the row count), so this is not a silent read: use it for migrations, backups and subject-access requests, not as a listing shortcut. Page through with `nextCursor`.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_export",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring match against the user's identifiers (email) and name.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status: 'active', 'banned' or 'waitlisted'. Omit for all.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "banned",
                "waitlisted"
              ]
            }
          },
          {
            "name": "includeDeleted",
            "in": "query",
            "required": false,
            "description": "Include soft-deleted users. Default false.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Rows per page, 1-500. Default 100.",
            "schema": {
              "allOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 500
                }
              ]
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque cursor from the previous page's `nextCursor`. Omit for the first page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "exportedAt",
                    "count",
                    "users",
                    "nextCursor"
                  ],
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "productId",
                          "name",
                          "imageUrl",
                          "publicMetadata",
                          "privateMetadata",
                          "unsafeMetadata",
                          "waitlisted",
                          "testUser",
                          "bannedAt",
                          "lockedUntil",
                          "requiresReset",
                          "lastSignInAt",
                          "deletedAt",
                          "erasedAt",
                          "emailChangeLockedUntil",
                          "createdAt",
                          "updatedAt",
                          "identifiers"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "bannedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "erasedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "imageUrl": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "testUser": {
                            "type": "boolean"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "deletedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "productId": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "waitlisted": {
                            "type": "boolean"
                          },
                          "identifiers": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "required": [
                                "id",
                                "type",
                                "value",
                                "valueCanonical",
                                "isPrimary",
                                "verificationStatus",
                                "verifiedAt"
                              ],
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "type": {
                                  "type": "string",
                                  "enum": [
                                    "email"
                                  ]
                                },
                                "value": {
                                  "type": "string"
                                },
                                "isPrimary": {
                                  "type": "boolean"
                                },
                                "verifiedAt": {
                                  "type": [
                                    "string",
                                    "null"
                                  ]
                                },
                                "valueCanonical": {
                                  "type": "string"
                                },
                                "verificationStatus": {
                                  "type": "string",
                                  "enum": [
                                    "unverified",
                                    "verified",
                                    "expired"
                                  ]
                                }
                              },
                              "additionalProperties": false
                            }
                          },
                          "lockedUntil": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "lastSignInAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "requiresReset": {
                            "type": "boolean"
                          },
                          "publicMetadata": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "unsafeMetadata": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "privateMetadata": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "emailChangeLockedUntil": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "exportedAt": {
                      "type": "string"
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/import": {
      "post": {
        "operationId": "users_users_import",
        "summary": "Bulk-import end users into this product, up to 500 rows per call — batch client-side beyond that.",
        "description": "Bulk-import end users into this product, up to 500 rows per call — batch client-side beyond that. Hashes only: pass `password.phcHash` for an argon2id PHC string, or `password.foreignHash` + `foreignHashAlgo` (bcrypt/argon2/pbkdf2/scrypt) for a hash from the system you are migrating off. A foreign hash is stored INERT — nothing verifies it until sign-in lands in Phase 2, where it is checked once and rehashed — so set `requiresReset: true` on rows whose source hash you do not trust. IDEMPOTENT by canonical identifier: a row whose email already exists VERIFIED in this product is skipped, not duplicated, so re-running the same file is safe. Imported identifiers default to verified (unlike users_users_create) — pass `verified: false` per identifier for addresses the source system never confirmed. Returns a PER-ROW report ({row, status, userId, reason}) plus counts: one malformed row never fails the batch. Emits ONE batch event (`users/user.imported`, with counts) rather than a per-user created event, and writes ONE audit row.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_import",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "users": {
                    "description": "The users to import, at most 500 per call — batch client-side beyond that. Each row: identifiers (email), optional profile, optional password HASH, optional flags.",
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 500,
                    "items": {}
                  }
                },
                "required": [
                  "users"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "requested",
                    "created",
                    "skipped",
                    "failed",
                    "results"
                  ],
                  "properties": {
                    "failed": {
                      "type": "integer"
                    },
                    "created": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "row",
                          "status",
                          "userId",
                          "reason"
                        ],
                        "properties": {
                          "row": {
                            "type": "integer"
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "created",
                              "skipped",
                              "failed"
                            ]
                          },
                          "userId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "skipped": {
                      "type": "integer"
                    },
                    "requested": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/users/invite": {
      "post": {
        "operationId": "users_users_invite",
        "summary": "Invite somebody to this product by email.",
        "description": "Invite somebody to this product by email. Creates the user immediately with an UNVERIFIED identifier and NO credential — they appear in users_users_list straight away but cannot sign in until they accept — then mails a one-time invite link. Accepting the link sets their first password and verifies the address; no session comes from the link itself. IDEMPOTENT by address: re-inviting returns the SAME user (`created: false`), and whether it re-mails is a cooldown decision, so pressing the button twice cannot flood a mailbox (`mailed: false` means the invite is live but no email went out this time). Refuses an address that already belongs to a signed-up user. Requires a verified sender in this product's mail toolkit (config `email.from`); without one nothing is sent and `mailed` is false.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_users_invite",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "description": "The address to invite. Stored canonicalised (lowercase, NFC) plus raw for display.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 320
                  },
                  "name": {
                    "description": "The invitee's display name.",
                    "type": "string",
                    "minLength": 1
                  },
                  "publicMetadata": {
                    "description": "Metadata the end user may READ and that may flow into the JWT.",
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "privateMetadata": {
                    "description": "Metadata visible to the management plane only. Never exposed to the end user.",
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "userId",
                    "created",
                    "mailed",
                    "expiresAt"
                  ],
                  "properties": {
                    "mailed": {
                      "type": "boolean"
                    },
                    "userId": {
                      "type": "string"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/waitlist/erase": {
      "post": {
        "operationId": "users_waitlist_erase",
        "summary": "GDPR-erase one waitlist signup: the entry with its attribution and consent proof is deleted and the directory row is hard-erased (the id survives as a tombstone, the PII does not).",
        "description": "GDPR-erase one waitlist signup: the entry with its attribution and consent proof is deleted and the directory row is hard-erased (the id survives as a tombstone, the PII does not). IRREVERSIBLE. Use it for a right-to-erasure request; routine cleanup of stale pending entries happens on its own through the retention sweep.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_waitlist_erase",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "description": "The waitlisted user whose entry and directory row to erase.",
                    "type": "string",
                    "minLength": 1
                  }
                },
                "required": [
                  "userId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "erased"
                  ],
                  "properties": {
                    "erased": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/waitlist/funnel": {
      "post": {
        "operationId": "users_waitlist_funnel",
        "summary": "Count this product's waitlist by funnel stage.",
        "description": "Count this product's waitlist by funnel stage. `pending` is people waiting, `unconfirmed` is double-opt-in signups whose address never confirmed (they are NEVER invited), `invited` have a live invite, `registered` accepted it and are now full users, `withdrawn` asked to be removed. One consistent snapshot, not five separate reads.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_waitlist_funnel",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "pending",
                    "unconfirmed",
                    "invited",
                    "registered",
                    "withdrawn",
                    "total"
                  ],
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "invited": {
                      "type": "integer"
                    },
                    "pending": {
                      "type": "integer"
                    },
                    "withdrawn": {
                      "type": "integer"
                    },
                    "registered": {
                      "type": "integer"
                    },
                    "unconfirmed": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/waitlist/import": {
      "post": {
        "operationId": "users_waitlist_import",
        "summary": "Import a LEGACY waitlist into this product.",
        "description": "Import a LEGACY waitlist into this product. Each row becomes a directory user in state `waitlisted` (no credential — a waitlist signup has nothing to sign in with) plus a WaitlistEntry whose consent proof is stored VERBATIM: the policy version, the timestamp and the source the OLD system recorded, never the import time. Rides the Phase 1 bulk import, so it is IDEMPOTENT by canonical identifier — re-running the same file skips instead of duplicating — and reports PER ROW ({row, status, userId, reason}) so one bad row never fails the batch. Addresses that already have an entry are skipped `already_on_list`; addresses on the suppression list (they withdrew) are skipped `suppressed` and are NOT resurrected. SENDS NO EMAIL: an import is a migration, not a signup gesture. Imported addresses land UNVERIFIED, and by default confirmed — pass `confirmed: false` for rows the source system never reached, which then count as `unconfirmed` and are never invited. Up to 500 rows per call.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_waitlist_import",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "entries": {
                    "description": "The legacy signups to import, at most 500 per call — batch client-side beyond that.",
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 500,
                    "items": {
                      "type": "object",
                      "required": [
                        "identifier",
                        "consent"
                      ],
                      "properties": {
                        "name": {
                          "description": "The signup's display name.",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 255
                        },
                        "consent": {
                          "description": "The consent proof from the source system. REQUIRED: a waitlist entry with no evidence of consent is exactly what this import exists to avoid creating.",
                          "type": "object",
                          "required": [
                            "policyVersion",
                            "acceptedAt",
                            "source"
                          ],
                          "properties": {
                            "ip": {
                              "description": "The IP the source system recorded, when it recorded one.",
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 64
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "source": {
                              "description": "Where the acceptance happened in the source system, e.g. `legacy-widget`.",
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            },
                            "userAgent": {
                              "description": "The user agent the source system recorded, when it recorded one.",
                              "anyOf": [
                                {
                                  "type": "string",
                                  "maxLength": 512
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "acceptedAt": {
                              "description": "When they accepted it, as recorded by the source system. Carried over verbatim — this is the evidence, and stamping it with the import time would destroy it.",
                              "type": "string",
                              "format": "date-time"
                            },
                            "policyVersion": {
                              "description": "The privacy-policy version the signer accepted in the SOURCE system.",
                              "type": "string",
                              "minLength": 1,
                              "maxLength": 64
                            }
                          },
                          "additionalProperties": false
                        },
                        "confirmed": {
                          "description": "Whether the address had proven itself reachable in the source system. Default true — a legacy list has already been mailed. Pass false to land the row as unconfirmed, where it is reported separately and is never invited.",
                          "type": "boolean"
                        },
                        "identifier": {
                          "description": "The email address on the legacy list. Stored canonicalised plus raw for display.",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 320
                        },
                        "attribution": {
                          "description": "Referrer / UTM attribution the source system recorded.",
                          "type": "object",
                          "properties": {
                            "utmTerm": {
                              "description": "utm_term of the visit.",
                              "type": "string",
                              "maxLength": 255
                            },
                            "referrer": {
                              "description": "The document referrer of the signup page.",
                              "type": "string",
                              "maxLength": 2048
                            },
                            "utmMedium": {
                              "description": "utm_medium of the visit.",
                              "type": "string",
                              "maxLength": 255
                            },
                            "utmSource": {
                              "description": "utm_source of the visit.",
                              "type": "string",
                              "maxLength": 255
                            },
                            "utmContent": {
                              "description": "utm_content of the visit.",
                              "type": "string",
                              "maxLength": 255
                            },
                            "landingPage": {
                              "description": "The URL the signup was submitted from.",
                              "type": "string",
                              "maxLength": 2048
                            },
                            "utmCampaign": {
                              "description": "utm_campaign of the visit.",
                              "type": "string",
                              "maxLength": 255
                            }
                          },
                          "additionalProperties": false
                        },
                        "unsafeMetadata": {
                          "description": "End-user-writable metadata to carry onto the created user.",
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "entries"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "requested",
                    "imported",
                    "skipped",
                    "failed",
                    "results"
                  ],
                  "properties": {
                    "failed": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "row",
                          "status",
                          "userId",
                          "reason"
                        ],
                        "properties": {
                          "row": {
                            "type": "integer"
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "imported",
                              "skipped",
                              "failed"
                            ]
                          },
                          "userId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "skipped": {
                      "type": "integer"
                    },
                    "imported": {
                      "type": "integer"
                    },
                    "requested": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/waitlist/invite": {
      "post": {
        "operationId": "users_waitlist_invite",
        "summary": "Promote waitlisted users by sending them the STANDARD invite email — the same one-time invite link `users_users_invite` sends, so accepting it sets their first password, verifies their address and turns the entry into `registered`.",
        "description": "Promote waitlisted users by sending them the STANDARD invite email — the same one-time invite link `users_users_invite` sends, so accepting it sets their first password, verifies their address and turns the entry into `registered`. Batched: pass up to 100 user ids. Entries that already registered, that belong to another product, or whose address is on the suppression list (they withdrew) are SKIPPED with a reason rather than mailed. Requires a verified sender in this product's mail toolkit (config `email.from`).",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_waitlist_invite",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userIds": {
                    "description": "The waitlisted users to promote, up to 100 per call. Each gets the STANDARD invite email; accepting it is what creates their credential.",
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 100,
                    "items": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                },
                "required": [
                  "userIds"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "invited",
                    "skipped",
                    "results"
                  ],
                  "properties": {
                    "invited": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "userId",
                          "status",
                          "reason"
                        ],
                        "properties": {
                          "reason": {
                            "anyOf": [
                              {
                                "type": "string",
                                "enum": [
                                  "suppressed",
                                  "not_found",
                                  "already_registered"
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "invited",
                              "skipped"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "skipped": {
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/waitlist/list": {
      "post": {
        "operationId": "users_waitlist_list",
        "summary": "List this product's waitlist entries, newest first.",
        "description": "List this product's waitlist entries, newest first. Each row is a directory user in state `waitlisted` PLUS the feature-local funnel state: where the signup came from (referrer/UTM), the consent proof recorded for it, and its status. Filter by `status` to work one stage of the funnel, or by `confirmed: false` to find double-opt-in signups whose address never confirmed. Paginate with `cursor`.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_waitlist_list",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "description": "Filter by funnel status: 'pending', 'invited', 'registered' or 'withdrawn'. Omit for all.",
                    "type": "string",
                    "enum": [
                      "pending",
                      "invited",
                      "registered",
                      "withdrawn"
                    ]
                  },
                  "confirmed": {
                    "description": "Double opt-in only: false returns entries whose address never confirmed. Omit for both.",
                    "type": "boolean"
                  },
                  "limit": {
                    "description": "Entries per page, 1-100. Default 25.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "cursor": {
                    "description": "Opaque cursor from the previous page's `nextCursor`. Omit for the first page.",
                    "type": "string"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "entries",
                    "nextCursor"
                  ],
                  "properties": {
                    "entries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "userId",
                          "status",
                          "identifier",
                          "attribution",
                          "consentProof",
                          "inviteTokenId",
                          "confirmedAt",
                          "invitedAt",
                          "registeredAt",
                          "withdrawnAt",
                          "createdAt"
                        ],
                        "properties": {
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "invited",
                              "registered",
                              "withdrawn"
                            ]
                          },
                          "userId": {
                            "type": "string"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "invitedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "identifier": {
                            "type": "string"
                          },
                          "attribution": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "confirmedAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "withdrawnAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "consentProof": {
                            "type": "object",
                            "additionalProperties": {}
                          },
                          "registeredAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "inviteTokenId": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/webhooks": {
      "get": {
        "operationId": "users_webhooks_list",
        "summary": "List this product's webhook endpoints, newest first — url, subscribed events, paused state and the visible prefix of the current signing secret.",
        "description": "List this product's webhook endpoints, newest first — url, subscribed events, paused state and the visible prefix of the current signing secret. The secret itself is never here.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_webhooks_list",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "webhooks"
                  ],
                  "properties": {
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "url",
                          "events",
                          "description",
                          "active",
                          "secretPrefix",
                          "createdAt",
                          "updatedAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string"
                          },
                          "active": {
                            "type": "boolean"
                          },
                          "events": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "user.created",
                                "user.updated",
                                "user.deleted",
                                "session.revoked"
                              ]
                            }
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string"
                          },
                          "description": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "secretPrefix": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "users_webhooks_create",
        "summary": "Register an outbound webhook endpoint for this product.",
        "description": "Register an outbound webhook endpoint for this product. Deliveries are signed with the Standard Webhooks wire format (webhook-id / webhook-timestamp / webhook-signature). The signing secret is returned EXACTLY ONCE — it is derived, never stored, so a lost secret is rotated with users_webhooks_rotate_secret, never recovered.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_webhooks_create",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "Where deliveries are POSTed. HTTPS only, no embedded credentials.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "events": {
                    "description": "Which events to deliver. `user.created`, `user.updated` and `user.deleted` mirror the directory; `session.revoked` fires on sign-out, ban, erase and refresh-token reuse.",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "user.created",
                        "user.updated",
                        "user.deleted",
                        "session.revoked"
                      ]
                    }
                  },
                  "description": {
                    "description": "A label only humans read — which system this endpoint feeds.",
                    "type": "string",
                    "maxLength": 200
                  }
                },
                "required": [
                  "url",
                  "events"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "events",
                    "description",
                    "active",
                    "secretPrefix",
                    "createdAt",
                    "updatedAt",
                    "secret"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "user.created",
                          "user.updated",
                          "user.deleted",
                          "session.revoked"
                        ]
                      }
                    },
                    "secret": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secretPrefix": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/webhooks/{id}": {
      "delete": {
        "operationId": "users_webhooks_delete",
        "summary": "Delete a webhook endpoint, its signing secrets and its delivery log.",
        "description": "Delete a webhook endpoint, its signing secrets and its delivery log. Immediate and final; deliveries already in flight stop.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_webhooks_delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the webhook endpoint.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "deleted"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean",
                      "const": true
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "users_webhooks_get",
        "summary": "One webhook endpoint.",
        "description": "One webhook endpoint. Another product’s endpoint and one that never existed answer identically.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_webhooks_get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the webhook endpoint.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "events",
                    "description",
                    "active",
                    "secretPrefix",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "user.created",
                          "user.updated",
                          "user.deleted",
                          "session.revoked"
                        ]
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secretPrefix": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "users_webhooks_update",
        "summary": "Change a webhook endpoint: its url, its subscribed events, its description, or `active` to pause and resume delivery without losing the endpoint or its secret.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_webhooks_update",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the webhook endpoint.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "description": "Where deliveries are POSTed. HTTPS only, no embedded credentials.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2048
                  },
                  "events": {
                    "description": "Which events to deliver. `user.created`, `user.updated` and `user.deleted` mirror the directory; `session.revoked` fires on sign-out, ban, erase and refresh-token reuse.",
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "enum": [
                        "user.created",
                        "user.updated",
                        "user.deleted",
                        "session.revoked"
                      ]
                    }
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "active": {
                    "description": "false pauses delivery without losing the endpoint or its secret.",
                    "type": "boolean"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "events",
                    "description",
                    "active",
                    "secretPrefix",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "user.created",
                          "user.updated",
                          "user.deleted",
                          "session.revoked"
                        ]
                      }
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secretPrefix": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/webhooks/{id}/deliveries": {
      "get": {
        "operationId": "users_webhooks_deliveries_list",
        "summary": "This endpoint's recent deliveries, newest first: event type and id, status (pending / succeeded / failed), attempt count, the last response status and the last error.",
        "description": "This endpoint's recent deliveries, newest first: event type and id, status (pending / succeeded / failed), attempt count, the last response status and the last error. This is where 'my webhook never arrived' is answered.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_webhooks_deliveries_list",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the webhook endpoint whose deliveries to list.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deliveries"
                  ],
                  "properties": {
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "webhookId",
                          "eventType",
                          "eventId",
                          "status",
                          "attempts",
                          "responseStatus",
                          "lastError",
                          "lastAttemptAt",
                          "createdAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "pending",
                              "succeeded",
                              "failed"
                            ]
                          },
                          "eventId": {
                            "type": "string"
                          },
                          "attempts": {
                            "type": "number"
                          },
                          "createdAt": {
                            "type": "string"
                          },
                          "eventType": {
                            "type": "string",
                            "enum": [
                              "user.created",
                              "user.updated",
                              "user.deleted",
                              "session.revoked"
                            ]
                          },
                          "lastError": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "webhookId": {
                            "type": "string"
                          },
                          "lastAttemptAt": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "responseStatus": {
                            "type": [
                              "number",
                              "null"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/users/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "users_webhooks_rotate_secret",
        "summary": "Mint a NEW signing secret for this endpoint and return it exactly once.",
        "description": "Mint a NEW signing secret for this endpoint and return it exactly once. The previous secret keeps verifying for 24 hours — both signatures ride the webhook-signature header — so a receiver can swap its copy without dropping a delivery.",
        "tags": [
          "Users"
        ],
        "x-mcp-tool": "users_webhooks_rotate_secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id of the webhook endpoint.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "url",
                    "events",
                    "description",
                    "active",
                    "secretPrefix",
                    "createdAt",
                    "updatedAt",
                    "secret"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "url": {
                      "type": "string"
                    },
                    "active": {
                      "type": "boolean"
                    },
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "user.created",
                          "user.updated",
                          "user.deleted",
                          "session.revoked"
                        ]
                      }
                    },
                    "secret": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "description": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "secretPrefix": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/waitlist/config": {
      "get": {
        "operationId": "waitlist_config_get",
        "summary": "Get the waitlist configuration (consent text, policy url, policy label, policy version, sender domain, invite template, invite subject) for the current product.",
        "description": "Get the waitlist configuration (consent text, policy url, policy label, policy version, sender domain, invite template, invite subject) for the current product. Returns null if not configured yet.",
        "tags": [
          "Waitlist"
        ],
        "x-mcp-tool": "waitlist_config_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "object",
                      "required": [
                        "productId",
                        "policyVersion",
                        "consentText",
                        "policyUrl",
                        "policyLabel",
                        "senderDomain",
                        "senderName",
                        "inviteTemplate",
                        "inviteSubject",
                        "siteBaseUrl",
                        "createdAt",
                        "updatedAt"
                      ],
                      "properties": {
                        "createdAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "policyUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "productId": {
                          "type": "string"
                        },
                        "updatedAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "senderName": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "consentText": {
                          "type": "string"
                        },
                        "policyLabel": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "siteBaseUrl": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "senderDomain": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "inviteSubject": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "policyVersion": {
                          "type": "string"
                        },
                        "inviteTemplate": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "additionalProperties": false
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "waitlist_config_upsert",
        "summary": "Create or replace the waitlist configuration for the current product (full-document upsert).",
        "description": "Create or replace the waitlist configuration for the current product (full-document upsert). consent_text is plain text (may contain a {policy} placeholder); policy_url/policy_label render a structured policy link; invite_subject is the invite email subject line. Stored as-is; content correctness is the controller responsibility.",
        "tags": [
          "Waitlist"
        ],
        "x-mcp-tool": "waitlist_config_upsert",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "policyVersion": {
                    "description": "Policy version label, controller-owned free string. Stored as-is, not validated for monotonicity.",
                    "type": "string",
                    "minLength": 1
                  },
                  "consentText": {
                    "description": "Plain-text consent statement shown at signup. May contain a {policy} placeholder marking the policy link. Stored as-is (no HTML sanitization).",
                    "type": "string",
                    "minLength": 1
                  },
                  "policyUrl": {
                    "description": "Policy link URL (http/https/mailto). Rendered as a structured link in the form. Null to clear.",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "policyLabel": {
                    "description": "Visible text for the policy link. Falls back to the URL itself if absent.",
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "senderDomain": {
                    "description": "Sender domain for invite emails (bare hostname). Verification happens at send time, not here. Null to clear.",
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "senderName": {
                    "description": "Controller display name shown as the invite From name and in the default email body (A7§64 controller identity). Stored as-is. Null to clear (falls back to a generic sender name).",
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "inviteTemplate": {
                    "description": "Invite email template ({{vars}}). Stored as-is; rendered/validated at send time. Null to clear.",
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "inviteSubject": {
                    "description": "Invite email subject line. Plain text, stored as-is; CR/LF stripped at send time. Null to clear (falls back to a default subject).",
                    "anyOf": [
                      {
                        "type": "string",
                        "minLength": 1
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "siteBaseUrl": {
                    "description": "Per-product public base URL of the tenant site; invite (/signup) and opt-out (/withdraw) links are built from it. http/https only, path allowed, trailing slash stripped. Stored as-is (DP-013); not content-verified. Null to clear.",
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "policyVersion",
                  "consentText"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "productId",
                    "policyVersion",
                    "consentText",
                    "policyUrl",
                    "policyLabel",
                    "senderDomain",
                    "senderName",
                    "inviteTemplate",
                    "inviteSubject",
                    "siteBaseUrl",
                    "createdAt",
                    "updatedAt"
                  ],
                  "properties": {
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "policyUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "productId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "senderName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "consentText": {
                      "type": "string"
                    },
                    "policyLabel": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "siteBaseUrl": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "senderDomain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "inviteSubject": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "policyVersion": {
                      "type": "string"
                    },
                    "inviteTemplate": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/waitlist/embed": {
      "get": {
        "operationId": "waitlist_embed_get",
        "summary": "Returns the waitlist embed <script> tag for the current product.",
        "tags": [
          "Waitlist"
        ],
        "x-mcp-tool": "waitlist_embed_get",
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "script_tag",
                    "product_id",
                    "public_edge_url"
                  ],
                  "properties": {
                    "product_id": {
                      "type": "string"
                    },
                    "script_tag": {
                      "type": "string"
                    },
                    "public_edge_url": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/waitlist/erasure": {
      "post": {
        "operationId": "waitlist_signups_erase",
        "summary": "GDPR Art.17 erasure by email within the current product.",
        "description": "GDPR Art.17 erasure by email within the current product. Hard-deletes the signup and its invite tokens, reduces the consent-ledger rows to the post-erasure minimum (raw email replaced by a keyed hash), and adds the email to the do-not-contact suppression list. Idempotent. Returns counts of what was affected; never returns PII.",
        "tags": [
          "Waitlist"
        ],
        "x-mcp-tool": "waitlist_signups_erase",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "description": "Email address to erase (GDPR Art.17) within the current product. Normalized (trimmed + lowercased) server-side. The operation is idempotent.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 254
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deletedSignups",
                    "deletedTokens",
                    "reducedConsents",
                    "suppressed"
                  ],
                  "properties": {
                    "suppressed": {
                      "type": "boolean"
                    },
                    "deletedTokens": {
                      "type": "number"
                    },
                    "deletedSignups": {
                      "type": "number"
                    },
                    "reducedConsents": {
                      "type": "number"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/waitlist/invites/send": {
      "post": {
        "operationId": "waitlist_invites_send",
        "summary": "Send invite emails to waitlist signups.",
        "description": "Send invite emails to waitlist signups. Provide an explicit email list and/or a filter; set force=true to resend when a live invite already exists.",
        "tags": [
          "Waitlist"
        ],
        "x-mcp-tool": "waitlist_invites_send",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "emails": {
                    "description": "Explicit recipient emails (e.g. from waitlist_signups_list). Combined with filter if both given.",
                    "type": "array",
                    "items": {
                      "type": "string",
                      "minLength": 3
                    }
                  },
                  "filter": {
                    "description": "Selection filter over signups; resolved server-side with pagination.",
                    "type": "object",
                    "properties": {
                      "q": {
                        "description": "Prefix match on email (case-insensitive).",
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 254
                      },
                      "status": {
                        "description": "Select signups by status (single value or array).",
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "pending",
                              "invited",
                              "registered"
                            ]
                          },
                          {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "pending",
                                "invited",
                                "registered"
                              ]
                            }
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  },
                  "force": {
                    "description": "Resend even when a live invite token already exists (mints a fresh token).",
                    "type": "boolean",
                    "default": false
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "sent",
                    "skipped",
                    "failed"
                  ],
                  "properties": {
                    "sent": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "email",
                          "emailId"
                        ],
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "emailId": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "failed": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "email",
                          "reason"
                        ],
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string",
                            "enum": [
                              "quota_exceeded",
                              "reputation_throttled",
                              "send_failed"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "skipped": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "email",
                          "reason"
                        ],
                        "properties": {
                          "email": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string",
                            "enum": [
                              "suppressed",
                              "already_invited",
                              "already_registered"
                            ]
                          }
                        },
                        "additionalProperties": false
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/waitlist/signups": {
      "get": {
        "operationId": "waitlist_signups_list",
        "summary": "List waitlist signups for the current product.",
        "description": "List waitlist signups for the current product. Supports status filtering, keyset pagination, and field selection.",
        "tags": [
          "Waitlist"
        ],
        "x-mcp-tool": "waitlist_signups_list",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status. A single value or an array. Omit to return all statuses.",
            "style": "form",
            "explode": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "pending",
                    "invited",
                    "registered"
                  ]
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "invited",
                      "registered"
                    ]
                  }
                }
              ]
            }
          },
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "description": "Fields to include per row. Default [\"status\",\"created_at\"]; id is always included. email and ip_hash are PII and audited when requested.",
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "status",
                  "created_at",
                  "source",
                  "country",
                  "email",
                  "ip_hash"
                ]
              }
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Keyset cursor from a previous response next_cursor. Omit to start from the beginning.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1–200. Default 50.",
            "schema": {
              "type": "integer",
              "default": 50,
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "description": "Sort by created_at. newest = most recent first. Default newest.",
            "schema": {
              "type": "string",
              "enum": [
                "newest",
                "oldest"
              ],
              "default": "newest"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Prefix search on email (case-insensitive). Returns signups whose email starts with this value. Audited as PII access (DP-009).",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 254
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "next_cursor",
                    "has_more"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": {}
                      }
                    },
                    "has_more": {
                      "type": "boolean"
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/waitlist/signups/stats": {
      "get": {
        "operationId": "waitlist_signups_funnel",
        "summary": "Funnel counts (signup, invited, registered) for the current product over a time window, plus non_monotonic.",
        "description": "Funnel counts (signup, invited, registered) for the current product over a time window, plus non_monotonic. Each stage is counted by its own transition timestamp, so a window can be non-monotonic (registered > signup) — transition events within the period, not a fixed cohort.",
        "tags": [
          "Waitlist"
        ],
        "x-mcp-tool": "waitlist_signups_funnel",
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "description": "Time window. \"7d\"/\"30d\"/\"90d\" = trailing N days ending now; \"all\" = all time. Default \"30d\".",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d",
                "all"
              ],
              "default": "30d"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "signup",
                    "invited",
                    "registered",
                    "non_monotonic",
                    "period",
                    "from",
                    "to"
                  ],
                  "properties": {
                    "to": {
                      "type": "string"
                    },
                    "from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "period": {
                      "type": "string"
                    },
                    "signup": {
                      "type": "number"
                    },
                    "invited": {
                      "type": "number"
                    },
                    "registered": {
                      "type": "number"
                    },
                    "non_monotonic": {
                      "type": "boolean"
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed or revoked bearer token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "The request failed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message",
              "step"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable, machine-readable failure code."
              },
              "message": {
                "type": "string",
                "description": "Human-readable message. May be reworded."
              },
              "step": {
                "type": "string",
                "description": "The stage that rejected the request."
              }
            }
          }
        }
      }
    }
  }
}
