{
  "openapi": "3.1.0",
  "info": {
    "title": "MCP Gateway",
    "description": "Enterprise MCP server management platform",
    "version": "0.1.0"
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Health",
        "description": "Health check endpoint for load balancers.",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object",
                  "title": "Response Health Health Get"
                }
              }
            }
          }
        }
      }
    },
    "/ready": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Ready",
        "description": "Readiness check \u2014 verifies database connectivity.\n\nReturns 200 if DB is reachable, 503 if not.\nKubernetes readiness probe interprets non-2xx as not ready.",
        "operationId": "ready_ready_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/dashboard": {
      "get": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get dashboard",
        "description": "Get dashboard data including stats, health, activity, and top servers. Requires admin or owner role.",
        "operationId": "get_dashboard_api_v1_dashboard_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "activity_filter",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "tools",
                "errors",
                "admin"
              ],
              "type": "string",
              "description": "Filter for activity feed: all, tools, errors, or admin",
              "default": "all",
              "title": "Activity Filter"
            },
            "description": "Filter for activity feed: all, tools, errors, or admin"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dashboard/charts": {
      "get": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get dashboard charts",
        "description": "Get chart data for the analytics dashboard including tool call trends, latency percentiles, and server load.",
        "operationId": "get_dashboard_charts_api_v1_dashboard_charts_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardCharts"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dashboard/activity": {
      "get": {
        "tags": [
          "dashboard"
        ],
        "summary": "Get dashboard activity",
        "description": "Get standalone activity feed for filter-only updates without reloading the entire dashboard.",
        "operationId": "get_dashboard_activity_api_v1_dashboard_activity_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "activity_filter",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "tools",
                "errors",
                "admin"
              ],
              "type": "string",
              "description": "Filter: all, tools, errors, or admin",
              "default": "all",
              "title": "Activity Filter"
            },
            "description": "Filter: all, tools, errors, or admin"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/auth": {
      "get": {
        "tags": [
          "auth-settings"
        ],
        "summary": "Get authentication settings",
        "description": "Return global authentication configuration including allowed domains, admin emails, and token expiration settings. Requires admin or owner role.",
        "operationId": "get_auth_settings_api_v1_settings_auth_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "auth-settings"
        ],
        "summary": "Update authentication settings",
        "description": "Partially update global authentication configuration. Only provided fields are changed. Requires admin or owner role.",
        "operationId": "update_auth_settings_api_v1_settings_auth_patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/auth/providers": {
      "get": {
        "tags": [
          "auth-settings"
        ],
        "summary": "List OAuth providers",
        "description": "Return all configured OAuth providers including disabled ones. Requires admin or owner role.",
        "operationId": "list_oauth_providers_api_v1_settings_auth_providers_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthProviderListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "auth-settings"
        ],
        "summary": "Create OAuth provider",
        "description": "Create a new OAuth provider configuration with encrypted client secret. The secret is never returned in API responses. Requires admin or owner role.",
        "operationId": "create_oauth_provider_api_v1_settings_auth_providers_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthProviderCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthProviderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/auth/providers/{provider_type}": {
      "patch": {
        "tags": [
          "auth-settings"
        ],
        "summary": "Update OAuth provider",
        "description": "Partially update an existing OAuth provider. If client_secret is provided it will be re-encrypted. Requires admin or owner role.",
        "operationId": "update_oauth_provider_api_v1_settings_auth_providers__provider_type__patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "provider_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider Type"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthProviderUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthProviderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "auth-settings"
        ],
        "summary": "Delete OAuth provider",
        "description": "Permanently remove an OAuth provider and its encrypted credentials. Requires admin or owner role.",
        "operationId": "delete_oauth_provider_api_v1_settings_auth_providers__provider_type__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "provider_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider Type"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/general": {
      "get": {
        "tags": [
          "general-settings"
        ],
        "summary": "Get general settings",
        "description": "Get general application settings such as log retention period. For AI providers, use /settings/providers.",
        "operationId": "get_general_settings_api_v1_settings_general_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneralSettingsResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "general-settings"
        ],
        "summary": "Update general settings",
        "description": "Update general application settings. Supports partial updates -- only provided fields are updated.",
        "operationId": "update_general_settings_api_v1_settings_general_put",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GeneralSettingsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneralSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/general/reset": {
      "post": {
        "tags": [
          "general-settings"
        ],
        "summary": "Reset all settings",
        "description": "Reset ALL settings to defaults: log retention, AI providers, and registry credentials. This is a destructive operation.",
        "operationId": "reset_general_settings_api_v1_settings_general_reset_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GeneralSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bundles": {
      "get": {
        "tags": [
          "bundles"
        ],
        "summary": "List bundles",
        "description": "List all bundles with pagination and optional search filtering by name.",
        "operationId": "list_bundles_api_v1_bundles_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 255
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPBundleListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "bundles"
        ],
        "summary": "Create bundle",
        "description": "Create a new bundle with optional initial tools. Returns the created bundle including its bundle_key.",
        "operationId": "create_bundle_api_v1_bundles_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPBundleCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPBundleWithKeyResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Duplicate agent_id or other unique constraint violation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bundles/by-agent/{agent_id}": {
      "get": {
        "tags": [
          "bundles"
        ],
        "summary": "Get bundle by agent",
        "description": "Look up a bundle by its associated external agent identifier.",
        "operationId": "get_bundle_by_agent_api_v1_bundles_by_agent__agent_id__get",
        "parameters": [
          {
            "name": "agent_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Agent Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPBundleDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No bundle for this agent",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bundles/{bundle_id}": {
      "get": {
        "tags": [
          "bundles"
        ],
        "summary": "Get bundle",
        "description": "Get a bundle by ID with all its tools and their override configurations.",
        "operationId": "get_bundle_api_v1_bundles__bundle_id__get",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPBundleDetailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "bundles"
        ],
        "summary": "Update bundle",
        "description": "Update a bundle's name and description.",
        "operationId": "update_bundle_api_v1_bundles__bundle_id__put",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPBundleUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPBundleWithKeyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "bundles"
        ],
        "summary": "Delete bundle",
        "description": "Delete a bundle and all its tool associations.",
        "operationId": "delete_bundle_api_v1_bundles__bundle_id__delete",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bundles/{bundle_id}/servers/{server_id}": {
      "post": {
        "tags": [
          "bundles"
        ],
        "summary": "Assign server to bundle",
        "description": "Add all tools from a server to a bundle. Already-present tools are skipped.",
        "operationId": "assign_server_to_bundle_api_v1_bundles__bundle_id__servers__server_id__post",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          },
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerAssignResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Bundle or server not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "bundles"
        ],
        "summary": "Remove server from bundle",
        "description": "Remove all tools belonging to a server from a bundle.",
        "operationId": "remove_server_from_bundle_api_v1_bundles__bundle_id__servers__server_id__delete",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          },
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Bundle not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bundles/{bundle_id}/tools": {
      "post": {
        "tags": [
          "bundles"
        ],
        "summary": "Add tools to bundle",
        "description": "Add one or more tools to a bundle with optional name/description overrides.",
        "operationId": "add_tools_to_bundle_api_v1_bundles__bundle_id__tools_post",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleToolsAddRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/BundleToolResponse"
                  },
                  "title": "Response Add Tools To Bundle Api V1 Bundles  Bundle Id  Tools Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "bundles"
        ],
        "summary": "List bundle tools",
        "description": "List all tools in a bundle with pagination and optional filtering to enabled-only tools.",
        "operationId": "list_bundle_tools_api_v1_bundles__bundle_id__tools_get",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          },
          {
            "name": "enabled_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only return enabled tools",
              "default": true,
              "title": "Enabled Only"
            },
            "description": "Only return enabled tools"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Items per page",
              "default": 50,
              "title": "Page Size"
            },
            "description": "Items per page"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BundleToolsListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bundles/{bundle_id}/tools/{tool_id}": {
      "delete": {
        "tags": [
          "bundles"
        ],
        "summary": "Remove tool from bundle",
        "description": "Remove a tool from a bundle.",
        "operationId": "remove_tool_from_bundle_api_v1_bundles__bundle_id__tools__tool_id__delete",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          },
          {
            "name": "tool_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Tool Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "bundles"
        ],
        "summary": "Update bundle tool",
        "description": "Update a tool's overrides (name, description, enabled state, display order) within a bundle.",
        "operationId": "update_bundle_tool_api_v1_bundles__bundle_id__tools__tool_id__put",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          },
          {
            "name": "tool_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Tool Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleToolUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BundleToolResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/bundles/{bundle_id}/reorder": {
      "post": {
        "tags": [
          "bundles"
        ],
        "summary": "Reorder bundle tools",
        "description": "Reorder tools within a bundle by providing a new display order mapping.",
        "operationId": "reorder_bundle_tools_api_v1_bundles__bundle_id__reorder_post",
        "parameters": [
          {
            "name": "bundle_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Bundle Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleReorderRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/catalog/search": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Search catalog",
        "description": "Search for MCP servers across external registries (MCP Registry, Docker Hub) with unified pagination and filtering.",
        "operationId": "search_catalog_api_v1_catalog_search_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search query",
              "title": "Search"
            },
            "description": "Search query"
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by registry source",
              "title": "Source"
            },
            "description": "Filter by registry source"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by server type",
              "title": "Type"
            },
            "description": "Filter by server type"
          },
          {
            "name": "transport",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "stdio",
                    "streamable-http",
                    "sse"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by transport protocol",
              "title": "Transport"
            },
            "description": "Filter by transport protocol"
          },
          {
            "name": "requires_config",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Only show servers with required config",
              "default": false,
              "title": "Requires Config"
            },
            "description": "Only show servers with required config"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "updated",
                "published",
                "name"
              ],
              "type": "string",
              "description": "Sort order",
              "default": "updated",
              "title": "Sort By"
            },
            "description": "Sort order"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Results per page",
              "default": 20,
              "title": "Limit"
            },
            "description": "Results per page"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination cursor",
              "title": "Cursor"
            },
            "description": "Pagination cursor"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/catalog/{registry}/{registry_id}": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "summary": "Get catalog server detail",
        "description": "Get detailed information about a specific catalog server including metadata and import preview.",
        "operationId": "get_catalog_server_api_v1_catalog__registry___registry_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "registry",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Registry"
            }
          },
          {
            "name": "registry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Registry Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogServerDetails"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/curated-apps": {
      "get": {
        "tags": [
          "curated-apps"
        ],
        "summary": "List Curated Apps",
        "description": "List curated app catalog entries with pagination and filtering.\n\nArgs:\n    session: Database session (injected).\n    service: CuratedAppService instance (injected).\n    page: Page number (1-indexed).\n    page_size: Items per page (1-100, default 20).\n    category: Filter by category name.\n    type: Filter by MCP server type (e.g. \"virtual\", \"remote\").\n    search: Text search in name, display_name, and description.\n\nReturns:\n    Paginated list of curated app list items.",
        "operationId": "list_curated_apps_api_v1_curated_apps_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Type"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CuratedAppListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/curated-apps/categories": {
      "get": {
        "tags": [
          "curated-apps"
        ],
        "summary": "List Categories",
        "description": "Get all categories with entry counts.\n\nArgs:\n    session: Database session (injected).\n    service: CuratedAppService instance (injected).\n\nReturns:\n    List of categories with their entry counts.",
        "operationId": "list_categories_api_v1_curated_apps_categories_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CuratedAppCategoryResponse"
                  },
                  "title": "Response List Categories Api V1 Curated Apps Categories Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/curated-apps/{entry_id}": {
      "get": {
        "tags": [
          "curated-apps"
        ],
        "summary": "Get Curated App",
        "description": "Get full detail for a single curated app catalog entry.\n\nArgs:\n    entry_id: UUID of the catalog entry.\n    session: Database session (injected).\n    service: CuratedAppService instance (injected).\n\nReturns:\n    Full detail including auth, config, tools preview, etc.\n\nRaises:\n    HTTPException: 404 if entry not found.",
        "operationId": "get_curated_app_api_v1_curated_apps__entry_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Entry Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CuratedAppDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "curated-apps"
        ],
        "summary": "Update Curated App",
        "description": "Update a curated app catalog entry (admin action).\n\nAccepts partial updates -- only provided fields are modified.\n\nArgs:\n    entry_id: UUID of the catalog entry.\n    data: Partial update payload.\n    session: Database session (injected).\n    service: CuratedAppService instance (injected).\n\nReturns:\n    Updated catalog entry detail.\n\nRaises:\n    HTTPException: 404 if entry not found.",
        "operationId": "update_curated_app_api_v1_curated_apps__entry_id__put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Entry Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CuratedAppUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CuratedAppDetail"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/curated-apps/{entry_id}/activate": {
      "post": {
        "tags": [
          "curated-apps"
        ],
        "summary": "Activate Curated App",
        "description": "Activate a curated app by creating an MCP server instance (copy-on-activate).\n\nArgs:\n    entry_id: UUID of the catalog entry to activate.\n    session: Database session (injected).\n    service: CuratedAppService instance (injected).\n    connection_name: Optional suffix for the created server name.\n    credential_mode: Override credential mode (managed/user_provided).\n\nReturns:\n    Activation result with server_id, name, and optional OAuth redirect URL.\n\nRaises:\n    HTTPException: 404 if catalog entry not found.",
        "operationId": "activate_curated_app_api_v1_curated_apps__entry_id__activate_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Entry Id"
            }
          },
          {
            "name": "connection_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Connection Name"
            }
          },
          {
            "name": "credential_mode",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Credential Mode"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CuratedAppActivateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/curated-apps/{entry_id}/visibility": {
      "patch": {
        "tags": [
          "curated-apps"
        ],
        "summary": "Update Visibility",
        "description": "Toggle visibility of a curated app catalog entry (admin action).\n\nArgs:\n    entry_id: UUID of the catalog entry.\n    session: Database session (injected).\n    service: CuratedAppService instance (injected).\n    visible: New visibility state.\n\nReturns:\n    Dict with the new visibility value.\n\nRaises:\n    HTTPException: 404 if entry not found.",
        "operationId": "update_visibility_api_v1_curated_apps__entry_id__visibility_patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "entry_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Entry Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_update_visibility_api_v1_curated_apps__entry_id__visibility_patch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  },
                  "title": "Response Update Visibility Api V1 Curated Apps  Entry Id  Visibility Patch"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/gateway": {
      "get": {
        "tags": [
          "gateway-settings"
        ],
        "summary": "Get gateway settings",
        "description": "Get current user's gateway settings. Creates default settings (mode=auto, threshold=20) if none exist.",
        "operationId": "get_gateway_settings_api_v1_settings_gateway_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewaySettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "gateway-settings"
        ],
        "summary": "Update gateway settings",
        "description": "Update current user's gateway settings. Supports partial updates -- only provided fields are updated.",
        "operationId": "update_gateway_settings_api_v1_settings_gateway_put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GatewaySettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GatewaySettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/notifications": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get notification settings",
        "description": "Get the current user's notification preferences. Creates default settings if none exist. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "get_notification_settings_api_v1_settings_notifications_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Update notification settings",
        "description": "Update the current user's notification preferences. Supports partial updates - only provided fields are changed. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "update_notification_settings_api_v1_settings_notifications_put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/onboarding-status": {
      "get": {
        "tags": [
          "onboarding"
        ],
        "summary": "Get onboarding status",
        "description": "Returns whether onboarding is required and the status of each configuration step.",
        "operationId": "get_onboarding_status_api_v1_settings_onboarding_status_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playground/tools": {
      "get": {
        "tags": [
          "Playground"
        ],
        "summary": "List available tools",
        "description": "List available MCP servers and skills for playground session selection. Returns enabled tool counts per server.",
        "operationId": "list_available_tools_api_v1_playground_tools_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaygroundAvailableToolsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playground/sessions": {
      "post": {
        "tags": [
          "Playground"
        ],
        "summary": "Create playground session",
        "description": "Create a new playground chat session with selected servers and skills. Requires an active LLM provider.",
        "operationId": "create_session_api_v1_playground_sessions_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaygroundSessionCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaygroundSessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playground/chat": {
      "post": {
        "tags": [
          "Playground"
        ],
        "summary": "Chat with playground agent",
        "description": "Send a message to the playground agent and stream the response via SSE. Returns tool calls, tokens, and completion events.",
        "operationId": "chat_api_v1_playground_chat_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaygroundChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playground/sessions/{session_id}": {
      "delete": {
        "tags": [
          "Playground"
        ],
        "summary": "Delete playground session",
        "description": "Delete a playground chat session and release its resources.",
        "operationId": "delete_session_api_v1_playground_sessions__session_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playground/sessions/{session_id}/files": {
      "get": {
        "tags": [
          "Playground"
        ],
        "summary": "List session files",
        "description": "List files in the session's virtual filesystem. Returns file metadata for the specified directory path.",
        "operationId": "list_session_files_api_v1_playground_sessions__session_id__files_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "/outputs",
              "title": "Path"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionFilesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/playground/sessions/{session_id}/files/{file_path}": {
      "get": {
        "tags": [
          "Playground"
        ],
        "summary": "Download session file",
        "description": "Download a file from the session's virtual filesystem. Returns the file content with the appropriate MIME type.",
        "operationId": "download_session_file_api_v1_playground_sessions__session_id__files__file_path__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Session Id"
            }
          },
          {
            "name": "file_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Path to the file (without leading /)",
              "title": "File Path"
            },
            "description": "Path to the file (without leading /)"
          },
          {
            "name": "disposition",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "'attachment' or 'inline'",
              "default": "attachment",
              "title": "Disposition"
            },
            "description": "'attachment' or 'inline'"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "File content",
            "content": {
              "application/json": {
                "schema": {}
              },
              "application/octet-stream": {},
              "image/png": {},
              "image/jpeg": {},
              "application/pdf": {},
              "text/plain": {}
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/prompts": {
      "get": {
        "tags": [
          "prompt-management"
        ],
        "summary": "List all prompts",
        "description": "Returns all registered prompts with their override status.",
        "operationId": "list_prompts_api_v1_settings_prompts_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/prompts/{slug}": {
      "get": {
        "tags": [
          "prompt-management"
        ],
        "summary": "Get prompt detail",
        "description": "Returns base and custom content for a single prompt.",
        "operationId": "get_prompt_detail_api_v1_settings_prompts__slug__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "prompt-management"
        ],
        "summary": "Save prompt override",
        "description": "Save a custom override for a prompt.",
        "operationId": "save_override_api_v1_settings_prompts__slug__put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "prompt-management"
        ],
        "summary": "Toggle prompt active state",
        "description": "Enable or disable a prompt override.",
        "operationId": "toggle_active_api_v1_settings_prompts__slug__patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PromptToggleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PromptDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "prompt-management"
        ],
        "summary": "Delete prompt override",
        "description": "Revert a prompt to its default content.",
        "operationId": "delete_override_api_v1_settings_prompts__slug__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Slug"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/providers": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "List configured providers",
        "description": "List all configured providers grouped by type (LLM and embedding).",
        "operationId": "list_providers_api_v1_settings_providers_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfiguredProvidersListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "providers"
        ],
        "summary": "Create provider",
        "description": "Add a new provider configuration. Validates provider type and checks for duplicates. Auto-activates if first of its type.",
        "operationId": "create_provider_api_v1_settings_providers_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfiguredProviderCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfiguredProviderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/providers/active": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "Get active providers",
        "description": "Get the currently active LLM and embedding providers. Returns the active provider for each type, or None if none is active.",
        "operationId": "get_active_providers_api_v1_settings_providers_active_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveProvidersResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/providers/configs": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "Get available provider configs",
        "description": "Get available provider configurations for LLM and embedding including supported models and configuration requirements.",
        "operationId": "get_available_provider_configs_api_v1_settings_providers_configs_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableProvidersResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/providers/test-connection": {
      "post": {
        "tags": [
          "providers"
        ],
        "summary": "Test provider connection without saving",
        "description": "Test a provider connection without saving the configuration. Makes a real API call to verify accessibility and credentials.",
        "operationId": "test_connection_without_save_api_v1_settings_providers_test_connection_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestConnectionWithoutSaveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestProviderConnectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/providers/{provider_id}": {
      "get": {
        "tags": [
          "providers"
        ],
        "summary": "Get provider",
        "description": "Get a single provider configuration by its UUID.",
        "operationId": "get_provider_api_v1_settings_providers__provider_id__get",
        "parameters": [
          {
            "name": "provider_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Provider Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfiguredProviderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "providers"
        ],
        "summary": "Update provider",
        "description": "Update a provider configuration. Supports partial updates -- only provided fields are modified.",
        "operationId": "update_provider_api_v1_settings_providers__provider_id__put",
        "parameters": [
          {
            "name": "provider_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Provider Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfiguredProviderUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfiguredProviderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "providers"
        ],
        "summary": "Delete provider",
        "description": "Remove a provider configuration. Cannot delete a provider that is currently active.",
        "operationId": "delete_provider_api_v1_settings_providers__provider_id__delete",
        "parameters": [
          {
            "name": "provider_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Provider Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/providers/{provider_id}/activate": {
      "post": {
        "tags": [
          "providers"
        ],
        "summary": "Activate provider",
        "description": "Set a provider as active for its type. Deactivates any other provider of the same type.",
        "operationId": "activate_provider_api_v1_settings_providers__provider_id__activate_post",
        "parameters": [
          {
            "name": "provider_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Provider Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConfiguredProviderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/providers/{provider_id}/test": {
      "post": {
        "tags": [
          "providers"
        ],
        "summary": "Test provider connection",
        "description": "Test connection to a configured provider by making a simple API call to verify accessibility and credentials.",
        "operationId": "test_provider_connection_api_v1_settings_providers__provider_id__test_post",
        "parameters": [
          {
            "name": "provider_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Provider Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestProviderConnectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/registry-credentials": {
      "get": {
        "tags": [
          "registry-credentials"
        ],
        "summary": "List registry credentials",
        "description": "List all registry credentials with masked credential values. Corrupted credentials are marked accordingly.",
        "operationId": "list_credentials_api_v1_settings_registry_credentials_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryCredentialListResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "registry-credentials"
        ],
        "summary": "Create or update registry credential",
        "description": "Create or update a registry credential. Only one credential per registry type is allowed; existing credentials are updated.",
        "operationId": "create_credential_api_v1_settings_registry_credentials_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegistryCredentialCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryCredentialResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/registry-credentials/{registry_type}": {
      "delete": {
        "tags": [
          "registry-credentials"
        ],
        "summary": "Delete registry credential",
        "description": "Delete a registry credential by registry type.",
        "operationId": "delete_credential_api_v1_settings_registry_credentials__registry_type__delete",
        "parameters": [
          {
            "name": "registry_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Registry Type"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/registry-credentials/{registry_type}/test": {
      "post": {
        "tags": [
          "registry-credentials"
        ],
        "summary": "Test registry credential",
        "description": "Test a registry credential by attempting to authenticate with the registry. Returns success status, message, and latency.",
        "operationId": "test_credential_api_v1_settings_registry_credentials__registry_type__test_post",
        "parameters": [
          {
            "name": "registry_type",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Registry Type"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryCredentialTestResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills/generate": {
      "post": {
        "tags": [
          "AI Generation"
        ],
        "summary": "Generate skill via AI",
        "description": "Generate an Agent Skill using AI with SSE streaming. Returns progress, thinking, token, and completion events.",
        "operationId": "generate_skill_api_v1_skills_generate_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateSkillRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/generate": {
      "post": {
        "tags": [
          "AI Generation",
          "MCP Server Generation"
        ],
        "summary": "Create generation job",
        "description": "Start a new MCP server generation job. Creates a job and immediately triggers the analysis pipeline in the background.",
        "operationId": "create_generation_job_api_v1_servers_generate_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GenerateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationJobCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "AI Generation",
          "MCP Server Generation"
        ],
        "summary": "List generation jobs",
        "description": "List all generation jobs with pagination and optional status filtering.",
        "operationId": "list_generation_jobs_api_v1_servers_generate_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/GenerationJobStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationJobListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/generate/{job_id}": {
      "get": {
        "tags": [
          "AI Generation",
          "MCP Server Generation"
        ],
        "summary": "Get generation job status",
        "description": "Get generation job status by ID, including progress, reasoning log, and deployed server info.",
        "operationId": "get_generation_job_api_v1_servers_generate__job_id__get",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenerationStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "AI Generation",
          "MCP Server Generation"
        ],
        "summary": "Delete generation job",
        "description": "Delete a generation job and its associated data.",
        "operationId": "delete_generation_job_api_v1_servers_generate__job_id__delete",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/generate/{job_id}/analysis": {
      "get": {
        "tags": [
          "AI Generation",
          "MCP Server Generation"
        ],
        "summary": "Get generation analysis",
        "description": "Get the API analysis result for a generation job. Returns planned tools for review before approval.",
        "operationId": "get_generation_analysis_api_v1_servers_generate__job_id__analysis_get",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalysisResultResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/generate/{job_id}/approve": {
      "post": {
        "tags": [
          "AI Generation",
          "MCP Server Generation"
        ],
        "summary": "Approve generation job",
        "description": "Approve a generation job and trigger code generation. Accepts optional tool selection and feedback for regeneration.",
        "operationId": "approve_generation_job_api_v1_servers_generate__job_id__approve_post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApproveResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/generate/{job_id}/cancel": {
      "post": {
        "tags": [
          "AI Generation",
          "MCP Server Generation"
        ],
        "summary": "Cancel a generation job",
        "description": "Cancel a running generation job.\n\nCan only cancel jobs in PENDING, ANALYZING, or GENERATING status.\n\nArgs:\n    job_id: The generation job UUID.\n    session: Database session.\n    repo: Generation job repository.\n\nReturns:\n    CancelJobResponse with updated status.\n\nRaises:\n    HTTPException: 404 if not found, 409 if not cancellable.",
        "operationId": "cancel_generation_job_api_v1_servers_generate__job_id__cancel_post",
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelJobResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/analyze-requirements": {
      "post": {
        "tags": [
          "Credential Requirements",
          "Credential Requirements"
        ],
        "summary": "Analyze credential requirements",
        "description": "Analyze a new input (npm package, PyPI package, URL, Docker image) to discover credential requirements using AI. Returns SSE stream with progress events.",
        "operationId": "analyze_requirements_api_v1_servers_analyze_requirements_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnalyzeRequirementsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/analyze-requirements": {
      "post": {
        "tags": [
          "Credential Requirements",
          "Credential Requirements"
        ],
        "summary": "Analyze server requirements",
        "description": "Analyze an existing server's configuration to discover credential requirements using AI. Returns SSE stream with progress events.",
        "operationId": "analyze_server_requirements_api_v1_servers__server_id__analyze_requirements_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/requirements": {
      "put": {
        "tags": [
          "Credential Requirements",
          "Credential Requirements"
        ],
        "summary": "Save credential requirements",
        "description": "Save configured credential requirements for a server. Allows admin to customize AI-discovered requirements and set credential modes.",
        "operationId": "save_requirements_api_v1_servers__server_id__requirements_put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveRequirementsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequirementAnalysisResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/accept-suggestions": {
      "post": {
        "tags": [
          "Credential Requirements",
          "Credential Requirements"
        ],
        "summary": "Accept AI suggestions",
        "description": "Accept all AI-suggested credential requirements for a server without modification.",
        "operationId": "accept_suggestions_api_v1_servers__server_id__accept_suggestions_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequirementAnalysisResult"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/connection-form": {
      "get": {
        "tags": [
          "Credential Requirements",
          "Credential Requirements"
        ],
        "summary": "Get connection form",
        "description": "Get the user connection form fields for a server. Returns credential fields users need to fill in to connect.",
        "operationId": "get_connection_form_api_v1_servers__server_id__connection_form_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionFormResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/connect": {
      "post": {
        "tags": [
          "Credential Requirements",
          "Credential Requirements"
        ],
        "summary": "Connect to server",
        "description": "Submit user credentials to connect to a server. Stores credentials encrypted and associated with the user's account.",
        "operationId": "connect_to_server_api_v1_servers__server_id__connect_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCredentialsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserCredentialsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Create an MCP server",
        "description": "Create a new MCP server configuration. For non-generated servers (Remote, NPX, UVX, Container), automatically spawns a background task to discover tools after creation.",
        "operationId": "create_server_api_v1_servers_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPServerCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "Server name already exists",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "List MCP servers",
        "description": "List all MCP servers with pagination, filtering, search, and sorting. Supports filtering by status, type, source, and credential mode.",
        "operationId": "list_servers_api_v1_servers_get",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number (1-indexed)",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number (1-indexed)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Items per page",
              "default": 20,
              "title": "Page Size"
            },
            "description": "Items per page"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Text search on display_name and name",
              "title": "Search"
            },
            "description": "Text search on display_name and name"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated status filter (running, stopped, pending, error)",
              "title": "Status"
            },
            "description": "Comma-separated status filter (running, stopped, pending, error)"
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Comma-separated type filter (remote, npx, uvx, container)",
              "title": "Type"
            },
            "description": "Comma-separated type filter (remote, npx, uvx, container)"
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ServerSource"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Source filter (manual, catalog, generated)",
              "title": "Source"
            },
            "description": "Source filter (manual, catalog, generated)"
          },
          {
            "name": "credential_mode",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/CredentialMode"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Credential mode filter (none, managed, user_provided)",
              "title": "Credential Mode"
            },
            "description": "Credential mode filter (none, managed, user_provided)"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort field (name, status, type, tool_count, updated_at, created_at)",
              "default": "updated_at",
              "title": "Sort By"
            },
            "description": "Sort field (name, status, type, tool_count, updated_at, created_at)"
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort order (asc or desc)",
              "default": "desc",
              "title": "Sort Order"
            },
            "description": "Sort order (asc or desc)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/catalog-imports": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Import server from catalog",
        "description": "Import an MCP server from the registry catalog. Validates the package exists for NPX/UVX servers, creates the server, and triggers background tool discovery.",
        "operationId": "import_from_catalog_api_v1_servers_catalog_imports_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CatalogImportRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}": {
      "get": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Get an MCP server",
        "description": "Get an MCP server by ID. Returns server details with enriched error classification if the server has an error status.",
        "operationId": "get_server_api_v1_servers__server_id__get",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Server not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Update an MCP server",
        "description": "Update an MCP server's configuration by ID. Validates name uniqueness if changed.",
        "operationId": "update_server_api_v1_servers__server_id__put",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MCPServerUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPServerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Delete an MCP server",
        "description": "Delete an MCP server by ID. For generated servers, also cleans up in-memory deployment and temporary files.",
        "operationId": "delete_server_api_v1_servers__server_id__delete",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Server not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/sync": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Sync server tools",
        "description": "Sync tools from an MCP server. Fetches current tools for remote servers, re-discovers tools for NPX/UVX/Container servers, and returns a diff of changes.",
        "operationId": "sync_server_tools_api_v1_servers__server_id__sync_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "generate_embeddings",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Generate embeddings for tools (requires an active embedding provider)",
              "default": true,
              "title": "Generate Embeddings"
            },
            "description": "Generate embeddings for tools (requires an active embedding provider)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolSyncResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/tools": {
      "get": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "List server tools",
        "description": "List all tools discovered for an MCP server.",
        "operationId": "list_server_tools_api_v1_servers__server_id__tools_get",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MCPToolListItem"
                  },
                  "title": "Response List Server Tools Api V1 Servers  Server Id  Tools Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "local-tools"
        ],
        "summary": "Create a tool on a LOCAL server",
        "description": "Create a tool on a LOCAL server with embedding and poisoning scan.",
        "operationId": "create_local_tool_api_v1_servers__server_id__tools_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalToolCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPToolListItem"
                }
              }
            }
          },
          "400": {
            "description": "Server is not LOCAL type"
          },
          "404": {
            "description": "Server not found"
          },
          "409": {
            "description": "Tool name already exists on this server"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/tools/{tool_id}/overrides": {
      "patch": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Update tool overrides",
        "description": "Update override fields on a tool.\n\nUses model_fields_set to distinguish omitted fields from explicit nulls.\nSetting a field to null clears that override.",
        "operationId": "update_tool_overrides_api_v1_servers__server_id__tools__tool_id__overrides_patch",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "tool_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Tool Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolOverrideUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolOverrideResponse"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          }
        }
      },
      "delete": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Reset tool to original definitions",
        "description": "Clear all overrides, restoring tool to its original definitions.",
        "operationId": "reset_tool_overrides_api_v1_servers__server_id__tools__tool_id__overrides_delete",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "tool_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Tool Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/tools/{tool_id}/correct-schema": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "AI-assisted schema correction",
        "description": "Use AI to validate and correct a tool's JSON Schema.\n\nAccepts an optional request body with user-provided schema and prompt.\nWhen no body is sent, falls back to the tool's effective schema from the DB.\n\nReturns corrected schema with explanation of changes.\nReturns 503 if no LLM provider is configured.",
        "operationId": "correct_tool_schema_api_v1_servers__server_id__tools__tool_id__correct_schema_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "tool_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Tool Id"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/SchemaCorrectionRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchemaCorrection"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "description": "Service Unavailable"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/start": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Start an MCP server",
        "description": "Start an MCP server by verifying connectivity. For generated servers, reloads the server into memory from disk. Updates status to RUNNING on success or ERROR on failure.",
        "operationId": "start_server_api_v1_servers__server_id__start_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthCheckResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Server not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Failed to connect to MCP server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/stop": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Stop an MCP server",
        "description": "Stop an MCP server by setting its status to STOPPED. For generated servers, unloads the server from memory. For remote servers, this is a logical stop only.",
        "operationId": "stop_server_api_v1_servers__server_id__stop_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthCheckResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/health": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Check server health",
        "description": "Check health of an MCP server by attempting to connect and list its tools. Updates status to RUNNING if successful, ERROR if failed.",
        "operationId": "check_server_health_api_v1_servers__server_id__health_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthCheckResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/health/all": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Check all servers health",
        "description": "Check health of all MCP servers and update their statuses. Returns aggregated results with counts by status.",
        "operationId": "check_all_servers_health_api_v1_servers_health_all_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkHealthCheckResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/tool-selection": {
      "get": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Get tool selection",
        "description": "Get tool selection status for a server, showing which tools are enabled or disabled.",
        "operationId": "get_tool_selection_api_v1_servers__server_id__tool_selection_get",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolSelectionListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Update tool selection",
        "description": "Update tool selection for a server by enabling or disabling specific tools.",
        "operationId": "update_tool_selection_api_v1_servers__server_id__tool_selection_patch",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolSelectionUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolSelectionUpdateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/credentials": {
      "get": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "List server credentials",
        "description": "List all credentials for an MCP server. Returns credentials with masked values; actual credential values are never returned via the API.",
        "operationId": "list_server_credentials_api_v1_servers__server_id__credentials_get",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Create a server credential",
        "description": "Create a new credential for an MCP server. The credential value is encrypted at rest using AES-256-GCM. The API response contains only a masked version of the value.",
        "operationId": "create_server_credential_api_v1_servers__server_id__credentials_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CredentialCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/credentials/{credential_id}": {
      "delete": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Delete a server credential",
        "description": "Delete a credential from an MCP server. Verifies the credential belongs to the specified server.",
        "operationId": "delete_server_credential_api_v1_servers__server_id__credentials__credential_id__delete",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "credential_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Credential Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/connection-options": {
      "get": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Get server connection options",
        "description": "Get connection options for an MCP server, including available OAuth apps, allowed credential types, and existing user connections.",
        "operationId": "get_server_connection_options_api_v1_servers__server_id__connection_options_get",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "User ID to get existing connections for (optional)",
              "title": "User Id"
            },
            "description": "User ID to get existing connections for (optional)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerConnectionOptions"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/oauth-config": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Configure server OAuth",
        "description": "Configure OAuth for an MCP server, enabling per-user OAuth authentication. The client_secret is encrypted at rest using AES-256-GCM.",
        "operationId": "configure_server_oauth_api_v1_servers__server_id__oauth_config_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ServerOAuthConfigCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerOAuthConfigResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Get server OAuth config",
        "description": "Get OAuth configuration for an MCP server. Returns the configuration with the client_secret masked; the actual secret is never returned.",
        "operationId": "get_server_oauth_config_api_v1_servers__server_id__oauth_config_get",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerOAuthConfigResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Delete server OAuth config",
        "description": "Remove OAuth configuration from an MCP server. Resets credential_mode to NONE but does not delete existing user connections.",
        "operationId": "delete_server_oauth_config_api_v1_servers__server_id__oauth_config_delete",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/bulk-action": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Perform bulk action on servers",
        "description": "Execute an action (start, stop, delete, sync) on multiple servers simultaneously. Returns individual results for each server.",
        "operationId": "bulk_server_action_api_v1_servers_bulk_action_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkActionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkActionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Invalid action or server IDs",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/tools/{tool_id}": {
      "patch": {
        "tags": [
          "local-tools"
        ],
        "summary": "Update a tool on a LOCAL server",
        "description": "Partial update a tool on a LOCAL server.",
        "operationId": "update_local_tool_api_v1_servers__server_id__tools__tool_id__patch",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "tool_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Tool Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LocalToolUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MCPToolListItem"
                }
              }
            }
          },
          "400": {
            "description": "Server is not LOCAL type"
          },
          "404": {
            "description": "Server or tool not found"
          },
          "409": {
            "description": "Tool name already exists on this server"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "local-tools"
        ],
        "summary": "Delete a tool from a LOCAL server",
        "description": "Delete a tool from a LOCAL server.",
        "operationId": "delete_local_tool_api_v1_servers__server_id__tools__tool_id__delete",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "tool_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Tool Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "400": {
            "description": "Server is not LOCAL type"
          },
          "404": {
            "description": "Server or tool not found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/skills/{skill_id}/attach": {
      "post": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Attach a skill to a server",
        "description": "Link a skill to an MCP server and register any script tools defined in the skill's workflow.json. Returns the list of tools that were registered.",
        "operationId": "attach_skill_to_server_api_v1_servers__server_id__skills__skill_id__attach_post",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachSkillResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/skills/{skill_id}/detach": {
      "delete": {
        "tags": [
          "MCP Servers"
        ],
        "summary": "Detach a skill from a server",
        "description": "Unlink a skill from an MCP server and remove all script tools that were registered from this skill.",
        "operationId": "detach_skill_from_server_api_v1_servers__server_id__skills__skill_id__detach_delete",
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/by-name": {
      "get": {
        "tags": [
          "Tools"
        ],
        "summary": "Lookup tool by name",
        "description": "Direct lookup of a tool by server name and tool name. No embeddings or search \u2014 for when the caller already knows which tool it wants.",
        "operationId": "tools_by_name_api_v1_tools_by_name_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Server Name"
            }
          },
          {
            "name": "tool_name",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Tool Name"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolLookupResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Server or tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/search": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Search tools",
        "description": "Search for tools using semantic similarity via embeddings. Supports scoping by server IDs.",
        "operationId": "tools_search_api_v1_tools_search_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolsSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolsSearchResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "Embedding service unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tools/execute": {
      "post": {
        "tags": [
          "Tools"
        ],
        "summary": "Execute tool",
        "description": "Execute a tool on an MCP server by server ID or server name (mutually exclusive) and tool name. Returns the execution result and duration.",
        "operationId": "tools_execute_api_v1_tools_execute_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolsExecuteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolsExecuteResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not authenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Server or tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "502": {
            "description": "Failed to connect to MCP server",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sdk/tools/execute": {
      "post": {
        "tags": [
          "SDK Proxy"
        ],
        "summary": "Sdk Execute Tool",
        "description": "Execute a tool via the SDK.\n\nValidates that the requested tool is in the scoped token's\n``allowed_tools`` list (stored in ``api_key.scopes``), resolves the\nprefixed name to a server + tool, and delegates to the shared\n``execute_tool`` function.",
        "operationId": "sdk_execute_tool_api_v1_sdk_tools_execute_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SDKExecuteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SDKExecuteResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sdk/tools/search": {
      "post": {
        "tags": [
          "SDK Proxy"
        ],
        "summary": "Sdk Search Tools",
        "description": "Search tools via the SDK.\n\nDelegates to the shared ``search_tools`` function. If the token has\nscoped ``allowed_tools``, results are post-filtered to only include\nthose tools.",
        "operationId": "sdk_search_tools_api_v1_sdk_tools_search_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SDKSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SDKSearchResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sdk/cache/{key}": {
      "get": {
        "tags": [
          "SDK Proxy"
        ],
        "summary": "Sdk Cache Get",
        "description": "Read from cache.\n\nKeys are auto-namespaced by ``user_id`` and ``skill_id`` (extracted\nfrom the API key description) to prevent cross-tenant leakage.",
        "operationId": "sdk_cache_get_api_v1_sdk_cache__key__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Sdk Cache Get Api V1 Sdk Cache  Key  Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "SDK Proxy"
        ],
        "summary": "Sdk Cache Set",
        "description": "Write to cache.\n\nKeys are auto-namespaced by ``user_id`` and ``skill_id`` to prevent\ncross-tenant leakage.",
        "operationId": "sdk_cache_set_api_v1_sdk_cache__key__put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SDKCacheSetRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "List sessions",
        "description": "List MCP connection sessions with optional filtering by server or bundle ID. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "list_sessions_api_v1_sessions_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by server ID",
              "title": "Server Id"
            },
            "description": "Filter by server ID"
          },
          {
            "name": "bundle_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by bundle ID",
              "title": "Bundle Id"
            },
            "description": "Filter by bundle ID"
          },
          {
            "name": "include_inactive",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include expired/deleted sessions",
              "default": false,
              "title": "Include Inactive"
            },
            "description": "Include expired/deleted sessions"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "sessions"
        ],
        "summary": "Create session",
        "description": "Create a new MCP connection session for a server or bundle. Requires either server_id or bundle_id (not both). This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "create_session_api_v1_sessions_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/stats": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get session statistics",
        "description": "Get session statistics including active, expired, and idle session counts. Requires admin role. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "get_session_stats_api_v1_sessions_stats_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionStatsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{session_id}": {
      "get": {
        "tags": [
          "sessions"
        ],
        "summary": "Get session",
        "description": "Get a session by ID. Sessions are scoped to users and cannot be accessed by other users. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "get_session_api_v1_sessions__session_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Session Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "sessions"
        ],
        "summary": "Update session",
        "description": "Update session properties such as allowed tool names for tool scoping.",
        "operationId": "update_session_api_v1_sessions__session_id__patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Session Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "sessions"
        ],
        "summary": "Delete session",
        "description": "Delete a session (soft delete by default). Use hard_delete=true for permanent removal. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "delete_session_api_v1_sessions__session_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Session Id"
            }
          },
          {
            "name": "hard_delete",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Permanently delete (not recommended)",
              "default": false,
              "title": "Hard Delete"
            },
            "description": "Permanently delete (not recommended)"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/{session_id}/touch": {
      "post": {
        "tags": [
          "sessions"
        ],
        "summary": "Touch session",
        "description": "Update last accessed timestamp and extend the session's expiration time (sliding window TTL). This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "touch_session_api_v1_sessions__session_id__touch_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Session Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sessions/cleanup": {
      "post": {
        "tags": [
          "sessions"
        ],
        "summary": "Clean up expired sessions",
        "description": "Soft delete all expired sessions. Requires admin role. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "cleanup_expired_sessions_api_v1_sessions_cleanup_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "integer"
                  },
                  "title": "Response Cleanup Expired Sessions Api V1 Sessions Cleanup Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/providers": {
      "get": {
        "tags": [
          "authentication"
        ],
        "summary": "List authentication providers",
        "description": "Return configured OAuth providers available for login. Uses database configuration with fallback to environment variables.",
        "operationId": "list_providers_api_v1_auth_providers_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AuthProviderInfo"
                  },
                  "type": "array",
                  "title": "Response List Providers Api V1 Auth Providers Get"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/login/{provider}": {
      "get": {
        "tags": [
          "authentication"
        ],
        "summary": "Initiate OAuth login",
        "description": "Start the OAuth authorization flow by redirecting the user to the provider's authorization page. Supports optional invitation token for signup.",
        "operationId": "initiate_login_api_v1_auth_login__provider__get",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          },
          {
            "name": "redirect",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "URL to redirect to after login",
              "default": "/",
              "title": "Redirect"
            },
            "description": "URL to redirect to after login"
          },
          {
            "name": "invitation_token",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Invitation token for new user signup via invitation",
              "title": "Invitation Token"
            },
            "description": "Invitation token for new user signup via invitation"
          },
          {
            "name": "setup_flow",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Whether this is a setup verification flow",
              "default": false,
              "title": "Setup Flow"
            },
            "description": "Whether this is a setup verification flow"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/callback/{provider}": {
      "get": {
        "tags": [
          "authentication"
        ],
        "summary": "Handle OAuth callback",
        "description": "Exchange the authorization code for tokens, find or create the user, and set authentication cookies. Handles both normal and invitation-based signup.",
        "operationId": "oauth_callback_api_v1_auth_callback__provider__get",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Provider"
            }
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Authorization code from OAuth provider",
              "title": "Code"
            },
            "description": "Authorization code from OAuth provider"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "CSRF state token",
              "title": "State"
            },
            "description": "CSRF state token"
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "OAuth error code from provider",
              "title": "Error"
            },
            "description": "OAuth error code from provider"
          },
          {
            "name": "error_description",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "OAuth error description",
              "title": "Error Description"
            },
            "description": "OAuth error description"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "tags": [
          "authentication"
        ],
        "summary": "Log out current user",
        "description": "Clear authentication cookies to end the current session.",
        "operationId": "logout_api_v1_auth_logout_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object",
                  "title": "Response Logout Api V1 Auth Logout Post"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "tags": [
          "authentication"
        ],
        "summary": "Get current user",
        "description": "Return the profile of the currently authenticated user, including role, email, and provider information.",
        "operationId": "get_current_user_api_v1_auth_me_get",
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInfo"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "tags": [
          "authentication"
        ],
        "summary": "Refresh access token",
        "description": "Issue a new access token using a valid refresh token cookie. Returns the new token and updates the access_token cookie.",
        "operationId": "refresh_access_token_api_v1_auth_refresh_post",
        "parameters": [
          {
            "name": "refresh_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Refresh Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/enabled": {
      "get": {
        "tags": [
          "authentication"
        ],
        "summary": "Check authentication status",
        "description": "Return whether OAuth providers are configured and available. Used by the frontend to determine whether to show login buttons.",
        "operationId": "is_auth_enabled_api_v1_auth_enabled_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Is Auth Enabled Api V1 Auth Enabled Get"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth-templates": {
      "get": {
        "tags": [
          "OAuth App Templates"
        ],
        "summary": "List OAuth app templates",
        "description": "Return all available OAuth app templates for supported providers (GitHub, Google, Slack, etc.). Templates are read-only provider configurations.",
        "operationId": "list_oauth_templates_api_v1_oauth_templates_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAppTemplateListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth-templates/{template_type}": {
      "get": {
        "tags": [
          "OAuth App Templates"
        ],
        "summary": "Get OAuth app template by type",
        "description": "Retrieve a single OAuth app template by provider type (e.g., github, google, microsoft365).",
        "operationId": "get_oauth_template_by_type_api_v1_oauth_templates__template_type__get",
        "parameters": [
          {
            "name": "template_type",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/OAuthAppType"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAppTemplateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth-apps/by-auth-server": {
      "get": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Find OAuth app by authorization server",
        "description": "Look up an existing OAuth app by its authorization server URL. Used during OAuth discovery to check if an app already exists for a given provider.",
        "operationId": "find_oauth_app_by_auth_server_api_v1_oauth_apps_by_auth_server_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "authorization_server_url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Authorization server URL to search for",
              "title": "Authorization Server Url"
            },
            "description": "Authorization server URL to search for"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/OAuthAppResponse"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Find Oauth App By Auth Server Api V1 Oauth Apps By Auth Server Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth-apps": {
      "get": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "List OAuth apps",
        "description": "List all admin-configured OAuth apps with masked credentials. By default only enabled apps are returned.",
        "operationId": "list_oauth_apps_api_v1_oauth_apps_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "include_disabled",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include disabled OAuth apps",
              "default": false,
              "title": "Include Disabled"
            },
            "description": "Include disabled OAuth apps"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAppListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Create OAuth app",
        "description": "Create a new OAuth app from a template with encrypted client credentials. The app inherits default configuration from the template but can override settings.",
        "operationId": "create_oauth_app_api_v1_oauth_apps_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthAppCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAppResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth-apps/{app_id}": {
      "get": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Get OAuth app",
        "description": "Retrieve a single OAuth app by ID with masked credentials.",
        "operationId": "get_oauth_app_api_v1_oauth_apps__app_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "App Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAppResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Update OAuth app",
        "description": "Partially update an OAuth app. Only provided fields are changed. If client_secret is provided, it will be re-encrypted.",
        "operationId": "update_oauth_app_api_v1_oauth_apps__app_id__patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "App Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthAppUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthAppResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Delete OAuth app",
        "description": "Permanently delete an OAuth app and all its server links via cascade. Existing user connections using this app will become invalid.",
        "operationId": "delete_oauth_app_api_v1_oauth_apps__app_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "App Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth-apps/{app_id}/servers/{server_id}": {
      "post": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Attach OAuth app to server",
        "description": "Link an OAuth app to an MCP server so the server can use it for per-user authentication. An app can be attached to multiple servers.",
        "operationId": "attach_oauth_app_to_server_api_v1_oauth_apps__app_id__servers__server_id__post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "App Id"
            }
          },
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachServerResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Detach OAuth app from server",
        "description": "Remove the link between an OAuth app and an MCP server. Existing user connections are not affected, but new connections cannot be created.",
        "operationId": "detach_oauth_app_from_server_api_v1_oauth_apps__app_id__servers__server_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "App Id"
            }
          },
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth-apps/discover": {
      "post": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Discover OAuth configuration",
        "description": "Check .well-known/oauth-protected-resource and .well-known/oauth-authorization-server endpoints per RFC 8414. No auth required \u2014 used during server creation wizard.",
        "operationId": "discover_server_oauth_api_v1_oauth_apps_discover_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthDiscoveryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthDiscoveryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth-apps/test": {
      "post": {
        "tags": [
          "OAuth Apps"
        ],
        "summary": "Test MCP server connection",
        "description": "Send JSON-RPC initialize and tools/list requests to verify server is responding. No auth required \u2014 used during server creation wizard.",
        "operationId": "test_server_connection_api_v1_oauth_apps_test_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TestConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/mcpgateway__schemas__test_connection__TestConnectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/logs": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Query tool call logs",
        "description": "Query tool call audit logs with optional filtering by server, user, tool name, status, and full-text search.",
        "operationId": "get_logs_api_v1_observability_logs_get",
        "parameters": [
          {
            "name": "server_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Server Id"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User Id"
            }
          },
          {
            "name": "tool_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tool Name"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "source_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by source: server, sandbox",
              "title": "Source Type"
            },
            "description": "Filter by source: server, sandbox"
          },
          {
            "name": "sandbox_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Sandbox Id"
            }
          },
          {
            "name": "from_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From Time"
            }
          },
          {
            "name": "to_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To Time"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Full-text search query",
              "title": "Search"
            },
            "description": "Full-text search query"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolCallLogListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/logs/cursor": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Query logs with cursor pagination",
        "description": "Query tool call logs with cursor-based pagination. More stable than offset pagination for large or frequently updated datasets.",
        "operationId": "get_logs_with_cursor_api_v1_observability_logs_cursor_get",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Pagination cursor from previous response",
              "title": "Cursor"
            },
            "description": "Pagination cursor from previous response"
          },
          {
            "name": "server_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Server Id"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status",
              "title": "Status"
            },
            "description": "Filter by status"
          },
          {
            "name": "source_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by source: server, sandbox",
              "title": "Source Type"
            },
            "description": "Filter by source: server, sandbox"
          },
          {
            "name": "from_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From Time"
            }
          },
          {
            "name": "to_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To Time"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Full-text search query",
              "title": "Search"
            },
            "description": "Full-text search query"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Items per page",
              "default": 25,
              "title": "Limit"
            },
            "description": "Items per page"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPaginatedLogsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/logs/export": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Export logs",
        "description": "Export tool call logs as a JSON or CSV file download. Supports filtering by server and time range.",
        "operationId": "export_logs_api_v1_observability_logs_export_get",
        "parameters": [
          {
            "name": "server_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Server Id"
            }
          },
          {
            "name": "source_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by source: server, sandbox",
              "title": "Source Type"
            },
            "description": "Filter by source: server, sandbox"
          },
          {
            "name": "from_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From Time"
            }
          },
          {
            "name": "to_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To Time"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(json|csv)$",
              "default": "json",
              "title": "Format"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/metrics/summary": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Get metrics summary",
        "description": "Get dashboard summary metrics including server counts, tool call statistics, and latency metrics.",
        "operationId": "get_metrics_summary_api_v1_observability_metrics_summary_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetricsSummary"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/metrics/percentiles": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Get latency percentiles",
        "description": "Get p50, p90, p95, p99 latency percentiles over time with configurable buckets and server filtering.",
        "operationId": "get_latency_percentiles_api_v1_observability_metrics_percentiles_get",
        "parameters": [
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 168,
              "minimum": 1,
              "description": "Hours to look back",
              "default": 24,
              "title": "Hours"
            },
            "description": "Hours to look back"
          },
          {
            "name": "interval_minutes",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1440,
              "minimum": 5,
              "description": "Bucket size in minutes",
              "default": 60,
              "title": "Interval Minutes"
            },
            "description": "Bucket size in minutes"
          },
          {
            "name": "server_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by server",
              "title": "Server Id"
            },
            "description": "Filter by server"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LatencyPercentilesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/metrics/token-usage": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Get token usage summary",
        "description": "Get aggregated token usage summary with input, output, and total counts. Supports filtering by server, user, and time range.",
        "operationId": "get_token_usage_api_v1_observability_metrics_token_usage_get",
        "parameters": [
          {
            "name": "server_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Server Id"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User Id"
            }
          },
          {
            "name": "from_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From Time"
            }
          },
          {
            "name": "to_time",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To Time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenUsageSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/export-config": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Get audit export config",
        "description": "Get the current audit export configuration. Returns the enabled export configuration if found, None otherwise.",
        "operationId": "get_export_config_api_v1_observability_export_config_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/AuditExportConfigResponse"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "title": "Response Get Export Config Api V1 Observability Export Config Get"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "observability"
        ],
        "summary": "Create audit export config",
        "description": "Create a new audit export configuration with destination (S3, Azure Blob, GCS) and schedule settings.",
        "operationId": "create_export_config_api_v1_observability_export_config_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditExportConfigCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditExportConfigResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/export-config/{config_id}": {
      "put": {
        "tags": [
          "observability"
        ],
        "summary": "Update audit export config",
        "description": "Update an existing audit export configuration. Supports updating schedule, enabled state, and connection parameters.",
        "operationId": "update_export_config_api_v1_observability_export_config__config_id__put",
        "parameters": [
          {
            "name": "config_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Config Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuditExportConfigUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditExportConfigResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/export-now": {
      "post": {
        "tags": [
          "observability"
        ],
        "summary": "Trigger audit export",
        "description": "Trigger an immediate audit export using the current export configuration. Not yet implemented.",
        "operationId": "trigger_export_api_v1_observability_export_now_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/logs/stats": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Get log table statistics",
        "description": "Get current log table statistics including record counts for tool call logs and token usage logs.",
        "operationId": "get_log_stats_api_v1_observability_logs_stats_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogStatsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/logs/cleanup/preview": {
      "get": {
        "tags": [
          "observability"
        ],
        "summary": "Preview log cleanup",
        "description": "Preview how many logs would be deleted by a cleanup without actually deleting them.",
        "operationId": "preview_log_cleanup_api_v1_observability_logs_cleanup_preview_get",
        "parameters": [
          {
            "name": "retention_days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 3650,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Override retention days (uses settings if not provided)",
              "title": "Retention Days"
            },
            "description": "Override retention days (uses settings if not provided)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogCleanupPreviewResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/observability/logs/cleanup": {
      "post": {
        "tags": [
          "observability"
        ],
        "summary": "Run log cleanup",
        "description": "Delete logs older than the retention period. Returns count of deleted records per log table.",
        "operationId": "run_log_cleanup_api_v1_observability_logs_cleanup_post",
        "parameters": [
          {
            "name": "retention_days",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer",
                  "maximum": 3650,
                  "minimum": 1
                },
                {
                  "type": "null"
                }
              ],
              "description": "Override retention days (uses settings if not provided)",
              "title": "Retention Days"
            },
            "description": "Override retention days (uses settings if not provided)"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogCleanupResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/observability/providers": {
      "get": {
        "tags": [
          "observability-settings"
        ],
        "summary": "List observability providers",
        "description": "Returns provider definitions for UI form rendering.",
        "operationId": "get_providers_api_v1_settings_observability_providers_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response Get Providers Api V1 Settings Observability Providers Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/observability": {
      "get": {
        "tags": [
          "observability-settings"
        ],
        "summary": "Get observability settings",
        "description": "Returns current observability config with secrets masked.",
        "operationId": "get_observability_settings_api_v1_settings_observability_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObservabilitySettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "observability-settings"
        ],
        "summary": "Update observability settings",
        "description": "Update settings. Secrets are encrypted at rest. Triggers hot reload.",
        "operationId": "update_observability_settings_api_v1_settings_observability_put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ObservabilitySettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObservabilitySettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/observability/reset": {
      "post": {
        "tags": [
          "observability-settings"
        ],
        "summary": "Reset observability settings",
        "description": "Reset all observability settings to defaults.",
        "operationId": "reset_observability_settings_api_v1_settings_observability_reset_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObservabilitySettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/observability/test": {
      "post": {
        "tags": [
          "observability-settings"
        ],
        "summary": "Test connection",
        "description": "Send a test span to verify provider connectivity.",
        "operationId": "test_connection_api_v1_settings_observability_test_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/mcpgateway__api__v1__observability_settings__TestConnectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/observability/aws-collector-config": {
      "post": {
        "tags": [
          "observability-settings"
        ],
        "summary": "Generate AWS Collector config",
        "description": "Generate OTEL Collector YAML config for AWS CloudWatch.",
        "operationId": "get_aws_collector_config_api_v1_settings_observability_aws_collector_config_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  },
                  "title": "Response Get Aws Collector Config Api V1 Settings Observability Aws Collector Config Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/servers/{server_id}/oauth/authorize": {
      "post": {
        "tags": [
          "Server OAuth"
        ],
        "summary": "Initiate server OAuth flow",
        "description": "Start the OAuth authorization flow to connect the current user's external account to an MCP server. Uses PKCE and database-stored state for security.",
        "operationId": "initiate_server_oauth_api_v1_servers__server_id__oauth_authorize_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiateServerOAuthRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InitiateServerOAuthResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth/callback/{oauth_app_alias}": {
      "get": {
        "tags": [
          "Server OAuth"
        ],
        "summary": "Handle server OAuth callback",
        "description": "Process the OAuth provider redirect after user authorization. Exchanges the code for tokens, encrypts them, and stores a user connection.",
        "operationId": "server_oauth_callback_api_v1_oauth_callback__oauth_app_alias__get",
        "parameters": [
          {
            "name": "oauth_app_alias",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Oauth App Alias"
            }
          },
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Authorization code",
              "title": "Code"
            },
            "description": "Authorization code"
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "CSRF state token",
              "title": "State"
            },
            "description": "CSRF state token"
          },
          {
            "name": "error",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "OAuth error",
              "title": "Error"
            },
            "description": "OAuth error"
          },
          {
            "name": "error_description",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "OAuth error description",
              "title": "Error Description"
            },
            "description": "OAuth error description"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/oauth/oauth-states/cleanup": {
      "delete": {
        "tags": [
          "Server OAuth"
        ],
        "summary": "Cleanup expired OAuth states",
        "description": "Admin endpoint to clean up expired OAuth states. Typically called by a scheduled job. Requires admin privileges.",
        "operationId": "cleanup_oauth_states_endpoint_api_v1_oauth_oauth_states_cleanup_delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "retention_hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 24,
              "minimum": 1,
              "default": 1,
              "title": "Retention Hours"
            }
          },
          {
            "name": "run_in_background",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Run cleanup in background (faster response) or synchronously",
              "default": true,
              "title": "Run In Background"
            },
            "description": "Run cleanup in background (faster response) or synchronously"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "title": "Response Cleanup Oauth States Endpoint Api V1 Oauth Oauth States Cleanup Delete"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/setup/status": {
      "get": {
        "tags": [
          "setup"
        ],
        "summary": "Get setup status",
        "description": "Check if initial setup is required. Unauthenticated endpoint. Setup is required when no users exist and setup not completed.",
        "operationId": "get_setup_status_api_v1_setup_status_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/setup/provider": {
      "post": {
        "tags": [
          "setup"
        ],
        "summary": "Create or update setup OAuth provider",
        "description": "Create or update an OAuth provider during initial setup. Only available when no users exist and setup has not been completed, or via recovery token.",
        "operationId": "create_setup_provider_api_v1_setup_provider_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OAuthProviderCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthProviderResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills": {
      "get": {
        "tags": [
          "Skills"
        ],
        "summary": "List skills",
        "description": "List all skills with optional filtering by name, description, source type, or linked MCP server.",
        "operationId": "list_skills_api_v1_skills_get",
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of items to skip",
              "default": 0,
              "title": "Offset"
            },
            "description": "Number of items to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Maximum items to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Maximum items to return"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by name or description",
              "title": "Search"
            },
            "description": "Search by name or description"
          },
          {
            "name": "source_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SkillSourceType"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by source type",
              "title": "Source Type"
            },
            "description": "Filter by source type"
          },
          {
            "name": "mcp_server_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by linked MCP server",
              "title": "Mcp Server Id"
            },
            "description": "Filter by linked MCP server"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Skills"
        ],
        "summary": "Create skill",
        "description": "Create a new skill from generated content. Validates against agentskills.io spec and creates a ZIP package.",
        "operationId": "create_skill_api_v1_skills_post",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills/templates": {
      "get": {
        "tags": [
          "Skills"
        ],
        "summary": "List skill templates",
        "description": "Returns predefined skill templates that users can use as starting points for creating new skills.",
        "operationId": "list_skill_templates_api_v1_skills_templates_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillTemplateListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills/{skill_id}": {
      "get": {
        "tags": [
          "Skills"
        ],
        "summary": "Get skill",
        "description": "Get detailed information about a specific skill including SKILL.md content.",
        "operationId": "get_skill_api_v1_skills__skill_id__get",
        "parameters": [
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Skills"
        ],
        "summary": "Update skill",
        "description": "Update an existing skill. Supports partial updates and rebuilds the ZIP package if SKILL.md content changes.",
        "operationId": "update_skill_api_v1_skills__skill_id__patch",
        "parameters": [
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Skills"
        ],
        "summary": "Delete skill",
        "description": "Delete a skill and its associated package content.",
        "operationId": "delete_skill_api_v1_skills__skill_id__delete",
        "parameters": [
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills/upload": {
      "post": {
        "tags": [
          "Skills"
        ],
        "summary": "Upload skill",
        "description": "Upload a skill from a .zip, .skill, or .md file. Parses SKILL.md frontmatter and creates a ZIP package.",
        "operationId": "upload_skill_api_v1_skills_upload_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_skill_api_v1_skills_upload_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills/{skill_id}/package": {
      "get": {
        "tags": [
          "Skills"
        ],
        "summary": "Download skill package",
        "description": "Download the .skill ZIP package for a skill as a file attachment.",
        "operationId": "download_skill_package_api_v1_skills__skill_id__package_get",
        "parameters": [
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills/catalog/{source}": {
      "get": {
        "tags": [
          "Skills"
        ],
        "summary": "List catalog skills",
        "description": "List skills available in an external catalog (e.g., Anthropic's repo, skills.sh, or a GitHub URL).",
        "operationId": "list_catalog_skills_api_v1_skills_catalog__source__get",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Source"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by name or description",
              "title": "Search"
            },
            "description": "Search by name or description"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillCatalogListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills/catalog/{source}/{skill_name}": {
      "get": {
        "tags": [
          "Skills"
        ],
        "summary": "Get catalog skill detail",
        "description": "Get details of a specific skill from an external catalog including metadata and file listing.",
        "operationId": "get_catalog_skill_api_v1_skills_catalog__source___skill_name__get",
        "parameters": [
          {
            "name": "source",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Source"
            }
          },
          {
            "name": "skill_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Skill Name"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillCatalogEntryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/skills/import": {
      "post": {
        "tags": [
          "Skills"
        ],
        "summary": "Import skill from catalog",
        "description": "Import a skill from an external catalog into the local database. Fetches the package and stores it locally.",
        "operationId": "import_skill_from_catalog_api_v1_skills_import_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SkillImportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SkillResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/starter-kit": {
      "get": {
        "tags": [
          "starter-kit"
        ],
        "summary": "Get Starter Kit Config",
        "description": "Get starter kit config with enriched catalog metadata.",
        "operationId": "get_starter_kit_config_api_v1_starter_kit_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StarterKitConfigResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/starter-kit/setup": {
      "post": {
        "tags": [
          "starter-kit"
        ],
        "summary": "Setup Starter Kit",
        "description": "Activate selected servers via SSE stream.",
        "operationId": "setup_starter_kit_api_v1_starter_kit_setup_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StarterKitSetupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Create Sandbox",
        "description": "Create a new persistent sandbox.\n\nWhen ``session_key`` is set, reuses an existing sandbox for the same\n(user, session_key, image) triple instead of creating a new one.\n\nResource limits (memory_mb, cpu_cores, disk_mb) default to the image's\nconfigured defaults if not explicitly provided. This ensures warm pool\ncompatibility when callers don't specify custom resource limits.",
        "operationId": "create_sandbox_api_v1_sandboxes_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "List Sandboxes",
        "description": "List sandboxes for the authenticated user.",
        "operationId": "list_sandboxes_api_v1_sandboxes_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 20,
              "title": "Page Size"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "name": "image",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Image"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "created_at",
              "title": "Sort By"
            }
          },
          {
            "name": "sort_order",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "desc",
              "title": "Sort Order"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes/{sandbox_id}": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Get Sandbox",
        "description": "Get sandbox details (includes installed skills).",
        "operationId": "get_sandbox_api_v1_sandboxes__sandbox_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Update Sandbox",
        "description": "Update sandbox configuration (state-aware).\n\nFields that require a stopped sandbox (env_vars, network_enabled,\nmemory_mb, cpu_cores) return 409 if the sandbox is running.\ndisk_mb is never updatable.",
        "operationId": "update_sandbox_api_v1_sandboxes__sandbox_id__patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Destroy Sandbox",
        "description": "Destroy a sandbox permanently.",
        "operationId": "destroy_sandbox_api_v1_sandboxes__sandbox_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes/{sandbox_id}/exec": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Exec Command",
        "description": "Execute a command in a running sandbox.",
        "operationId": "exec_command_api_v1_sandboxes__sandbox_id__exec_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxExecRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxExecResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes/{sandbox_id}/stop": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Stop Sandbox",
        "description": "Stop a running sandbox (preserves volume).",
        "operationId": "stop_sandbox_api_v1_sandboxes__sandbox_id__stop_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes/{sandbox_id}/resume": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Resume Sandbox",
        "description": "Resume a stopped sandbox.",
        "operationId": "resume_sandbox_api_v1_sandboxes__sandbox_id__resume_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes/{sandbox_id}/activity": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Get Sandbox Activity",
        "description": "Get recent activity events for a sandbox.\n\nReturns the most recent usage events (exec, upload, download, start, stop)\nscoped to the authenticated user's sandbox.",
        "operationId": "get_sandbox_activity_api_v1_sandboxes__sandbox_id__activity_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Sandbox Activity Api V1 Sandboxes  Sandbox Id  Activity Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes/{sandbox_id}/files": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "List Sandbox Files",
        "description": "List files in a sandbox directory.",
        "operationId": "list_sandbox_files_api_v1_sandboxes__sandbox_id__files_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "/workspace",
              "title": "Path"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "title": "Response List Sandbox Files Api V1 Sandboxes  Sandbox Id  Files Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes/{sandbox_id}/files/{file_path}": {
      "get": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Download Sandbox File",
        "description": "Download a file from a sandbox.",
        "operationId": "download_sandbox_file_api_v1_sandboxes__sandbox_id__files__file_path__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "file_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Path"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Upload Sandbox File",
        "description": "Upload a file to a sandbox.",
        "operationId": "upload_sandbox_file_api_v1_sandboxes__sandbox_id__files__file_path__put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "file_path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "File Path"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandboxes/{sandbox_id}/skills": {
      "post": {
        "tags": [
          "Sandboxes"
        ],
        "summary": "Install skills on a sandbox",
        "description": "Install skills on a running sandbox by UUID. Idempotent \u2014 skills already installed are reported separately.",
        "operationId": "install_skills_on_sandbox_api_v1_sandboxes__sandbox_id__skills_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxInstallSkillsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxInstallSkillsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandbox-images/templates": {
      "get": {
        "tags": [
          "Sandbox Images"
        ],
        "summary": "Get Image Templates",
        "description": "Return pre-built image templates available for import.",
        "operationId": "get_image_templates_api_v1_sandbox_images_templates_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Get Image Templates Api V1 Sandbox Images Templates Get"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandbox-images/packages": {
      "get": {
        "tags": [
          "Sandbox Images"
        ],
        "summary": "Get Package Catalog",
        "description": "Return the curated package catalog for image creation UI.",
        "operationId": "get_package_catalog_api_v1_sandbox_images_packages_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Get Package Catalog Api V1 Sandbox Images Packages Get"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/sandbox-images": {
      "get": {
        "tags": [
          "Sandbox Images"
        ],
        "summary": "List Active Images",
        "description": "List available sandbox images (active + ready only).",
        "operationId": "list_active_images_api_v1_sandbox_images_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/SandboxImagePublicResponse"
                  },
                  "type": "array",
                  "title": "Response List Active Images Api V1 Sandbox Images Get"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/sandbox": {
      "get": {
        "tags": [
          "Sandbox Settings"
        ],
        "summary": "Get Sandbox Settings",
        "description": "Return the current sandbox configuration.\n\nReads from DB first (admin-editable values), falls back to env vars\nfor fields not yet set in DB. Also includes image state from DB.",
        "operationId": "get_sandbox_settings_api_v1_settings_sandbox_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Sandbox Settings"
        ],
        "summary": "Update Sandbox Settings",
        "description": "Update sandbox settings.\n\nOnly updates fields provided in the request body.\nRefreshes the in-memory provider snapshot so changes take effect\nimmediately without restart.\n\nReturns the full updated configuration.",
        "operationId": "update_sandbox_settings_api_v1_settings_sandbox_patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/sandbox/pool-summary": {
      "get": {
        "tags": [
          "Sandbox Settings"
        ],
        "summary": "Get Pool Summary",
        "description": "Return an aggregate warm pool summary across all images.\n\nWhen ``warm_pool_enabled`` is *false*, numeric pool fields are\nzeroed out and ``per_image`` is empty -- but ``total_images``\nstill reflects the count of active+ready images.",
        "operationId": "get_pool_summary_api_v1_settings_sandbox_pool_summary_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoolSummaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes": {
      "get": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "List All Sandboxes",
        "description": "List all sandboxes across all users (admin only).",
        "operationId": "list_all_sandboxes_api_v1_admin_sandboxes_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Page size",
              "default": 50,
              "title": "Page Size"
            },
            "description": "Page size"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status",
              "title": "Status"
            },
            "description": "Filter by status"
          },
          {
            "name": "exclude_status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Exclude sandboxes with this status",
              "title": "Exclude Status"
            },
            "description": "Exclude sandboxes with this status"
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by owner user ID",
              "title": "User Id"
            },
            "description": "Filter by owner user ID"
          },
          {
            "name": "image",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by image (partial match)",
              "title": "Image"
            },
            "description": "Filter by image (partial match)"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxAdminListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/stats": {
      "get": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Get Sandbox Stats",
        "description": "Get aggregate sandbox counts and resource totals.",
        "operationId": "get_sandbox_stats_api_v1_admin_sandboxes_stats_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxStatsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/bulk-stop": {
      "post": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Bulk Stop Sandboxes",
        "description": "Bulk stop running sandboxes.",
        "operationId": "bulk_stop_sandboxes_api_v1_admin_sandboxes_bulk_stop_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkSandboxRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkSandboxResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/bulk-destroy": {
      "post": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Bulk Destroy Sandboxes",
        "description": "Bulk destroy sandboxes (destroys containers + hard-deletes DB rows).",
        "operationId": "bulk_destroy_sandboxes_api_v1_admin_sandboxes_bulk_destroy_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkSandboxRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkSandboxResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/{sandbox_id}/metrics": {
      "get": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Get Sandbox Metrics",
        "description": "Get real-time resource usage for a sandbox.",
        "operationId": "get_sandbox_metrics_api_v1_admin_sandboxes__sandbox_id__metrics_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "sandbox_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Sandbox Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxMetricsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/usage": {
      "get": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Query Usage",
        "description": "Query usage events with filters (admin only).",
        "operationId": "query_usage_api_v1_admin_sandboxes_usage_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1,
              "title": "Page"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 50,
              "title": "Page Size"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User Id"
            }
          },
          {
            "name": "sandbox_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Sandbox Id"
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Event Type"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Until"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageQueryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/usage/summary": {
      "get": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Get Usage Summary",
        "description": "Get aggregated per-user usage summary for billing.",
        "operationId": "get_usage_summary_api_v1_admin_sandboxes_usage_summary_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Until"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageSummaryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/usage/export": {
      "get": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Export Usage Csv",
        "description": "Stream usage events as CSV (admin only).\n\nReturns Content-Type: text/csv with columns:\ntimestamp, user_id, sandbox_id, event_type, quantity, metadata_json",
        "operationId": "export_usage_csv_api_v1_admin_sandboxes_usage_export_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User Id"
            }
          },
          {
            "name": "event_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Event Type"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Since"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Until"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/quotas": {
      "get": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "List Quotas",
        "description": "List all custom per-user quotas with active sandbox counts.",
        "operationId": "list_quotas_api_v1_admin_sandboxes_quotas_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Page size",
              "default": 50,
              "title": "Page Size"
            },
            "description": "Page size"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandboxes/quotas/{user_id}": {
      "get": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Get User Quota",
        "description": "Get per-user quota (returns defaults if no custom quota).",
        "operationId": "get_user_quota_api_v1_admin_sandboxes_quotas__user_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Admin Sandboxes"
        ],
        "summary": "Set User Quota",
        "description": "Set per-user quota (upsert).",
        "operationId": "set_user_quota_api_v1_admin_sandboxes_quotas__user_id__put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotaUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuotaResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandbox-images": {
      "post": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Create Image",
        "description": "Create a new sandbox image and schedule build.",
        "operationId": "create_image_api_v1_admin_sandbox_images_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxImageCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxImageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "List Images",
        "description": "List all sandbox images (including inactive).",
        "operationId": "list_images_api_v1_admin_sandbox_images_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxImageListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandbox-images/{image_id}": {
      "get": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Get Image",
        "description": "Get sandbox image detail including build_log and active instance count.",
        "operationId": "get_image_api_v1_admin_sandbox_images__image_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxImageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Update Image",
        "description": "Update sandbox image metadata.",
        "operationId": "update_image_api_v1_admin_sandbox_images__image_id__patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SandboxImageUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxImageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Delete Image",
        "description": "Hard delete a sandbox image.\n\nPass ?force=true to destroy referencing sandboxes first.",
        "operationId": "delete_image_api_v1_admin_sandbox_images__image_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "force",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Force"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandbox-images/{image_id}/rebuild": {
      "post": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Rebuild Image",
        "description": "Re-trigger image build.",
        "operationId": "rebuild_image_api_v1_admin_sandbox_images__image_id__rebuild_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxImageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandbox-images/{image_id}/activate": {
      "patch": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Activate Image",
        "description": "Activate an image (make available to users).",
        "operationId": "activate_image_api_v1_admin_sandbox_images__image_id__activate_patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxImageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandbox-images/{image_id}/deactivate": {
      "patch": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Deactivate Image",
        "description": "Deactivate an image (hide from users).",
        "operationId": "deactivate_image_api_v1_admin_sandbox_images__image_id__deactivate_patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxImageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandbox-images/{image_id}/set-default": {
      "patch": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Set Default Image",
        "description": "Set an image as the organization default.",
        "operationId": "set_default_image_api_v1_admin_sandbox_images__image_id__set_default_patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SandboxImageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/sandbox-images/{image_id}/pool": {
      "get": {
        "tags": [
          "Admin Sandbox Images"
        ],
        "summary": "Get Pool Status",
        "description": "Get warm pool status for an image.",
        "operationId": "get_pool_status_api_v1_admin_sandbox_images__image_id__pool_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "image_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Image Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PoolStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/registry": {
      "get": {
        "tags": [
          "Admin Registry"
        ],
        "summary": "Get Registry",
        "description": "Get the configured container registry.",
        "operationId": "get_registry_api_v1_admin_registry_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Admin Registry"
        ],
        "summary": "Put Registry",
        "description": "Create or update the container registry (upsert).",
        "operationId": "put_registry_api_v1_admin_registry_put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegistryCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegistryResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Admin Registry"
        ],
        "summary": "Delete Registry",
        "description": "Delete the container registry.",
        "operationId": "delete_registry_api_v1_admin_registry_delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/me/api-keys": {
      "post": {
        "tags": [
          "User API Keys"
        ],
        "summary": "Create an API key",
        "description": "Create a new API key for the authenticated user. The full key is returned only in this response and cannot be retrieved again. Users are limited to 10 active keys.",
        "operationId": "create_api_key_api_v1_users_me_api_keys_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiKeyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "User API Keys"
        ],
        "summary": "List API keys",
        "description": "List API keys for the authenticated user. By default only active keys are returned; set include_revoked=true to include revoked keys.",
        "operationId": "list_api_keys_api_v1_users_me_api_keys_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "include_revoked",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include revoked keys in the list",
              "default": false,
              "title": "Include Revoked"
            },
            "description": "Include revoked keys in the list"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/me/api-keys/{key_id}": {
      "get": {
        "tags": [
          "User API Keys"
        ],
        "summary": "Get an API key",
        "description": "Return metadata for a specific API key owned by the authenticated user. The actual key value is never returned after creation.",
        "operationId": "get_api_key_api_v1_users_me_api_keys__key_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Key Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "User API Keys"
        ],
        "summary": "Revoke an API key",
        "description": "Immediately and irreversibly revoke an API key owned by the authenticated user. An optional revocation reason can be provided for audit logging.",
        "operationId": "revoke_api_key_api_v1_users_me_api_keys__key_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Key Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/UserApiKeyRevokeRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Data"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/me/api-keys/{key_id}/rotate": {
      "post": {
        "tags": [
          "User API Keys"
        ],
        "summary": "Rotate an API key",
        "description": "Rotate an API key by creating a new replacement key. The old key can optionally remain active for a grace period to allow smooth transition. The new key is returned only in this response.",
        "operationId": "rotate_api_key_api_v1_users_me_api_keys__key_id__rotate_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Key Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiKeyRotateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyRotateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/me": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get current user profile",
        "description": "Return the authenticated user's profile including counts of active API keys and service connections.",
        "operationId": "get_current_user_api_v1_users_me_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserMeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Users"
        ],
        "summary": "Update current user profile",
        "description": "Update the authenticated user's name or avatar. Role and active-status changes require admin privileges.",
        "operationId": "update_current_user_api_v1_users_me_patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/stats": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get user statistics",
        "description": "Return aggregate user statistics for the admin dashboard including counts by role and pending invitations. Requires ADMIN or OWNER role.",
        "operationId": "get_user_stats_api_v1_users_stats_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserStatsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List users",
        "description": "List users with filtering, sorting, and pagination. Supports search by name/email, role filter, and status filter. Requires ADMIN or OWNER role.",
        "operationId": "list_users_api_v1_users_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by name or email",
              "title": "Search"
            },
            "description": "Search by name or email"
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by roles (comma-separated: owner,admin,member)",
              "title": "Role"
            },
            "description": "Filter by roles (comma-separated: owner,admin,member)"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "active",
                "deactivated",
                "all"
              ],
              "type": "string",
              "description": "Filter by status",
              "default": "active",
              "title": "Status"
            },
            "description": "Filter by status"
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "description": "Sort by: created_at, email, name, last_login_at, role",
              "default": "created_at",
              "title": "Sort By"
            },
            "description": "Sort by: created_at, email, name, last_login_at, role"
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "description": "Sort order",
              "default": "desc",
              "title": "Order"
            },
            "description": "Sort order"
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number (1-indexed)",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number (1-indexed)"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Items per page",
              "default": 20,
              "title": "Page Size"
            },
            "description": "Items per page"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAdminListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create a user",
        "description": "Create a new user programmatically without OAuth/SSO. Optionally provision an API key in the same request. Role hierarchy is enforced. Requires ADMIN or OWNER role.",
        "operationId": "create_user_api_v1_users_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCreateAdmin"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserCreateAdminResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{user_id}/api-keys": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Create API key for user",
        "description": "Create an API key for a specific user. The full key is returned only once at creation time. Role hierarchy is enforced. Requires ADMIN or OWNER role.",
        "operationId": "create_api_key_for_user_api_v1_users__user_id__api_keys_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiKeyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{user_id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get user by ID",
        "description": "Return a specific user with permission hints indicating what actions the current admin can perform on this user. Requires ADMIN or OWNER role.",
        "operationId": "get_user_api_v1_users__user_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAdminResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Users"
        ],
        "summary": "Update a user",
        "description": "Update a user's profile, role, or active status. Role changes are validated against the role hierarchy and invalidate the user's sessions. Requires ADMIN or OWNER role.",
        "operationId": "update_user_api_v1_users__user_id__patch",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Users"
        ],
        "summary": "Delete a user",
        "description": "Permanently delete a user account and all associated data. Requires email confirmation for safety. Cannot delete yourself or users above your role level. Requires ADMIN or OWNER role.",
        "operationId": "delete_user_api_v1_users__user_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserDeleteConfirm"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{user_id}/deactivate": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Deactivate a user",
        "description": "Deactivate a user account, cascading to all API keys and sessions. Cannot deactivate yourself or users above your role level. Requires ADMIN or OWNER role.",
        "operationId": "deactivate_user_api_v1_users__user_id__deactivate_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeactivateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/users/{user_id}/reactivate": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Reactivate a user",
        "description": "Reactivate a previously deactivated user account. API keys are not restored; the user must create new ones. Requires ADMIN or OWNER role.",
        "operationId": "reactivate_user_api_v1_users__user_id__reactivate_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/connections": {
      "post": {
        "tags": [
          "User Connections"
        ],
        "summary": "Create a user connection",
        "description": "Create an API-key connection to an MCP server for the authenticated user. Connections are scoped to the current API key owner. The credential is encrypted at rest and never exposed in responses.",
        "operationId": "create_user_connection_api_v1_connections_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUserConnectionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateUserConnectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "User Connections"
        ],
        "summary": "List user connections",
        "description": "List OAuth and API-key connections for the authenticated user. Connections are scoped to the current API key owner. Use include_server=true for Gate22-style connected-accounts view.",
        "operationId": "list_connections_api_v1_connections_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "include_revoked",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include revoked connections",
              "default": false,
              "title": "Include Revoked"
            },
            "description": "Include revoked connections"
          },
          {
            "name": "include_server",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Include server info in response (Gate22-style connected accounts)",
              "default": false,
              "title": "Include Server"
            },
            "description": "Include server info in response (Gate22-style connected accounts)"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/ConnectionListResponse"
                    },
                    {
                      "$ref": "#/components/schemas/ConnectedAccountListResponse"
                    }
                  ],
                  "title": "Response List Connections Api V1 Connections Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/connections/health": {
      "get": {
        "tags": [
          "User Connections"
        ],
        "summary": "Get connection health summary",
        "description": "Return an aggregated health summary of all connections for the authenticated user. Connections are scoped to the current API key owner. Useful for dashboards and alerting.",
        "operationId": "get_connection_health_api_v1_connections_health_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionHealthSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/connections/expiring": {
      "get": {
        "tags": [
          "User Connections"
        ],
        "summary": "Get expiring connections",
        "description": "Return connections expiring within the specified time window, sorted by urgency. Connections are scoped to the authenticated user. Includes auto-refresh status to indicate whether user action is required.",
        "operationId": "get_expiring_connections_api_v1_connections_expiring_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 168,
              "minimum": 1,
              "description": "Get credentials expiring within this many hours (1-168)",
              "default": 24,
              "title": "Hours"
            },
            "description": "Get credentials expiring within this many hours (1-168)"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExpiringConnectionsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/connections/health/detailed": {
      "get": {
        "tags": [
          "User Connections"
        ],
        "summary": "Get detailed connection health",
        "description": "Return a detailed health summary with granular expiration tracking for the authenticated user. Connections are scoped to the current API key owner. Includes per-status counts and individual connection details.",
        "operationId": "get_detailed_health_api_v1_connections_health_detailed_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DetailedHealthResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/connections/{connection_id}": {
      "get": {
        "tags": [
          "User Connections"
        ],
        "summary": "Get a connection",
        "description": "Return a specific connection by ID. Connections are scoped to the authenticated user; accessing another user's connection returns 404.",
        "operationId": "get_connection_api_v1_connections__connection_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Connection Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "User Connections"
        ],
        "summary": "Revoke a connection",
        "description": "Revoke (soft-delete) a connection for the authenticated user. Connections are scoped to the current API key owner. The user must re-authenticate to restore access.",
        "operationId": "revoke_connection_api_v1_connections__connection_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Connection Id"
            }
          },
          {
            "name": "reason",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional revocation reason",
              "title": "Reason"
            },
            "description": "Optional revocation reason"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/connections/{connection_id}/refresh": {
      "post": {
        "tags": [
          "User Connections"
        ],
        "summary": "Force-refresh a connection token",
        "description": "Trigger an immediate OAuth token refresh for a connection owned by the authenticated user. Connections are scoped to the current API key owner. Requires a valid refresh token.",
        "operationId": "force_refresh_token_api_v1_connections__connection_id__refresh_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "connection_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Connection Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/settings/preferences": {
      "get": {
        "tags": [
          "Settings"
        ],
        "summary": "Get user preferences",
        "description": "Get current user's UI preferences. Creates defaults if none exist. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "get_user_preferences_api_v1_settings_preferences_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserPreferencesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Settings"
        ],
        "summary": "Update user preferences",
        "description": "Update current user's UI preferences. Supports partial updates. This is an API-only endpoint for programmatic access \u2014 no frontend UI currently consumes it.",
        "operationId": "update_user_preferences_api_v1_settings_preferences_put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserPreferencesUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserPreferencesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Create invitation",
        "description": "Create a new user invitation. Requires ADMIN or OWNER role. The invite URL is returned once and should be sent to the invitee.",
        "operationId": "create_invitation_api_v1_invitations_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationCreated"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Invitations"
        ],
        "summary": "List invitations",
        "description": "List all invitations with optional status filtering and pagination. Requires ADMIN or OWNER role.",
        "operationId": "list_invitations_api_v1_invitations_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/InvitationStatus"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by status (pending, accepted, revoked)",
              "title": "Status"
            },
            "description": "Filter by status (pending, accepted, revoked)"
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of records to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of records to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Maximum records to return",
              "default": 20,
              "title": "Limit"
            },
            "description": "Maximum records to return"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/{invitation_id}": {
      "get": {
        "tags": [
          "Invitations"
        ],
        "summary": "Get invitation",
        "description": "Get a specific invitation by ID. Requires ADMIN or OWNER role.",
        "operationId": "get_invitation_api_v1_invitations__invitation_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "invitation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Invitation Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Invitations"
        ],
        "summary": "Revoke invitation",
        "description": "Revoke a pending invitation. Only pending invitations can be revoked. Requires ADMIN or OWNER role.",
        "operationId": "revoke_invitation_api_v1_invitations__invitation_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "invitation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Invitation Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/{invitation_id}/resend": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Resend invitation",
        "description": "Resend an invitation with a new token and extended expiration. Only pending invitations can be resent. Requires ADMIN or OWNER role.",
        "operationId": "resend_invitation_api_v1_invitations__invitation_id__resend_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "invitation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Invitation Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationCreated"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/invitations/accept/{token}": {
      "get": {
        "tags": [
          "Invitations"
        ],
        "summary": "Get invitation accept info",
        "description": "Get public invitation info for the accept page. No authentication required. Returns invitation details and available OAuth providers.",
        "operationId": "get_invitation_accept_info_api_v1_invitations_accept__token__get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationAcceptInfo"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/settings": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "Get portal settings",
        "description": "Get portal branding settings. Public endpoint (no auth required) for theming the portal before user authentication.",
        "operationId": "get_portal_settings_api_v1_portal_settings_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSettingsResponse"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Portal"
        ],
        "summary": "Update portal settings",
        "description": "Update portal branding settings. Requires admin role. Only provided fields are updated (partial update).",
        "operationId": "update_portal_settings_api_v1_portal_settings_put",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PortalSettingsUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/settings/logo": {
      "post": {
        "tags": [
          "Portal"
        ],
        "summary": "Upload portal logo",
        "description": "Upload a logo image for the portal. Accepts PNG, JPEG, SVG, or WebP up to 2 MB. Requires admin role.",
        "operationId": "upload_portal_logo_api_v1_portal_settings_logo_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_portal_logo_api_v1_portal_settings_logo_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSettingsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/servers": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "List portal servers",
        "description": "List MCP servers visible in the portal. Returns only servers where portal_visible=true. Requires authentication.",
        "operationId": "list_portal_servers_api_v1_portal_servers_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Items per page",
              "default": 20,
              "title": "Page Size"
            },
            "description": "Items per page"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by name",
              "title": "Search"
            },
            "description": "Search by name"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category",
              "title": "Category"
            },
            "description": "Filter by category"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalServerListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/servers/{server_id}": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "Get portal server detail",
        "description": "Get detailed view of a portal-visible server including its full tools list. Requires authentication.",
        "operationId": "get_portal_server_detail_api_v1_portal_servers__server_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalServerDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/connections": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "List portal connections",
        "description": "List the current user's server connections. Returns only valid (non-revoked) connections. Requires authentication.",
        "operationId": "list_portal_connections_api_v1_portal_connections_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalConnectionListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/connections/{server_id}": {
      "delete": {
        "tags": [
          "Portal"
        ],
        "summary": "Delete portal connection",
        "description": "Disconnect from a server by revoking the user's connection. Users can only disconnect their own connections.",
        "operationId": "delete_portal_connection_api_v1_portal_connections__server_id__delete",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/skills": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "List portal skills",
        "description": "List skills visible in the portal. Returns only skills where portal_visible=true, ordered by download count.",
        "operationId": "list_portal_skills_api_v1_portal_skills_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "description": "Page number",
              "default": 1,
              "title": "Page"
            },
            "description": "Page number"
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Items per page",
              "default": 20,
              "title": "Page Size"
            },
            "description": "Items per page"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Search by name",
              "title": "Search"
            },
            "description": "Search by name"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category",
              "title": "Category"
            },
            "description": "Filter by category"
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSkillListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/skills/{skill_id}": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "Get portal skill detail",
        "description": "Get detailed view of a portal-visible skill including SKILL.md content preview. Requires authentication.",
        "operationId": "get_portal_skill_detail_api_v1_portal_skills__skill_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSkillDetailResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/skills/{skill_id}/download": {
      "post": {
        "tags": [
          "Portal"
        ],
        "summary": "Download portal skill",
        "description": "Increment download count for a skill and return the updated skill. Tracks usage for trending metrics.",
        "operationId": "download_portal_skill_api_v1_portal_skills__skill_id__download_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalSkillResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/skills/{skill_id}/package": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "Download portal skill package",
        "description": "Download the .skill ZIP package for a portal-visible skill. Only serves packages for portal_visible=true skills.",
        "operationId": "download_portal_skill_package_api_v1_portal_skills__skill_id__package_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "skill_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Skill Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/servers/{server_id}/ide-config": {
      "post": {
        "tags": [
          "Portal"
        ],
        "summary": "Generate IDE config snippet",
        "description": "Generate an IDE-specific MCP configuration snippet for a portal server. Accepts API key in POST body for security.",
        "operationId": "get_ide_config_api_v1_portal_servers__server_id__ide_config_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Body_get_ide_config_api_v1_portal_servers__server_id__ide_config_post"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Ide Config Api V1 Portal Servers  Server Id  Ide Config Post"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/ide-config/supported-ides": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "List supported IDEs",
        "description": "List supported IDE identifiers for config generation (e.g., vscode, cursor, claude, windsurf).",
        "operationId": "get_supported_ides_api_v1_portal_ide_config_supported_ides_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Supported Ides Api V1 Portal Ide Config Supported Ides Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/stats": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "Get portal stats",
        "description": "Get aggregated usage stats for the portal home page including trending servers and trending tools.",
        "operationId": "get_portal_stats_api_v1_portal_stats_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalStatsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/playground/tools": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "List playground tools",
        "description": "List servers and skills available for the portal user's playground session. Filters servers based on user connections and credential mode.",
        "operationId": "get_portal_playground_tools_api_v1_portal_playground_tools_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlaygroundAvailableToolsResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/portal/playground/llm-status": {
      "get": {
        "tags": [
          "Portal"
        ],
        "summary": "Check LLM configuration status",
        "description": "Check if an LLM provider is configured for the playground. Returns whether the AI chat feature is available and the model name.",
        "operationId": "get_portal_llm_status_api_v1_portal_playground_llm_status_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LLMStatusResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/version-check": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Version Check",
        "description": "Check for newer version. Requires authentication.",
        "operationId": "version_check_api_v1_system_version_check_get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionCheckResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/upgrade": {
      "post": {
        "tags": [
          "System"
        ],
        "summary": "Trigger Upgrade",
        "description": "Trigger an in-app upgrade. Requires admin role.\n\nOnly works for direct Helm installs. Marketplace installs should use\n`az k8s-extension update` or rely on auto-upgrade.",
        "operationId": "trigger_upgrade_api_v1_system_upgrade_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpgradeRequest"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/system/upgrade/{operation_id}": {
      "get": {
        "tags": [
          "System"
        ],
        "summary": "Get Upgrade Status",
        "description": "Get the status of an upgrade operation.",
        "operationId": "get_upgrade_status_api_v1_system_upgrade__operation_id__get",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "operation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Operation Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpgradeOperationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/mcp/gateway": {
      "post": {
        "tags": [
          "MCP Gateway"
        ],
        "summary": "Handle gateway MCP request",
        "description": "Handle MCP JSON-RPC requests for the unified gateway. Supports initialize, tools/list, and tools/call methods with content negotiation.",
        "operationId": "handle_gateway_request_mcp_gateway_post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Accept"
            }
          },
          {
            "name": "Mcp-Session-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Mcp-Session-Id"
            }
          },
          {
            "name": "X-MCP-Session-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Mcp-Session-Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/mcp/servers/{server_id}": {
      "post": {
        "tags": [
          "MCP Gateway"
        ],
        "summary": "Handle direct server MCP request",
        "description": "Handle MCP JSON-RPC requests for direct server access. Always uses LIST mode with original tool names (no prefixes).",
        "operationId": "handle_server_direct_request_mcp_servers__server_id__post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "server_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Server Id"
            }
          },
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Accept"
            }
          },
          {
            "name": "Mcp-Session-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Mcp-Session-Id"
            }
          },
          {
            "name": "X-MCP-Session-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Mcp-Session-Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/mcp/bundle/{bundle_key}": {
      "post": {
        "tags": [
          "MCP Bundle Proxy"
        ],
        "summary": "Handle Bundle Mcp Request",
        "description": "Handle MCP JSON-RPC requests for bundles.\n\nThis endpoint exposes bundles via the MCP protocol. Bundles act as\ntransparent tool aggregators that always list all their enabled tools\ndirectly.\n\nFor search/execute mode with semantic search, use the unified gateway\nendpoint (/mcp/gateway) which respects user's gateway_settings.\n\nThe bundle_key serves as authentication - only valid keys can access bundles.\n\nSession Management:\n- If Mcp-Session-Id header is provided, uses existing session\n- Otherwise, creates a new session (anonymous if no user_id)\n- Returns session ID in Mcp-Session-Id response header\n\nArgs:\n    bundle_key: The bundle's unique sharing key (auth).\n    request: The JSON-RPC request body.\n    http_response: FastAPI response object for setting headers.\n    session: Database session (injected).\n    server_repo: Server repository (injected).\n    mcp_client: MCP client service (injected).\n    audit_logger: Audit logger (injected).\n    embeddings: Embeddings service (injected).\n    cred_service: Credential resolution service (injected).\n    session_service: Session service (injected).\n    user_id: Optional authenticated user's ID.\n    x_mcp_session_id: Optional session ID from request header.\n\nReturns:\n    JSONResponse with the JSON-RPC response and Mcp-Session-Id header.\n\nRaises:\n    HTTPException: 404 if bundle not found, 500 if processing fails.",
        "operationId": "handle_bundle_mcp_request_mcp_bundle__bundle_key__post",
        "security": [
          {
            "User API Key": []
          }
        ],
        "parameters": [
          {
            "name": "bundle_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "title": "Bundle Key"
            }
          },
          {
            "name": "Mcp-Session-Id",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Mcp-Session-Id"
            }
          },
          {
            "name": "X-MCP-Session-ID",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Mcp-Session-Id"
            }
          },
          {
            "name": "access_token",
            "in": "cookie",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Access Token"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "title": "Request"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/mcp/bundle/{bundle_key}/info": {
      "get": {
        "tags": [
          "MCP Bundle Proxy"
        ],
        "summary": "Get Bundle Proxy Info",
        "description": "Get information about a proxied bundle.\n\nArgs:\n    bundle_key: The bundle's unique sharing key.\n    session: Database session (injected).\n\nReturns:\n    JSONResponse with bundle information.",
        "operationId": "get_bundle_proxy_info_mcp_bundle__bundle_key__info_get",
        "parameters": [
          {
            "name": "bundle_key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bundle Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/metrics": {
      "get": {
        "tags": [
          "metrics"
        ],
        "summary": "Get Prometheus metrics",
        "description": "Prometheus metrics endpoint for scraping. Returns all registered metrics in text exposition format. Returns 404 when Prometheus endpoint is disabled in settings.",
        "operationId": "prometheus_metrics_api_v1_metrics_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActionType": {
        "type": "string",
        "enum": [
          "fix_config",
          "add_credentials",
          "retry",
          "view_docs",
          "none"
        ],
        "title": "ActionType",
        "description": "Types of actions users can take to fix errors."
      },
      "ActiveProvidersResponse": {
        "properties": {
          "llm": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConfiguredProviderResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "embedding": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ConfiguredProviderResponse"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "llm",
          "embedding"
        ],
        "title": "ActiveProvidersResponse",
        "description": "Response schema for active providers."
      },
      "ActivityItem": {
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "server_created",
              "server_deleted",
              "server_updated",
              "skill_created",
              "skill_deleted",
              "tool_executed",
              "tool_call_success",
              "tool_call_error",
              "user_login",
              "user_created",
              "settings_changed"
            ],
            "title": "Type",
            "description": "Type of activity event"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Human-readable description of the event"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details",
            "description": "Additional event details"
          },
          "server": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server",
            "description": "Related server name if any"
          },
          "tool": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool",
            "description": "Tool name for tool call events"
          },
          "user": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User",
            "description": "User who triggered the event if applicable"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp",
            "description": "When the event occurred"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "success",
              "warning",
              "error"
            ],
            "title": "Severity",
            "description": "Event severity level for UI styling",
            "default": "info"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms",
            "description": "Latency in ms for tool call events"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "Status for tool call events (success/error)"
          }
        },
        "type": "object",
        "required": [
          "type",
          "description",
          "timestamp"
        ],
        "title": "ActivityItem",
        "description": "A single activity/event item for the dashboard feed."
      },
      "ActivityResponse": {
        "properties": {
          "activity": {
            "items": {
              "$ref": "#/components/schemas/ActivityItem"
            },
            "type": "array",
            "title": "Activity",
            "description": "Filtered activity feed"
          },
          "filter": {
            "type": "string",
            "enum": [
              "all",
              "tools",
              "errors",
              "admin"
            ],
            "title": "Filter",
            "description": "Current filter applied"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At",
            "description": "When activity data was generated (UTC)"
          }
        },
        "type": "object",
        "required": [
          "filter",
          "generated_at"
        ],
        "title": "ActivityResponse",
        "description": "Standalone activity feed response (for filter-only updates)."
      },
      "AnalysisResultResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "Job UUID"
          },
          "analysis": {
            "$ref": "#/components/schemas/ApiAnalysis",
            "description": "Analysis result data"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "analysis"
        ],
        "title": "AnalysisResultResponse",
        "description": "Response for analysis result endpoint."
      },
      "AnalyzeRequirementsRequest": {
        "properties": {
          "input": {
            "type": "string",
            "minLength": 1,
            "title": "Input",
            "description": "Package name, container image, or URL to analyze"
          },
          "input_type": {
            "type": "string",
            "enum": [
              "auto",
              "npx",
              "uvx",
              "container",
              "remote"
            ],
            "title": "Input Type",
            "description": "Type of input (auto-detect if not specified)",
            "default": "auto"
          }
        },
        "type": "object",
        "required": [
          "input"
        ],
        "title": "AnalyzeRequirementsRequest",
        "description": "Request to analyze credential requirements for an MCP server."
      },
      "ApiAnalysis": {
        "properties": {
          "api_title": {
            "type": "string",
            "title": "Api Title",
            "description": "Title of the API"
          },
          "api_description": {
            "type": "string",
            "title": "Api Description",
            "description": "Description of the API",
            "default": ""
          },
          "base_url": {
            "type": "string",
            "title": "Base Url",
            "description": "Base URL of the API",
            "default": ""
          },
          "auth_type": {
            "type": "string",
            "title": "Auth Type",
            "description": "Detected authentication type",
            "default": "none"
          },
          "endpoints_found": {
            "type": "integer",
            "title": "Endpoints Found",
            "description": "Number of endpoints discovered",
            "default": 0
          },
          "tools_planned": {
            "items": {
              "$ref": "#/components/schemas/CuratedTool"
            },
            "type": "array",
            "title": "Tools Planned",
            "description": "AI-curated tools to be generated"
          },
          "legacy_tools": {
            "items": {
              "$ref": "#/components/schemas/PlannedTool"
            },
            "type": "array",
            "title": "Legacy Tools",
            "description": "Legacy tool format (deprecated)"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings",
            "description": "Warnings from analysis"
          },
          "pruned_endpoints": {
            "items": {
              "$ref": "#/components/schemas/PrunedEndpointInfo"
            },
            "type": "array",
            "title": "Pruned Endpoints",
            "description": "Endpoints pruned during enrichment (health checks, admin, deprecated)"
          },
          "consolidated_endpoints": {
            "items": {
              "$ref": "#/components/schemas/ConsolidatedEndpointInfo"
            },
            "type": "array",
            "title": "Consolidated Endpoints",
            "description": "Endpoints consolidated into single tools"
          }
        },
        "type": "object",
        "required": [
          "api_title"
        ],
        "title": "ApiAnalysis",
        "description": "Result of API analysis from the EnrichmentService pipeline.\n\nContains enriched tool definitions with AI-first descriptions:\n- \"Use when:\" semantic descriptions\n- Scope annotations (read/write/destructive)\n- MCP annotations (readOnlyHint, destructiveHint, idempotentHint)"
      },
      "ApiKeyConfigInline": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "description": "Key name",
            "default": "Default Key"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Key description"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes",
            "description": "Permission scopes"
          },
          "rate_limit_rpm": {
            "type": "integer",
            "maximum": 10000.0,
            "minimum": 1.0,
            "title": "Rate Limit Rpm",
            "description": "Rate limit (requests per minute)",
            "default": 60
          },
          "expires_in_days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 365.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Days",
            "description": "Days until expiration"
          }
        },
        "type": "object",
        "title": "ApiKeyConfigInline",
        "description": "Configuration for creating an API key inline with user creation."
      },
      "ApiKeyEnvironment": {
        "type": "string",
        "enum": [
          "live",
          "test"
        ],
        "title": "ApiKeyEnvironment",
        "description": "API key environment."
      },
      "ApiKeyInResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "API key ID"
          },
          "key": {
            "type": "string",
            "title": "Key",
            "description": "Full API key (shown only once)"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Key name"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At",
            "description": "Expiration time"
          }
        },
        "type": "object",
        "required": [
          "id",
          "key",
          "name"
        ],
        "title": "ApiKeyInResponse",
        "description": "API key data included in user creation response."
      },
      "ApproveRequest": {
        "properties": {
          "selected_tools": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Selected Tools",
            "description": "List of tool names to include (None = all tools)"
          },
          "credential_mode": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CredentialMode"
              },
              {
                "type": "null"
              }
            ],
            "description": "How credentials are handled: managed, user_provided, or none. If omitted, defaults based on detected auth_type."
          },
          "feedback": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ],
            "title": "Feedback",
            "description": "Optional feedback for tool modifications"
          }
        },
        "type": "object",
        "title": "ApproveRequest",
        "description": "Request to approve a generation job for deployment.\n\nIncludes optional tool selection, credential mode override, and feedback."
      },
      "ApproveResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "Job UUID"
          },
          "status": {
            "$ref": "#/components/schemas/GenerationJobStatus",
            "description": "Updated job status"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Status message"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "message"
        ],
        "title": "ApproveResponse",
        "description": "Response after approving a generation job."
      },
      "AttachServerResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "Link ID"
          },
          "oauth_app_id": {
            "type": "string",
            "format": "uuid",
            "title": "Oauth App Id"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": "Successfully attached OAuth app to server"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "oauth_app_id",
          "server_id",
          "created_at"
        ],
        "title": "AttachServerResponse",
        "description": "Response schema for attaching an OAuth app to a server."
      },
      "AttachSkillResponse": {
        "properties": {
          "attachment_id": {
            "type": "string",
            "title": "Attachment Id"
          },
          "tools_registered": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tools Registered"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "skill_id": {
            "type": "string",
            "format": "uuid",
            "title": "Skill Id"
          }
        },
        "type": "object",
        "required": [
          "attachment_id",
          "tools_registered",
          "server_id",
          "skill_id"
        ],
        "title": "AttachSkillResponse",
        "description": "Response from attaching a skill to a server."
      },
      "AuditExportConfigCreate": {
        "properties": {
          "destination": {
            "type": "string",
            "pattern": "^(s3|azure_blob|gcs)$",
            "title": "Destination"
          },
          "schedule": {
            "type": "string",
            "pattern": "^(hourly|daily|weekly|monthly)$",
            "title": "Schedule"
          },
          "bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bucket"
          },
          "container": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Container"
          },
          "region": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Region"
          },
          "prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefix"
          }
        },
        "type": "object",
        "required": [
          "destination",
          "schedule"
        ],
        "title": "AuditExportConfigCreate",
        "description": "Schema for creating an audit export configuration."
      },
      "AuditExportConfigResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "destination": {
            "type": "string",
            "title": "Destination"
          },
          "schedule": {
            "type": "string",
            "title": "Schedule"
          },
          "last_export_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Export At"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "destination",
          "schedule",
          "last_export_at",
          "enabled",
          "created_at",
          "updated_at"
        ],
        "title": "AuditExportConfigResponse",
        "description": "Response schema for audit export configuration."
      },
      "AuditExportConfigUpdate": {
        "properties": {
          "schedule": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(hourly|daily|weekly|monthly)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedule"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bucket"
          },
          "container": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Container"
          },
          "prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefix"
          }
        },
        "type": "object",
        "title": "AuditExportConfigUpdate",
        "description": "Schema for updating an audit export configuration (partial update)."
      },
      "AuthMethod": {
        "type": "string",
        "enum": [
          "none",
          "bearer",
          "oauth2"
        ],
        "title": "AuthMethod",
        "description": "Authentication method for MCP servers (MCP spec Nov 2025)."
      },
      "AuthProviderInfo": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "icon": {
            "type": "string",
            "title": "Icon"
          }
        },
        "type": "object",
        "required": [
          "name",
          "display_name",
          "icon"
        ],
        "title": "AuthProviderInfo",
        "description": "OAuth provider info for UI."
      },
      "AuthSettingsResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "setup_completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Setup Completed At",
            "description": "When initial auth setup was completed"
          },
          "allowed_email_domains": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Allowed Email Domains",
            "description": "Email domains allowed to register (empty = all allowed)"
          },
          "admin_emails": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Admin Emails",
            "description": "Email addresses that receive admin role on registration"
          },
          "access_token_expire_minutes": {
            "type": "integer",
            "title": "Access Token Expire Minutes",
            "description": "JWT access token expiration in minutes",
            "default": 30
          },
          "refresh_token_expire_days": {
            "type": "integer",
            "title": "Refresh Token Expire Days",
            "description": "JWT refresh token expiration in days",
            "default": 7
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "created_at",
          "updated_at"
        ],
        "title": "AuthSettingsResponse",
        "description": "Response schema for auth settings.\n\nReturns all auth configuration except sensitive data like secrets.\nUsed for displaying current settings in the admin UI."
      },
      "AuthSettingsUpdate": {
        "properties": {
          "allowed_email_domains": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Email Domains"
          },
          "admin_emails": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Admin Emails"
          },
          "access_token_expire_minutes": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1440.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Access Token Expire Minutes",
            "description": "JWT access token expiration in minutes (1-1440)"
          },
          "refresh_token_expire_days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 365.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Token Expire Days",
            "description": "JWT refresh token expiration in days (1-365)"
          }
        },
        "type": "object",
        "title": "AuthSettingsUpdate",
        "description": "Request schema for updating auth settings.\n\nAll fields are optional to support partial updates.\nOnly provided fields will be updated."
      },
      "AvailableProviderConfig": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "Provider identifier (e.g., 'openai', 'anthropic')"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Human-readable provider name"
          },
          "models": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Models",
            "description": "Available models for this provider"
          },
          "default_model": {
            "type": "string",
            "title": "Default Model",
            "description": "Default model for this provider"
          },
          "requires_api_key": {
            "type": "boolean",
            "title": "Requires Api Key",
            "description": "Whether API key is required"
          },
          "requires_endpoint": {
            "type": "boolean",
            "title": "Requires Endpoint",
            "description": "Whether endpoint URL is required"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "display_name",
          "models",
          "default_model",
          "requires_api_key",
          "requires_endpoint"
        ],
        "title": "AvailableProviderConfig",
        "description": "Configuration for an available provider (simplified for API response)."
      },
      "AvailableProvidersResponse": {
        "properties": {
          "llm_providers": {
            "items": {
              "$ref": "#/components/schemas/AvailableProviderConfig"
            },
            "type": "array",
            "title": "Llm Providers"
          },
          "embedding_providers": {
            "items": {
              "$ref": "#/components/schemas/AvailableProviderConfig"
            },
            "type": "array",
            "title": "Embedding Providers"
          }
        },
        "type": "object",
        "required": [
          "llm_providers",
          "embedding_providers"
        ],
        "title": "AvailableProvidersResponse",
        "description": "Response schema for available provider configurations."
      },
      "Body_get_ide_config_api_v1_portal_servers__server_id__ide_config_post": {
        "properties": {
          "ide": {
            "type": "string",
            "title": "Ide",
            "description": "IDE identifier (vscode, cursor, claude, windsurf)"
          },
          "api_key": {
            "type": "string",
            "title": "Api Key",
            "description": "User API key for the config snippet"
          }
        },
        "type": "object",
        "required": [
          "ide",
          "api_key"
        ],
        "title": "Body_get_ide_config_api_v1_portal_servers__server_id__ide_config_post"
      },
      "Body_update_visibility_api_v1_curated_apps__entry_id__visibility_patch": {
        "properties": {
          "visible": {
            "type": "boolean",
            "title": "Visible"
          }
        },
        "type": "object",
        "required": [
          "visible"
        ],
        "title": "Body_update_visibility_api_v1_curated_apps__entry_id__visibility_patch"
      },
      "Body_upload_portal_logo_api_v1_portal_settings_logo_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_portal_logo_api_v1_portal_settings_logo_post"
      },
      "Body_upload_skill_api_v1_skills_upload_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File",
            "description": "Skill file (.zip, .skill, or .md)"
          },
          "mcp_server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Id",
            "description": "Optional MCP server ID"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_skill_api_v1_skills_upload_post"
      },
      "BulkActionRequest": {
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "start",
              "stop",
              "delete",
              "sync"
            ],
            "title": "Action"
          },
          "server_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "title": "Server Ids"
          }
        },
        "type": "object",
        "required": [
          "action",
          "server_ids"
        ],
        "title": "BulkActionRequest",
        "description": "Request to perform an action on multiple servers."
      },
      "BulkActionResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/BulkActionResult"
            },
            "type": "array",
            "title": "Results"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "succeeded": {
            "type": "integer",
            "title": "Succeeded"
          },
          "failed": {
            "type": "integer",
            "title": "Failed"
          }
        },
        "type": "object",
        "required": [
          "results",
          "total",
          "succeeded",
          "failed"
        ],
        "title": "BulkActionResponse",
        "description": "Response containing results for all servers in the bulk action."
      },
      "BulkActionResult": {
        "properties": {
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "server_id",
          "status"
        ],
        "title": "BulkActionResult",
        "description": "Result for a single server in a bulk action."
      },
      "BulkHealthCheckResponse": {
        "properties": {
          "results": {
            "items": {
              "$ref": "#/components/schemas/HealthCheckResponse"
            },
            "type": "array",
            "title": "Results"
          },
          "total_checked": {
            "type": "integer",
            "title": "Total Checked"
          },
          "running": {
            "type": "integer",
            "title": "Running"
          },
          "stopped": {
            "type": "integer",
            "title": "Stopped"
          },
          "error": {
            "type": "integer",
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "results",
          "total_checked",
          "running",
          "stopped",
          "error"
        ],
        "title": "BulkHealthCheckResponse",
        "description": "Response schema for bulk health check."
      },
      "BulkSandboxRequest": {
        "properties": {
          "sandbox_ids": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Sandbox Ids",
            "description": "List of sandbox IDs to operate on"
          }
        },
        "type": "object",
        "required": [
          "sandbox_ids"
        ],
        "title": "BulkSandboxRequest",
        "description": "Request for bulk sandbox operations."
      },
      "BulkSandboxResponse": {
        "properties": {
          "stopped": {
            "type": "integer",
            "title": "Stopped",
            "default": 0
          },
          "destroyed": {
            "type": "integer",
            "title": "Destroyed",
            "default": 0
          },
          "skipped": {
            "type": "integer",
            "title": "Skipped",
            "default": 0
          },
          "errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Errors"
          }
        },
        "type": "object",
        "title": "BulkSandboxResponse",
        "description": "Response for bulk stop/destroy operations."
      },
      "BundleReorderRequest": {
        "properties": {
          "tool_orders": {
            "items": {
              "prefixItems": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "integer"
                }
              ],
              "type": "array",
              "maxItems": 2,
              "minItems": 2
            },
            "type": "array",
            "title": "Tool Orders",
            "description": "List of (tool_id, new_order) tuples"
          }
        },
        "type": "object",
        "required": [
          "tool_orders"
        ],
        "title": "BundleReorderRequest",
        "description": "Schema for reordering tools in a bundle."
      },
      "BundleToolCreate": {
        "properties": {
          "tool_id": {
            "type": "string",
            "format": "uuid",
            "title": "Tool Id"
          },
          "override_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Name",
            "description": "Optional name override for this tool in the bundle"
          },
          "override_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Description",
            "description": "Optional description override for this tool in the bundle"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled",
            "description": "Whether the tool is active in the bundle",
            "default": true
          },
          "display_order": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Display Order",
            "description": "Display order for List mode (lower = earlier)",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "tool_id"
        ],
        "title": "BundleToolCreate",
        "description": "Schema for adding a tool to a bundle."
      },
      "BundleToolResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "tool_id": {
            "type": "string",
            "format": "uuid",
            "title": "Tool Id"
          },
          "override_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Name"
          },
          "override_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Description"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "display_order": {
            "type": "integer",
            "title": "Display Order"
          },
          "has_override_embedding": {
            "type": "boolean",
            "title": "Has Override Embedding",
            "default": false
          },
          "original_name": {
            "type": "string",
            "title": "Original Name"
          },
          "original_description": {
            "type": "string",
            "title": "Original Description"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          },
          "effective_name": {
            "type": "string",
            "title": "Effective Name"
          },
          "effective_description": {
            "type": "string",
            "title": "Effective Description"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "tool_id",
          "override_name",
          "override_description",
          "enabled",
          "display_order",
          "original_name",
          "original_description",
          "server_id",
          "server_name",
          "input_schema",
          "effective_name",
          "effective_description",
          "created_at",
          "updated_at"
        ],
        "title": "BundleToolResponse",
        "description": "Schema for a tool within a bundle."
      },
      "BundleToolUpdate": {
        "properties": {
          "override_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Name"
          },
          "override_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Description"
          },
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "display_order": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Order"
          }
        },
        "type": "object",
        "title": "BundleToolUpdate",
        "description": "Schema for updating a tool in a bundle."
      },
      "BundleToolsAddRequest": {
        "properties": {
          "tools": {
            "items": {
              "$ref": "#/components/schemas/BundleToolCreate"
            },
            "type": "array",
            "title": "Tools"
          }
        },
        "type": "object",
        "required": [
          "tools"
        ],
        "title": "BundleToolsAddRequest",
        "description": "Schema for adding multiple tools to a bundle."
      },
      "BundleToolsListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/BundleToolResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "has_next": {
            "type": "boolean",
            "title": "Has Next"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "has_next"
        ],
        "title": "BundleToolsListResponse",
        "description": "Paginated list of bundle tools."
      },
      "CancelJobResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "Job UUID"
          },
          "status": {
            "$ref": "#/components/schemas/GenerationJobStatus",
            "description": "Updated job status"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Status message"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "message"
        ],
        "title": "CancelJobResponse",
        "description": "Response after cancelling a generation job."
      },
      "CatalogImportRequest": {
        "properties": {
          "registry": {
            "type": "string",
            "enum": [
              "mcp_registry",
              "dockerhub",
              "pulsemcp"
            ],
            "title": "Registry",
            "description": "Source registry for this catalog entry"
          },
          "registry_id": {
            "type": "string",
            "title": "Registry Id",
            "description": "Unique identifier of the server in the registry"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "description": "Name to assign to the imported server"
          },
          "args": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Args",
            "description": "Command-line arguments for the server"
          },
          "env_vars": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Env Vars",
            "description": "Environment variables for the server (key-value pairs)"
          }
        },
        "type": "object",
        "required": [
          "registry",
          "registry_id",
          "name"
        ],
        "title": "CatalogImportRequest",
        "description": "Request to import a server from the catalog.\n\nContains the registry information and configuration\noverrides needed to create an MCP server from a catalog entry."
      },
      "CatalogSearchResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CatalogServer"
            },
            "type": "array",
            "title": "Items",
            "description": "List of catalog servers matching the search query"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor",
            "description": "Cursor for fetching the next page of results"
          },
          "total": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Total",
            "description": "Total number of matching servers across all pages"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "CatalogSearchResponse",
        "description": "Paginated response for catalog search results."
      },
      "CatalogServer": {
        "properties": {
          "registry": {
            "type": "string",
            "enum": [
              "mcp_registry",
              "dockerhub",
              "pulsemcp"
            ],
            "title": "Registry",
            "description": "Source registry for this catalog entry"
          },
          "registry_id": {
            "type": "string",
            "title": "Registry Id",
            "description": "Unique identifier within the registry (e.g., 'io.anthropic/filesystem' or 'mcp/postgres')"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Human-readable name of the server"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Description of the server's functionality"
          },
          "server_type": {
            "$ref": "#/components/schemas/MCPServerType",
            "description": "Type of MCP server deployment (npx, uvx, container, remote)"
          },
          "package": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Package",
            "description": "NPM/PyPI package name (e.g., '@anthropic/mcp-server-filesystem')"
          },
          "image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image",
            "description": "Docker image reference (e.g., 'mcp/postgres:latest')"
          },
          "transport": {
            "type": "string",
            "enum": [
              "stdio",
              "streamable-http",
              "sse"
            ],
            "title": "Transport",
            "description": "Transport protocol: 'stdio', 'streamable-http', or 'sse'"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "URL for remote servers"
          },
          "required_env": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required Env",
            "description": "List of required environment variable names (e.g., ['API_KEY', 'DATABASE_URL'])"
          },
          "required_args": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required Args",
            "description": "List of required command-line arguments (e.g., ['--directory'])"
          },
          "repository_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repository Url",
            "description": "URL to the source code repository"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Version of the server package or image"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At",
            "description": "When the server was last updated in the registry"
          },
          "download_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Count",
            "description": "Total downloads/pulls from registry"
          },
          "star_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Star Count",
            "description": "Stars/favorites from registry"
          },
          "is_official": {
            "type": "boolean",
            "title": "Is Official",
            "description": "True if in mcp/ namespace or Official MCP Registry",
            "default": false
          },
          "metrics_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics Updated At",
            "description": "When metrics were last fetched from registry"
          },
          "tool_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Count",
            "description": "Number of tools provided by this MCP server"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category",
            "description": "Primary category (e.g., 'Monitoring & Observability')"
          },
          "author": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author",
            "description": "Author or maintainer name"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License",
            "description": "License type (e.g., 'Apache License 2.0')"
          }
        },
        "type": "object",
        "required": [
          "registry",
          "registry_id",
          "name",
          "description",
          "server_type",
          "transport"
        ],
        "title": "CatalogServer",
        "description": "Server information from catalog search.\n\nRepresents a server entry from either the MCP Registry\nor Docker Hub that can be imported into MCP Gateway."
      },
      "CatalogServerDetails": {
        "properties": {
          "registry": {
            "type": "string",
            "enum": [
              "mcp_registry",
              "dockerhub",
              "pulsemcp"
            ],
            "title": "Registry",
            "description": "Source registry for this catalog entry"
          },
          "registry_id": {
            "type": "string",
            "title": "Registry Id",
            "description": "Unique identifier within the registry (e.g., 'io.anthropic/filesystem' or 'mcp/postgres')"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Human-readable name of the server"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Description of the server's functionality"
          },
          "server_type": {
            "$ref": "#/components/schemas/MCPServerType",
            "description": "Type of MCP server deployment (npx, uvx, container, remote)"
          },
          "package": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Package",
            "description": "NPM/PyPI package name (e.g., '@anthropic/mcp-server-filesystem')"
          },
          "image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image",
            "description": "Docker image reference (e.g., 'mcp/postgres:latest')"
          },
          "transport": {
            "type": "string",
            "enum": [
              "stdio",
              "streamable-http",
              "sse"
            ],
            "title": "Transport",
            "description": "Transport protocol: 'stdio', 'streamable-http', or 'sse'"
          },
          "url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url",
            "description": "URL for remote servers"
          },
          "required_env": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required Env",
            "description": "List of required environment variable names (e.g., ['API_KEY', 'DATABASE_URL'])"
          },
          "required_args": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required Args",
            "description": "List of required command-line arguments (e.g., ['--directory'])"
          },
          "repository_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Repository Url",
            "description": "URL to the source code repository"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "description": "Version of the server package or image"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At",
            "description": "When the server was last updated in the registry"
          },
          "download_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Download Count",
            "description": "Total downloads/pulls from registry"
          },
          "star_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Star Count",
            "description": "Stars/favorites from registry"
          },
          "is_official": {
            "type": "boolean",
            "title": "Is Official",
            "description": "True if in mcp/ namespace or Official MCP Registry",
            "default": false
          },
          "metrics_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metrics Updated At",
            "description": "When metrics were last fetched from registry"
          },
          "tool_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Count",
            "description": "Number of tools provided by this MCP server"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category",
            "description": "Primary category (e.g., 'Monitoring & Observability')"
          },
          "author": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author",
            "description": "Author or maintainer name"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License",
            "description": "License type (e.g., 'Apache License 2.0')"
          },
          "import_preview": {
            "$ref": "#/components/schemas/ImportPreview",
            "description": "Preview of the MCP server that will be created on import"
          }
        },
        "type": "object",
        "required": [
          "registry",
          "registry_id",
          "name",
          "description",
          "server_type",
          "transport",
          "import_preview"
        ],
        "title": "CatalogServerDetails",
        "description": "Extended server information with import preview.\n\nIncludes all CatalogServer fields plus an import preview\nshowing what will be created when the server is imported."
      },
      "ConfiguredProviderCreate": {
        "properties": {
          "provider_type": {
            "$ref": "#/components/schemas/ProviderType"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "Provider name (e.g., 'openai', 'anthropic')"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key",
            "description": "Will be encrypted before storage"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          }
        },
        "type": "object",
        "required": [
          "provider_type",
          "provider",
          "model"
        ],
        "title": "ConfiguredProviderCreate",
        "description": "Request schema for creating a configured provider."
      },
      "ConfiguredProviderResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "provider_type": {
            "$ref": "#/components/schemas/ProviderType"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "has_api_key": {
            "type": "boolean",
            "title": "Has Api Key",
            "description": "Whether an API key is configured"
          },
          "api_key_masked": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key Masked",
            "description": "Masked API key for display"
          },
          "needs_reconfiguration": {
            "type": "boolean",
            "title": "Needs Reconfiguration",
            "description": "True when API key exists but cannot be decrypted (SECRET_KEY changed)",
            "default": false
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "connection_verified": {
            "type": "boolean",
            "title": "Connection Verified"
          },
          "connection_verified_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Connection Verified At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider_type",
          "provider",
          "display_name",
          "model",
          "has_api_key",
          "is_active",
          "connection_verified",
          "created_at",
          "updated_at"
        ],
        "title": "ConfiguredProviderResponse",
        "description": "Response schema for a configured provider."
      },
      "ConfiguredProviderUpdate": {
        "properties": {
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key",
            "description": "Will be encrypted before storage"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          },
          "config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          }
        },
        "type": "object",
        "title": "ConfiguredProviderUpdate",
        "description": "Request schema for updating a configured provider."
      },
      "ConfiguredProvidersListResponse": {
        "properties": {
          "llm": {
            "items": {
              "$ref": "#/components/schemas/ConfiguredProviderResponse"
            },
            "type": "array",
            "title": "Llm"
          },
          "embedding": {
            "items": {
              "$ref": "#/components/schemas/ConfiguredProviderResponse"
            },
            "type": "array",
            "title": "Embedding"
          }
        },
        "type": "object",
        "required": [
          "llm",
          "embedding"
        ],
        "title": "ConfiguredProvidersListResponse",
        "description": "Response schema for listing providers grouped by type."
      },
      "ConnectedAccountListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ConnectedAccountWithServer"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "ConnectedAccountListResponse",
        "description": "Schema for paginated connected account list with server info.\n\nThis is the enhanced list response for Gate22-style connected accounts\ntable, returning connected accounts with embedded server information.\n\nExample:\n    response = ConnectedAccountListResponse(\n        items=[account1, account2],\n        total=2,\n    )"
      },
      "ConnectedAccountWithServer": {
        "properties": {
          "provider_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Name",
            "description": "OAuth provider name (github, google, etc.)"
          },
          "provider_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Email",
            "description": "User's email at the provider"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type",
            "default": "Bearer"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes"
          },
          "is_valid": {
            "type": "boolean",
            "title": "Is Valid",
            "default": true
          },
          "health_status": {
            "type": "string",
            "title": "Health Status",
            "description": "Token health: healthy, warning, critical",
            "default": "healthy"
          },
          "last_refreshed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Refreshed At"
          },
          "next_refresh_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Refresh At"
          },
          "consecutive_refresh_failures": {
            "type": "integer",
            "title": "Consecutive Refresh Failures",
            "default": 0
          },
          "refresh_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Error"
          },
          "mcp_session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Session Id"
          },
          "last_accessed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Accessed At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "revoke_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoke Reason"
          },
          "server": {
            "$ref": "#/components/schemas/ServerSummary",
            "description": "Associated MCP server summary"
          },
          "user": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "User info (if available/shared connection)"
          },
          "expiration_status": {
            "$ref": "#/components/schemas/ExpirationStatus",
            "description": "Token expiration status from CredentialExpirationService",
            "default": "healthy"
          },
          "auto_refresh_enabled": {
            "type": "boolean",
            "title": "Auto Refresh Enabled",
            "description": "Whether proactive auto-refresh is enabled and working",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "server_id",
          "created_at",
          "updated_at",
          "server"
        ],
        "title": "ConnectedAccountWithServer",
        "description": "Schema for connected account with embedded server and user info.\n\nThis is the enhanced response schema for Gate22-style connected accounts\ntable, providing all information needed for a rich UI display including\nserver details and expiration tracking.\n\nInherits all fields from ConnectionResponse and adds:\n- server: Embedded server summary for display\n- user: Optional user info for shared connections\n- expiration_status: Token expiration status tracking\n- auto_refresh_enabled: Auto-refresh status flag\n\nExample:\n    account = ConnectedAccountWithServer(\n        id=uuid.uuid4(),\n        server_id=server.id,\n        server=ServerSummary(\n            id=server.id,\n            name=\"github-mcp\",\n            display_name=\"GitHub\",\n            logo_url=\"...\",\n        ),\n        user=None,  # Only populated for shared connections\n        expiration_status=ExpirationStatus.HEALTHY,\n        auto_refresh_enabled=True,\n        is_valid=True,\n        created_at=datetime.now(UTC),\n        updated_at=datetime.now(UTC),\n    )"
      },
      "ConnectionFormField": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Field name/identifier"
          },
          "kind": {
            "type": "string",
            "enum": [
              "env_var",
              "cli_arg",
              "header"
            ],
            "title": "Kind",
            "description": "Type of the field"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Human-readable description"
          },
          "required": {
            "type": "boolean",
            "title": "Required",
            "description": "Whether this field is mandatory"
          },
          "sensitive": {
            "type": "boolean",
            "title": "Sensitive",
            "description": "Whether this is a password/secret field"
          },
          "example_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Example Format",
            "description": "Example of expected format"
          },
          "help_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Help Url",
            "description": "URL to help documentation"
          }
        },
        "type": "object",
        "required": [
          "name",
          "kind",
          "description",
          "required",
          "sensitive"
        ],
        "title": "ConnectionFormField",
        "description": "A single field in a user connection form.\n\nRepresents a credential or configuration value that a user needs to\nprovide when connecting to an MCP server."
      },
      "ConnectionFormResponse": {
        "properties": {
          "server_id": {
            "type": "string",
            "title": "Server Id",
            "description": "Server UUID"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Human-readable server name"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Server description"
          },
          "fields": {
            "items": {
              "$ref": "#/components/schemas/ConnectionFormField"
            },
            "type": "array",
            "title": "Fields",
            "description": "Form fields for user to fill"
          },
          "help_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Help Text",
            "description": "Additional help text for the form"
          }
        },
        "type": "object",
        "required": [
          "server_id",
          "server_name",
          "description"
        ],
        "title": "ConnectionFormResponse",
        "description": "Response containing the connection form for an MCP server.\n\nThis is sent to the frontend to render a dynamic form for users\nto provide their credentials."
      },
      "ConnectionHealthResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "server_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Name"
          },
          "is_valid": {
            "type": "boolean",
            "title": "Is Valid"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "expires_in_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Seconds",
            "description": "Seconds until token expires (negative if expired)"
          },
          "health_status": {
            "type": "string",
            "title": "Health Status",
            "default": "healthy"
          },
          "requires_reauth": {
            "type": "boolean",
            "title": "Requires Reauth",
            "description": "True if the connection cannot be refreshed and needs re-authentication",
            "default": false
          },
          "last_refreshed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Refreshed At"
          },
          "next_refresh_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Refresh At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "server_id",
          "is_valid"
        ],
        "title": "ConnectionHealthResponse",
        "description": "Schema for connection health check response."
      },
      "ConnectionHealthSummary": {
        "properties": {
          "total_connections": {
            "type": "integer",
            "title": "Total Connections"
          },
          "healthy": {
            "type": "integer",
            "title": "Healthy"
          },
          "warning": {
            "type": "integer",
            "title": "Warning"
          },
          "critical": {
            "type": "integer",
            "title": "Critical"
          },
          "require_reauth": {
            "type": "integer",
            "title": "Require Reauth"
          },
          "connections": {
            "items": {
              "$ref": "#/components/schemas/ConnectionHealthResponse"
            },
            "type": "array",
            "title": "Connections"
          }
        },
        "type": "object",
        "required": [
          "total_connections",
          "healthy",
          "warning",
          "critical",
          "require_reauth",
          "connections"
        ],
        "title": "ConnectionHealthSummary",
        "description": "Schema for overall connection health summary."
      },
      "ConnectionListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ConnectionResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "ConnectionListResponse",
        "description": "Schema for paginated connection list response."
      },
      "ConnectionResponse": {
        "properties": {
          "provider_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Name",
            "description": "OAuth provider name (github, google, etc.)"
          },
          "provider_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Email",
            "description": "User's email at the provider"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type",
            "default": "Bearer"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes"
          },
          "is_valid": {
            "type": "boolean",
            "title": "Is Valid",
            "default": true
          },
          "health_status": {
            "type": "string",
            "title": "Health Status",
            "description": "Token health: healthy, warning, critical",
            "default": "healthy"
          },
          "last_refreshed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Refreshed At"
          },
          "next_refresh_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Refresh At"
          },
          "consecutive_refresh_failures": {
            "type": "integer",
            "title": "Consecutive Refresh Failures",
            "default": 0
          },
          "refresh_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Error"
          },
          "mcp_session_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Session Id"
          },
          "last_accessed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Accessed At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "revoke_reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoke Reason"
          }
        },
        "type": "object",
        "required": [
          "id",
          "server_id",
          "created_at",
          "updated_at"
        ],
        "title": "ConnectionResponse",
        "description": "Schema for connection response (tokens are never exposed)."
      },
      "ConsolidatedEndpointInfo": {
        "properties": {
          "original_endpoints": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Original Endpoints",
            "description": "Original endpoint paths"
          },
          "consolidated_into": {
            "type": "string",
            "title": "Consolidated Into",
            "description": "Tool name they were merged into",
            "default": ""
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "description": "Why these endpoints were consolidated",
            "default": ""
          }
        },
        "type": "object",
        "title": "ConsolidatedEndpointInfo",
        "description": "Endpoints consolidated into a single tool."
      },
      "CreateUserConnectionRequest": {
        "properties": {
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id",
            "description": "ID of the MCP server to connect to"
          },
          "credential_type": {
            "$ref": "#/components/schemas/CredentialTypeEnum",
            "description": "Type of credential: api_key, bearer, or basic"
          },
          "credential_value": {
            "type": "string",
            "maxLength": 4096,
            "minLength": 1,
            "title": "Credential Value",
            "description": "The credential value (API key, bearer token, or base64 encoded basic auth)"
          },
          "alias": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Alias",
            "description": "Optional friendly name for this connection"
          },
          "header_name": {
            "type": "string",
            "maxLength": 100,
            "title": "Header Name",
            "description": "HTTP header name for the credential",
            "default": "Authorization"
          },
          "prefix": {
            "type": "string",
            "maxLength": 50,
            "title": "Prefix",
            "description": "Prefix for the credential value (e.g., 'Bearer ', 'Basic ', 'Token ')",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "server_id",
          "credential_type",
          "credential_value"
        ],
        "title": "CreateUserConnectionRequest",
        "description": "Request schema for creating a user-level API key connection.\n\nUsers can provide their own API keys for MCP servers that support\nuser-provided credentials. This is an alternative to OAuth for\nservers that use API key authentication.\n\nExample:\n    request = CreateUserConnectionRequest(\n        server_id=uuid.uuid4(),\n        credential_type=CredentialTypeEnum.API_KEY,\n        credential_value=\"sk-1234567890abcdef\",\n        alias=\"My GitHub Token\",\n        header_name=\"Authorization\",\n        prefix=\"Bearer \",\n    )"
      },
      "CreateUserConnectionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "Connection UUID"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id",
            "description": "Associated MCP server UUID"
          },
          "user_id": {
            "type": "string",
            "format": "uuid",
            "title": "User Id",
            "description": "Owner user UUID"
          },
          "credential_type": {
            "type": "string",
            "title": "Credential Type",
            "description": "Type of credential stored"
          },
          "alias": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Alias",
            "description": "Friendly name for the connection"
          },
          "header_name": {
            "type": "string",
            "title": "Header Name",
            "description": "HTTP header name for the credential"
          },
          "prefix": {
            "type": "string",
            "title": "Prefix",
            "description": "Prefix for the credential value",
            "default": ""
          },
          "credential_masked": {
            "type": "string",
            "title": "Credential Masked",
            "description": "Masked credential showing last 6 characters"
          },
          "is_valid": {
            "type": "boolean",
            "title": "Is Valid",
            "description": "Whether connection is valid",
            "default": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "When connection was created"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "When connection was last updated"
          }
        },
        "type": "object",
        "required": [
          "id",
          "server_id",
          "user_id",
          "credential_type",
          "header_name",
          "credential_masked",
          "created_at",
          "updated_at"
        ],
        "title": "CreateUserConnectionResponse",
        "description": "Response schema for created user connection.\n\nReturns the created connection details without exposing the\nactual credential value (which is encrypted at rest).\n\nExample:\n    response = CreateUserConnectionResponse(\n        id=uuid.uuid4(),\n        server_id=uuid.uuid4(),\n        credential_type=\"api_key\",\n        alias=\"My GitHub Token\",\n        header_name=\"Authorization\",\n        credential_masked=\"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022abcdef\",\n        is_valid=True,\n        created_at=datetime.now(UTC),\n    )"
      },
      "CredentialCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "credential_type": {
            "$ref": "#/components/schemas/CredentialType"
          },
          "value": {
            "type": "string",
            "minLength": 1,
            "title": "Value"
          },
          "header_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Name",
            "description": "HTTP header name for this credential (e.g., 'Authorization', 'X-API-Key')"
          },
          "prefix": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 50
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefix",
            "description": "Prefix to prepend to value (e.g., 'Bearer ')"
          },
          "is_required": {
            "type": "boolean",
            "title": "Is Required",
            "description": "Whether this credential is required for server operation",
            "default": false
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Human-readable description of what this credential is for"
          }
        },
        "type": "object",
        "required": [
          "name",
          "credential_type",
          "value"
        ],
        "title": "CredentialCreate",
        "description": "Schema for creating a credential."
      },
      "CredentialListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CredentialResponse"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "CredentialListResponse",
        "description": "Schema for list of credentials."
      },
      "CredentialMode": {
        "type": "string",
        "enum": [
          "managed",
          "user_provided",
          "none"
        ],
        "title": "CredentialMode",
        "description": "How credentials are handled for a server."
      },
      "CredentialRequirement": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Variable/argument/header name"
          },
          "kind": {
            "type": "string",
            "enum": [
              "env_var",
              "cli_arg",
              "header"
            ],
            "title": "Kind",
            "description": "Type of credential requirement"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Human-readable description of the requirement"
          },
          "required": {
            "type": "boolean",
            "title": "Required",
            "description": "Whether this requirement is mandatory"
          },
          "sensitive": {
            "type": "boolean",
            "title": "Sensitive",
            "description": "Whether this value should be treated as a secret"
          },
          "admin_value_set": {
            "type": "boolean",
            "title": "Admin Value Set",
            "description": "Whether admin has already configured this value",
            "default": false
          },
          "example_format": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Example Format",
            "description": "Example of expected format (e.g., 'sk-...')"
          },
          "prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefix",
            "description": "Prefix to prepend to value (e.g., 'Bearer ')"
          },
          "validation_pattern": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validation Pattern",
            "description": "Regex pattern for value validation"
          },
          "help_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Help Url",
            "description": "URL to documentation for obtaining this credential"
          },
          "ai_suggestion_reason": {
            "type": "string",
            "title": "Ai Suggestion Reason",
            "description": "Why AI identified this as a requirement"
          },
          "ai_confidence": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Ai Confidence",
            "description": "AI confidence score (0.0 to 1.0)"
          }
        },
        "type": "object",
        "required": [
          "name",
          "kind",
          "description",
          "required",
          "sensitive",
          "ai_suggestion_reason",
          "ai_confidence"
        ],
        "title": "CredentialRequirement",
        "description": "A single credential/config requirement discovered by AI.\n\nRepresents an environment variable, CLI argument, or header that the\nMCP server requires for operation."
      },
      "CredentialResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "credential_type": {
            "$ref": "#/components/schemas/CredentialType"
          },
          "masked_value": {
            "type": "string",
            "title": "Masked Value"
          },
          "header_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Header Name"
          },
          "prefix": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prefix"
          },
          "is_required": {
            "type": "boolean",
            "title": "Is Required",
            "default": false
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "credential_type",
          "masked_value",
          "created_at"
        ],
        "title": "CredentialResponse",
        "description": "Schema for credential response (value is masked)."
      },
      "CredentialType": {
        "type": "string",
        "enum": [
          "api_key",
          "oauth2",
          "bearer",
          "basic"
        ],
        "title": "CredentialType",
        "description": "Type of stored credential."
      },
      "CredentialTypeEnum": {
        "type": "string",
        "enum": [
          "api_key",
          "bearer",
          "basic"
        ],
        "title": "CredentialTypeEnum",
        "description": "Types of credentials users can provide for connections."
      },
      "CuratedAppActivateResponse": {
        "properties": {
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name"
          },
          "server_status": {
            "type": "string",
            "title": "Server Status",
            "default": "running"
          },
          "oauth_redirect_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oauth Redirect Url"
          },
          "oauth_app_found": {
            "type": "boolean",
            "title": "Oauth App Found",
            "default": true
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": "Server activated successfully"
          }
        },
        "type": "object",
        "required": [
          "server_id",
          "server_name"
        ],
        "title": "CuratedAppActivateResponse",
        "description": "Response from activating a curated app."
      },
      "CuratedAppCategoryResponse": {
        "properties": {
          "category": {
            "type": "string",
            "title": "Category"
          },
          "count": {
            "type": "integer",
            "title": "Count"
          }
        },
        "type": "object",
        "required": [
          "category",
          "count"
        ],
        "title": "CuratedAppCategoryResponse",
        "description": "Category with count."
      },
      "CuratedAppDetail": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "type": {
            "$ref": "#/components/schemas/MCPServerType"
          },
          "credential_mode": {
            "$ref": "#/components/schemas/CredentialMode"
          },
          "auth_type": {
            "type": "string",
            "title": "Auth Type",
            "default": "none"
          },
          "tools_count": {
            "type": "integer",
            "title": "Tools Count",
            "default": 0
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "auth": {
            "additionalProperties": true,
            "type": "object",
            "title": "Auth"
          },
          "config": {
            "additionalProperties": true,
            "type": "object",
            "title": "Config"
          },
          "tools_preview": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Tools Preview"
          },
          "security_pipeline": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Pipeline"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "category",
          "description",
          "icon_url",
          "type",
          "credential_mode"
        ],
        "title": "CuratedAppDetail",
        "description": "Full detail for single-entry view."
      },
      "CuratedAppListItem": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "type": {
            "$ref": "#/components/schemas/MCPServerType"
          },
          "credential_mode": {
            "$ref": "#/components/schemas/CredentialMode"
          },
          "auth_type": {
            "type": "string",
            "title": "Auth Type",
            "default": "none"
          },
          "tools_count": {
            "type": "integer",
            "title": "Tools Count",
            "default": 0
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "category",
          "description",
          "icon_url",
          "type",
          "credential_mode"
        ],
        "title": "CuratedAppListItem",
        "description": "Summary for catalog browsing."
      },
      "CuratedAppListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/CuratedAppListItem"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "has_next": {
            "type": "boolean",
            "title": "Has Next"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "has_next"
        ],
        "title": "CuratedAppListResponse",
        "description": "Paginated list response."
      },
      "CuratedAppUpdate": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Category"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Type"
          },
          "auth": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auth"
          },
          "config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "tools": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools"
          },
          "tools_preview": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools Preview"
          },
          "security_pipeline": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Security Pipeline"
          },
          "credential_mode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Mode"
          },
          "visible": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visible"
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          }
        },
        "type": "object",
        "title": "CuratedAppUpdate",
        "description": "Partial update schema for curated app catalog entries."
      },
      "CuratedTool": {
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]*$",
            "title": "Name",
            "description": "Tool name (snake_case with service prefix, e.g., stripe_list_customers)"
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "title": "Description",
            "description": "Description of what the tool does (under 500 chars)"
          },
          "use_when": {
            "type": "string",
            "title": "Use When",
            "description": "Semantic description starting with 'Use when' to help AI understand when to use this tool"
          },
          "returns": {
            "type": "string",
            "title": "Returns",
            "description": "Description of what the tool returns (starts with 'Returns')"
          },
          "endpoint": {
            "type": "string",
            "title": "Endpoint",
            "description": "API endpoint path (e.g., /v1/customers)"
          },
          "method": {
            "type": "string",
            "title": "Method",
            "description": "HTTP method (GET, POST, PUT, PATCH, DELETE)"
          },
          "scope": {
            "$ref": "#/components/schemas/ToolScope",
            "description": "Tool scope (read, write, destructive)"
          },
          "is_idempotent": {
            "type": "boolean",
            "title": "Is Idempotent",
            "description": "True if calling multiple times has same effect as once (GET, PUT, DELETE are typically idempotent)"
          },
          "parameters": {
            "items": {
              "$ref": "#/components/schemas/ToolParameter"
            },
            "type": "array",
            "title": "Parameters",
            "description": "List of tool parameters with types and descriptions"
          },
          "mcp_annotations": {
            "$ref": "#/components/schemas/MCPAnnotations",
            "description": "MCP annotations for AI client hints"
          },
          "usage_hints": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usage Hints",
            "description": "Workflow dependency hints describing prerequisite tools and what data this tool needs or produces for other tools"
          },
          "include": {
            "type": "boolean",
            "title": "Include",
            "description": "Whether to include this tool in generation (user can toggle)",
            "default": true
          },
          "original_operation_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Original Operation Id",
            "description": "Original OpenAPI operationId if available"
          },
          "input_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Schema",
            "description": "Full JSON Schema Draft-7 inputSchema generated by the LLM. When present, this takes precedence over the flat parameters list for deployment. The parameters list is kept for frontend display."
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "use_when",
          "returns",
          "endpoint",
          "method",
          "scope",
          "is_idempotent"
        ],
        "title": "CuratedTool",
        "description": "AI-first curated tool definition.\n\nTransforms raw API endpoints into AI-friendly tools with:\n- Semantic \"Use when:\" descriptions\n- Scope-based annotations (read/write/destructive)\n- AI-friendly naming with service prefix\n- Comprehensive parameter documentation\n\nExample:\n    CuratedTool(\n        name=\"stripe_list_customers\",\n        description=\"List all customers in your Stripe account\",\n        use_when=(\n            \"Use when you need to retrieve a list of all customers, \"\n            \"optionally filtered by creation date or email\"\n        ),\n        returns=(\n            \"Returns a paginated list of Customer objects \"\n            \"with their IDs, emails, and metadata\"\n        ),\n        endpoint=\"/v1/customers\",\n        method=\"GET\",\n        scope=ToolScope.READ,\n        is_idempotent=True,\n        parameters=[...],\n        mcp_annotations=MCPAnnotations(read_only_hint=True, idempotent_hint=True),\n    )"
      },
      "CursorPaginatedLogsResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ToolCallLogResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "CursorPaginatedLogsResponse",
        "description": "Cursor-paginated response for tool call logs."
      },
      "DashboardCharts": {
        "properties": {
          "calls_over_time": {
            "items": {
              "$ref": "#/components/schemas/HourlyDataPoint"
            },
            "type": "array",
            "title": "Calls Over Time",
            "description": "Tool calls per hour over 24h"
          },
          "success_rate_trend": {
            "$ref": "#/components/schemas/SuccessRateTrend",
            "description": "Hourly success rate trend"
          },
          "latency_percentiles": {
            "$ref": "#/components/schemas/LatencyPercentiles",
            "description": "Latency distribution over time"
          },
          "server_load": {
            "items": {
              "$ref": "#/components/schemas/ServerLoadItem"
            },
            "type": "array",
            "title": "Server Load",
            "description": "Load distribution by server"
          },
          "errors_by_tool": {
            "items": {
              "$ref": "#/components/schemas/ErrorRateByTool"
            },
            "type": "array",
            "title": "Errors By Tool",
            "description": "Top tools by error count"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At",
            "description": "When chart data was generated (UTC)"
          }
        },
        "type": "object",
        "required": [
          "success_rate_trend",
          "latency_percentiles",
          "generated_at"
        ],
        "title": "DashboardCharts",
        "description": "Chart data for the analytics (Command) dashboard view.\n\nProvides time-series data optimized for visualization."
      },
      "DashboardHealth": {
        "properties": {
          "database": {
            "$ref": "#/components/schemas/HealthStatus",
            "description": "Database health status"
          },
          "gateway": {
            "$ref": "#/components/schemas/HealthStatus",
            "description": "Gateway service health status"
          },
          "ai_provider": {
            "$ref": "#/components/schemas/HealthStatus",
            "description": "AI provider health status"
          }
        },
        "type": "object",
        "required": [
          "database",
          "gateway",
          "ai_provider"
        ],
        "title": "DashboardHealth",
        "description": "Health status for all system components."
      },
      "DashboardResponse": {
        "properties": {
          "stats": {
            "$ref": "#/components/schemas/DashboardStats",
            "description": "Summary statistics"
          },
          "health": {
            "$ref": "#/components/schemas/DashboardHealth",
            "description": "System health status"
          },
          "activity": {
            "items": {
              "$ref": "#/components/schemas/ActivityItem"
            },
            "type": "array",
            "title": "Activity",
            "description": "Recent activity feed"
          },
          "top_servers": {
            "items": {
              "$ref": "#/components/schemas/TopServer"
            },
            "type": "array",
            "title": "Top Servers",
            "description": "Most used servers by call count"
          },
          "top_tools": {
            "items": {
              "$ref": "#/components/schemas/TopTool"
            },
            "type": "array",
            "title": "Top Tools",
            "description": "Most used tools in last 24h"
          },
          "top_skills": {
            "items": {
              "$ref": "#/components/schemas/TopSkill"
            },
            "type": "array",
            "title": "Top Skills",
            "description": "Most used/downloaded skills"
          },
          "recent_audit": {
            "items": {
              "$ref": "#/components/schemas/RecentAuditItem"
            },
            "type": "array",
            "title": "Recent Audit",
            "description": "Recent tool call audit log"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Generated At",
            "description": "When this dashboard data was generated (UTC)"
          }
        },
        "type": "object",
        "required": [
          "stats",
          "health",
          "generated_at"
        ],
        "title": "DashboardResponse",
        "description": "Complete dashboard data response."
      },
      "DashboardStats": {
        "properties": {
          "servers_count": {
            "type": "integer",
            "title": "Servers Count",
            "description": "Total number of MCP servers"
          },
          "servers_added_this_week": {
            "type": "integer",
            "title": "Servers Added This Week",
            "description": "Servers added in the last 7 days"
          },
          "skills_count": {
            "type": "integer",
            "title": "Skills Count",
            "description": "Total number of skills"
          },
          "skills_by_source": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Skills By Source",
            "description": "Skills count grouped by source type"
          },
          "tool_calls_today": {
            "type": "integer",
            "title": "Tool Calls Today",
            "description": "Total tool calls in the last 24 hours"
          },
          "tool_calls_trend": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "title": "Tool Calls Trend",
            "description": "Hourly tool call counts for the last 24 hours (oldest first)"
          },
          "active_users_24h": {
            "type": "integer",
            "title": "Active Users 24H",
            "description": "Users active in the last 24 hours"
          },
          "total_users": {
            "type": "integer",
            "title": "Total Users",
            "description": "Total registered users"
          }
        },
        "type": "object",
        "required": [
          "servers_count",
          "servers_added_this_week",
          "skills_count",
          "tool_calls_today",
          "active_users_24h",
          "total_users"
        ],
        "title": "DashboardStats",
        "description": "Summary statistics for the dashboard."
      },
      "DeactivateResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "description": "Whether deactivation was successful"
          },
          "api_keys_deactivated": {
            "type": "integer",
            "title": "Api Keys Deactivated",
            "description": "Number of API keys that were deactivated",
            "default": 0
          },
          "sessions_invalidated": {
            "type": "integer",
            "title": "Sessions Invalidated",
            "description": "Number of sessions that were invalidated",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "success"
        ],
        "title": "DeactivateResponse",
        "description": "Schema for response after deactivating a user."
      },
      "DeployedServerInfo": {
        "properties": {
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id",
            "description": "Server UUID"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Server name"
          },
          "mcp_endpoint": {
            "type": "string",
            "title": "Mcp Endpoint",
            "description": "MCP endpoint path"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count",
            "description": "Number of tools"
          }
        },
        "type": "object",
        "required": [
          "server_id",
          "server_name",
          "mcp_endpoint",
          "tool_count"
        ],
        "title": "DeployedServerInfo",
        "description": "Information about a deployed MCP server."
      },
      "DetailedHealthResponse": {
        "properties": {
          "total_connections": {
            "type": "integer",
            "title": "Total Connections",
            "description": "Total number of connections",
            "default": 0
          },
          "healthy": {
            "type": "integer",
            "title": "Healthy",
            "description": "Connections in HEALTHY status",
            "default": 0
          },
          "warning": {
            "type": "integer",
            "title": "Warning",
            "description": "Connections in WARNING status",
            "default": 0
          },
          "critical": {
            "type": "integer",
            "title": "Critical",
            "description": "Connections in CRITICAL status",
            "default": 0
          },
          "expired": {
            "type": "integer",
            "title": "Expired",
            "description": "Connections in EXPIRED status",
            "default": 0
          },
          "auto_refresh_active": {
            "type": "integer",
            "title": "Auto Refresh Active",
            "description": "Connections with auto-refresh working",
            "default": 0
          },
          "require_reauth": {
            "type": "integer",
            "title": "Require Reauth",
            "description": "Connections requiring re-authentication",
            "default": 0
          },
          "expiring_within_24h": {
            "type": "integer",
            "title": "Expiring Within 24H",
            "description": "Connections expiring within 24 hours",
            "default": 0
          },
          "connections": {
            "items": {
              "$ref": "#/components/schemas/ConnectionHealthResponse"
            },
            "type": "array",
            "title": "Connections"
          }
        },
        "type": "object",
        "required": [
          "connections"
        ],
        "title": "DetailedHealthResponse",
        "description": "Schema for detailed connection health with expiration tracking.\n\nThis extends ConnectionHealthSummary with more granular expiration\nstatus information from CredentialExpirationService.\n\nExample:\n    response = DetailedHealthResponse(\n        total_connections=10,\n        healthy=7,\n        warning=2,\n        critical=1,\n        expired=0,\n        auto_refresh_active=3,\n        require_reauth=1,\n        expiring_within_24h=2,\n        connections=[...],\n    )"
      },
      "EnrichedError": {
        "properties": {
          "category": {
            "$ref": "#/components/schemas/ErrorCategory"
          },
          "raw_message": {
            "type": "string",
            "title": "Raw Message"
          },
          "user_message": {
            "type": "string",
            "title": "User Message"
          },
          "action_type": {
            "$ref": "#/components/schemas/ActionType",
            "default": "none"
          },
          "action_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Action Label"
          },
          "action_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Action Url"
          },
          "action_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Action Data"
          },
          "extracted_values": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Extracted Values"
          }
        },
        "type": "object",
        "required": [
          "category",
          "raw_message",
          "user_message"
        ],
        "title": "EnrichedError",
        "description": "Enriched error with classification and actionable guidance.\n\nAttributes:\n    category: The error category for grouping similar errors.\n    raw_message: The original error message from the system.\n    user_message: A user-friendly explanation of the error.\n    action_type: The type of action that can fix this error.\n    action_label: Button text for the action (e.g., \"Fix Now\").\n    action_url: URL to navigate to (for add_credentials).\n    action_data: Data for the action (e.g., suggested config fix).\n    extracted_values: Values extracted from the error (e.g., expected env vars)."
      },
      "ErrorCategory": {
        "type": "string",
        "enum": [
          "package_not_found",
          "missing_credentials",
          "auth_failed",
          "connection_failed",
          "timeout",
          "container_not_found",
          "python_package_not_found",
          "server_compatibility",
          "unknown"
        ],
        "title": "ErrorCategory",
        "description": "Categories of MCP server errors."
      },
      "ErrorDetail": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "code",
          "message"
        ],
        "title": "ErrorDetail",
        "description": "Detail of an API error with machine-readable code and human message."
      },
      "ErrorRateByTool": {
        "properties": {
          "tool_name": {
            "type": "string",
            "title": "Tool Name",
            "description": "Tool name"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Server name"
          },
          "error_count": {
            "type": "integer",
            "title": "Error Count",
            "description": "Number of errors in period"
          },
          "total_count": {
            "type": "integer",
            "title": "Total Count",
            "description": "Total calls in period"
          },
          "error_rate": {
            "type": "number",
            "title": "Error Rate",
            "description": "Error rate percentage (0-100)"
          }
        },
        "type": "object",
        "required": [
          "tool_name",
          "server_name",
          "error_count",
          "total_count",
          "error_rate"
        ],
        "title": "ErrorRateByTool",
        "description": "Error rate breakdown by tool."
      },
      "ErrorResponse": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "ErrorResponse",
        "description": "Standard error response envelope.\n\nExample:\n    {\"error\": {\"code\": \"NOT_FOUND\", \"message\": \"Server with ID '...' not found\"}}"
      },
      "ExistingConnectionSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "Connection UUID"
          },
          "credential_type": {
            "type": "string",
            "title": "Credential Type",
            "description": "Type of credential: oauth, api_key, bearer, or basic"
          },
          "provider_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Name",
            "description": "OAuth provider name if OAuth connection (github, google, etc.)"
          },
          "is_valid": {
            "type": "boolean",
            "title": "Is Valid",
            "description": "Whether the connection is currently valid",
            "default": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "When the connection was created"
          }
        },
        "type": "object",
        "required": [
          "id",
          "credential_type",
          "created_at"
        ],
        "title": "ExistingConnectionSummary",
        "description": "Summary of an existing user connection to a server.\n\nUsed in connection options to show what credentials the user\nalready has configured for a server.\n\nExample:\n    summary = ExistingConnectionSummary(\n        id=uuid.uuid4(),\n        credential_type=\"oauth\",\n        provider_name=\"github\",\n        is_valid=True,\n        created_at=datetime.now(UTC),\n    )"
      },
      "ExpirationStatus": {
        "type": "string",
        "enum": [
          "healthy",
          "auto_refresh_active",
          "warning",
          "critical",
          "expired"
        ],
        "title": "ExpirationStatus",
        "description": "Token expiration status levels.\n\nStatus progression:\n- HEALTHY: Token is valid and not near expiry\n- AUTO_REFRESH_ACTIVE: Token expiring but auto-refresh is enabled\n- WARNING: Less than 24 hours until expiry\n- CRITICAL: Less than 1 hour until expiry\n- EXPIRED: Token has expired"
      },
      "ExpiringConnectionResponse": {
        "properties": {
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "title": "Connection Id",
            "description": "Connection UUID"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id",
            "description": "Associated MCP server UUID"
          },
          "server_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Name",
            "description": "Server display name"
          },
          "provider_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Name",
            "description": "OAuth provider name (github, google, etc.)"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At",
            "description": "Token expiration timestamp"
          },
          "expires_in_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Seconds",
            "description": "Seconds until token expires (negative if expired)"
          },
          "expiration_status": {
            "$ref": "#/components/schemas/ExpirationStatus",
            "description": "Current expiration status"
          },
          "auto_refresh_enabled": {
            "type": "boolean",
            "title": "Auto Refresh Enabled",
            "description": "Whether auto-refresh is enabled and working",
            "default": false
          },
          "requires_action": {
            "type": "boolean",
            "title": "Requires Action",
            "description": "True if user action is required (no auto-refresh or failing)",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "connection_id",
          "server_id",
          "expiration_status"
        ],
        "title": "ExpiringConnectionResponse",
        "description": "Schema for a connection that is expiring soon.\n\nUsed by the /connections/expiring endpoint to list credentials\nthat need attention.\n\nExample:\n    expiring = ExpiringConnectionResponse(\n        connection_id=uuid.uuid4(),\n        server_id=server.id,\n        server_name=\"GitHub\",\n        provider_name=\"github\",\n        expires_at=datetime.now(UTC) + timedelta(hours=12),\n        expires_in_seconds=43200,\n        expiration_status=ExpirationStatus.WARNING,\n        auto_refresh_enabled=True,\n        requires_action=False,  # Auto-refresh will handle it\n    )"
      },
      "ExpiringConnectionsResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ExpiringConnectionResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total number of expiring connections"
          },
          "action_required": {
            "type": "integer",
            "title": "Action Required",
            "description": "Count of connections requiring user action",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "ExpiringConnectionsResponse",
        "description": "Schema for list of expiring connections.\n\nExample:\n    response = ExpiringConnectionsResponse(\n        items=[...],\n        total=5,\n        action_required=2,  # 2 need manual attention\n    )"
      },
      "ExposureMode": {
        "type": "string",
        "enum": [
          "all",
          "raw",
          "script_only"
        ],
        "title": "ExposureMode",
        "description": "Which tool types are visible to agents on a server."
      },
      "FileChange": {
        "properties": {
          "path": {
            "type": "string",
            "title": "Path"
          },
          "action": {
            "type": "string",
            "title": "Action"
          },
          "size_bytes": {
            "type": "integer",
            "title": "Size Bytes",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "path",
          "action"
        ],
        "title": "FileChange",
        "description": "A file that was created, modified, or deleted during execution."
      },
      "GatewayMode": {
        "type": "string",
        "enum": [
          "auto",
          "list",
          "search_execute"
        ],
        "title": "GatewayMode",
        "description": "Gateway interface mode options.\n\nAUTO: Switch mode based on tool count vs threshold\nLIST: Always return all tool definitions\nSEARCH_EXECUTE: Always return SEARCH_TOOLS + EXECUTE_TOOL meta-tools"
      },
      "GatewaySettingsResponse": {
        "properties": {
          "default_mode": {
            "type": "string",
            "title": "Default Mode",
            "description": "Gateway mode: 'auto', 'list', or 'search_execute'"
          },
          "auto_threshold": {
            "type": "integer",
            "title": "Auto Threshold",
            "description": "Tool count threshold for auto mode switching (1-1000)"
          },
          "search_results_limit": {
            "type": "integer",
            "title": "Search Results Limit",
            "description": "Max results returned by SEARCH_TOOLS (1-20)"
          }
        },
        "type": "object",
        "required": [
          "default_mode",
          "auto_threshold",
          "search_results_limit"
        ],
        "title": "GatewaySettingsResponse",
        "description": "Response schema for gateway settings."
      },
      "GatewaySettingsUpdate": {
        "properties": {
          "default_mode": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GatewayMode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Gateway mode: 'auto', 'list', or 'search_execute'"
          },
          "auto_threshold": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Auto Threshold",
            "description": "Tool count threshold for auto mode switching (1-1000)"
          },
          "search_results_limit": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 20.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Search Results Limit",
            "description": "Max results returned by SEARCH_TOOLS (1-20)"
          }
        },
        "type": "object",
        "title": "GatewaySettingsUpdate",
        "description": "Request schema for updating gateway settings.\n\nBoth fields are optional - supports partial updates."
      },
      "GeneralSettingsResponse": {
        "properties": {
          "log_retention_days": {
            "type": "integer",
            "maximum": 3650.0,
            "minimum": 1.0,
            "title": "Log Retention Days",
            "description": "Number of days to retain tool call logs (1-3650)",
            "default": 90
          }
        },
        "type": "object",
        "title": "GeneralSettingsResponse",
        "description": "Response schema for general application settings.\n\nFor AI provider configuration, use /settings/providers endpoints."
      },
      "GeneralSettingsUpdate": {
        "properties": {
          "log_retention_days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 3650.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Log Retention Days",
            "description": "Number of days to retain tool call logs (1-3650)"
          }
        },
        "type": "object",
        "title": "GeneralSettingsUpdate",
        "description": "Update schema for general application settings."
      },
      "GenerateRequest": {
        "properties": {
          "input_type": {
            "type": "string",
            "enum": [
              "openapi_json",
              "openapi_yaml",
              "swagger_url",
              "docs_url",
              "raw_text",
              "url",
              "text"
            ],
            "title": "Input Type",
            "description": "Type of input content"
          },
          "input_content": {
            "type": "string",
            "minLength": 1,
            "title": "Input Content",
            "description": "Input content (spec, URL, or text)"
          },
          "server_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Name",
            "description": "Name for generated server (auto-generated if not provided)"
          },
          "auth_type": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "none",
                  "api_key",
                  "bearer",
                  "oauth2"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Auth Type",
            "description": "Authentication type override"
          },
          "api_credentials": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Credentials",
            "description": "HTTP headers for API authentication. When provided, the generator calls safe read-only endpoints to verify response shapes and enrich tool schemas. Example: {\"Authorization\": \"Bearer xxx\"}"
          }
        },
        "type": "object",
        "required": [
          "input_type",
          "input_content"
        ],
        "title": "GenerateRequest",
        "description": "Request to start a generation job."
      },
      "GenerateSkillRequest": {
        "properties": {
          "intent": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 10,
            "title": "Intent",
            "description": "What the skill should help with"
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "Optional skill name"
          },
          "mcp_server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Id",
            "description": "Optional associated MCP server"
          },
          "context": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 5000
              },
              {
                "type": "null"
              }
            ],
            "title": "Context",
            "description": "Additional context"
          }
        },
        "type": "object",
        "required": [
          "intent"
        ],
        "title": "GenerateSkillRequest",
        "description": "Request to generate a skill."
      },
      "GenerationJobCreateResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "Created job UUID"
          },
          "status": {
            "$ref": "#/components/schemas/GenerationJobStatus",
            "description": "Initial job status",
            "default": "pending"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Name of the server being generated"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Status message",
            "default": "Generation job created"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "server_name"
        ],
        "title": "GenerationJobCreateResponse",
        "description": "Response when a generation job is created."
      },
      "GenerationJobListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/GenerationStatusResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "GenerationJobListResponse",
        "description": "Response for listing generation jobs."
      },
      "GenerationJobStatus": {
        "type": "string",
        "enum": [
          "pending",
          "analyzing",
          "generating",
          "reviewing",
          "approved",
          "deployed",
          "failed",
          "cancelled"
        ],
        "title": "GenerationJobStatus",
        "description": "Status of an MCP server generation job."
      },
      "GenerationPhase": {
        "type": "string",
        "enum": [
          "analysis",
          "generation",
          "review"
        ],
        "title": "GenerationPhase",
        "description": "Current phase of the generation pipeline."
      },
      "GenerationStatusResponse": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id",
            "description": "Job UUID"
          },
          "status": {
            "$ref": "#/components/schemas/GenerationJobStatus",
            "description": "Current job status"
          },
          "current_phase": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/GenerationPhase"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current pipeline phase"
          },
          "progress_percent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress Percent",
            "description": "Progress percentage (0-100)"
          },
          "progress_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Progress Message",
            "description": "Human-readable progress"
          },
          "tools_completed": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools Completed",
            "description": "Number of tools generated"
          },
          "tools_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools Total",
            "description": "Total tools to generate"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Name of the server being generated"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message",
            "description": "Error message if failed"
          },
          "reasoning_log": {
            "items": {
              "$ref": "#/components/schemas/ReasoningMessage"
            },
            "type": "array",
            "title": "Reasoning Log",
            "description": "Agent reasoning messages log"
          },
          "mcp_server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Id",
            "description": "ID of deployed MCP server (if deployed)"
          },
          "deployed_server": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DeployedServerInfo"
              },
              {
                "type": "null"
              }
            ],
            "description": "Deployed server info (if deployed)"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Job creation timestamp"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "Last update timestamp"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At",
            "description": "Completion timestamp"
          }
        },
        "type": "object",
        "required": [
          "job_id",
          "status",
          "server_name",
          "created_at",
          "updated_at"
        ],
        "title": "GenerationStatusResponse",
        "description": "Response for generation job status."
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HealthCheckResponse": {
        "properties": {
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name"
          },
          "previous_status": {
            "$ref": "#/components/schemas/MCPServerStatus"
          },
          "current_status": {
            "$ref": "#/components/schemas/MCPServerStatus"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "title": "Checked At"
          }
        },
        "type": "object",
        "required": [
          "server_id",
          "server_name",
          "previous_status",
          "current_status",
          "message",
          "checked_at"
        ],
        "title": "HealthCheckResponse",
        "description": "Response schema for server health check."
      },
      "HealthStatus": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "healthy",
              "degraded",
              "error",
              "unconfigured"
            ],
            "title": "Status",
            "description": "Current health status"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms",
            "description": "Last measured latency in milliseconds"
          },
          "uptime_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Uptime Seconds",
            "description": "Component uptime in seconds"
          },
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider",
            "description": "Provider name (e.g., 'openai', 'anthropic')"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "HealthStatus",
        "description": "Health status for a single system component."
      },
      "HourlyDataPoint": {
        "properties": {
          "hour": {
            "type": "string",
            "title": "Hour",
            "description": "Hour label (e.g., '14:00' or 'now')"
          },
          "value": {
            "type": "number",
            "title": "Value",
            "description": "Numeric value for this hour"
          }
        },
        "type": "object",
        "required": [
          "hour",
          "value"
        ],
        "title": "HourlyDataPoint",
        "description": "A single data point for hourly time series charts."
      },
      "ImportPreview": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Name that will be assigned to the imported server"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Display name for the imported server"
          },
          "server_type": {
            "$ref": "#/components/schemas/MCPServerType",
            "description": "Type of MCP server that will be created"
          },
          "config_preview": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                }
              ]
            },
            "type": "object",
            "title": "Config Preview",
            "description": "Preview of the server configuration that will be applied"
          },
          "required_env": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required Env",
            "description": "Environment variables that must be provided"
          },
          "required_args": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Required Args",
            "description": "Command-line arguments that must be provided"
          }
        },
        "type": "object",
        "required": [
          "name",
          "display_name",
          "server_type",
          "config_preview"
        ],
        "title": "ImportPreview",
        "description": "Preview of what will be created when importing a catalog server.\n\nShows the user exactly what MCP server configuration will be\ncreated before they confirm the import."
      },
      "InitiateServerOAuthRequest": {
        "properties": {
          "oauth_app_id": {
            "type": "string",
            "format": "uuid",
            "title": "Oauth App Id",
            "description": "ID of the OAuth app to use for authentication"
          },
          "redirect_uri": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Redirect Uri",
            "description": "Where to redirect after OAuth completes. Defaults to /servers"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes",
            "description": "Override default scopes (optional)"
          }
        },
        "type": "object",
        "required": [
          "oauth_app_id"
        ],
        "title": "InitiateServerOAuthRequest",
        "description": "Request to initiate OAuth flow for an MCP server."
      },
      "InitiateServerOAuthResponse": {
        "properties": {
          "authorization_url": {
            "type": "string",
            "title": "Authorization Url",
            "description": "URL to redirect user to for OAuth authorization"
          },
          "state": {
            "type": "string",
            "title": "State",
            "description": "State parameter for CSRF protection"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In",
            "description": "Seconds until state expires",
            "default": 600
          }
        },
        "type": "object",
        "required": [
          "authorization_url",
          "state"
        ],
        "title": "InitiateServerOAuthResponse",
        "description": "Response with OAuth authorization URL."
      },
      "InvitationAcceptInfo": {
        "properties": {
          "email": {
            "type": "string",
            "title": "Email",
            "description": "Email address the invitation was sent to"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "description": "Role that will be assigned"
          },
          "invited_by_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invited By Name",
            "description": "Name of the person who sent the invitation"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At",
            "description": "When the invitation expires"
          },
          "available_providers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Available Providers",
            "description": "List of OAuth providers available for sign-up (e.g., ['google', 'github'])"
          }
        },
        "type": "object",
        "required": [
          "email",
          "role",
          "expires_at"
        ],
        "title": "InvitationAcceptInfo",
        "description": "Schema for public invitation info on the accept page.\n\nThis is shown to unauthenticated users when they visit the invite link.\nDoes not include sensitive information."
      },
      "InvitationCreate": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email",
            "description": "Email address to invite"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole",
            "description": "Role to assign when user accepts",
            "default": "member"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "InvitationCreate",
        "description": "Schema for creating a user invitation."
      },
      "InvitationCreated": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "Unique identifier"
          },
          "email": {
            "type": "string",
            "title": "Email",
            "description": "Invited email address"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "description": "Role to be assigned"
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus",
            "description": "Current invitation status"
          },
          "invited_by_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invited By Name",
            "description": "Name of the user who sent the invitation"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At",
            "description": "When the invitation expires"
          },
          "is_expired": {
            "type": "boolean",
            "title": "Is Expired",
            "description": "Whether the invitation has expired"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "When the invitation was created"
          },
          "invite_url": {
            "type": "string",
            "title": "Invite Url",
            "description": "One-time URL for accepting the invitation (shown only once)"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "status",
          "expires_at",
          "is_expired",
          "created_at",
          "invite_url"
        ],
        "title": "InvitationCreated",
        "description": "Schema for response after creating an invitation.\n\nExtends InvitationResponse with the invite URL (only shown once)."
      },
      "InvitationListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/InvitationResponse"
            },
            "type": "array",
            "title": "Items",
            "description": "List of invitations"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total number of invitations matching criteria"
          }
        },
        "type": "object",
        "required": [
          "total"
        ],
        "title": "InvitationListResponse",
        "description": "Schema for paginated invitation list response."
      },
      "InvitationResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "Unique identifier"
          },
          "email": {
            "type": "string",
            "title": "Email",
            "description": "Invited email address"
          },
          "role": {
            "type": "string",
            "title": "Role",
            "description": "Role to be assigned"
          },
          "status": {
            "$ref": "#/components/schemas/InvitationStatus",
            "description": "Current invitation status"
          },
          "invited_by_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Invited By Name",
            "description": "Name of the user who sent the invitation"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At",
            "description": "When the invitation expires"
          },
          "is_expired": {
            "type": "boolean",
            "title": "Is Expired",
            "description": "Whether the invitation has expired"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "When the invitation was created"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "status",
          "expires_at",
          "is_expired",
          "created_at"
        ],
        "title": "InvitationResponse",
        "description": "Schema for invitation response (admin view)."
      },
      "InvitationStatus": {
        "type": "string",
        "enum": [
          "pending",
          "accepted",
          "revoked"
        ],
        "title": "InvitationStatus",
        "description": "Status of a user invitation."
      },
      "LLMStatusResponse": {
        "properties": {
          "configured": {
            "type": "boolean",
            "title": "Configured",
            "description": "Whether an LLM provider is configured"
          },
          "model": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model",
            "description": "Model name if configured"
          }
        },
        "type": "object",
        "required": [
          "configured"
        ],
        "title": "LLMStatusResponse",
        "description": "Response for portal LLM configuration status check."
      },
      "LatencyBucket": {
        "properties": {
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "p50": {
            "type": "number",
            "title": "P50"
          },
          "p90": {
            "type": "number",
            "title": "P90"
          },
          "p95": {
            "type": "number",
            "title": "P95"
          },
          "p99": {
            "type": "number",
            "title": "P99"
          },
          "sample_count": {
            "type": "integer",
            "title": "Sample Count"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "p50",
          "p90",
          "p95",
          "p99",
          "sample_count"
        ],
        "title": "LatencyBucket",
        "description": "Latency percentile data for a single time bucket."
      },
      "LatencyPercentiles": {
        "properties": {
          "p50": {
            "items": {
              "$ref": "#/components/schemas/HourlyDataPoint"
            },
            "type": "array",
            "title": "P50",
            "description": "Median (50th percentile) latency per hour"
          },
          "p95": {
            "items": {
              "$ref": "#/components/schemas/HourlyDataPoint"
            },
            "type": "array",
            "title": "P95",
            "description": "95th percentile latency per hour"
          },
          "p99": {
            "items": {
              "$ref": "#/components/schemas/HourlyDataPoint"
            },
            "type": "array",
            "title": "P99",
            "description": "99th percentile latency per hour"
          },
          "current_p50": {
            "type": "number",
            "title": "Current P50",
            "description": "Current hour median latency"
          },
          "current_p95": {
            "type": "number",
            "title": "Current P95",
            "description": "Current hour p95 latency"
          },
          "current_p99": {
            "type": "number",
            "title": "Current P99",
            "description": "Current hour p99 latency"
          }
        },
        "type": "object",
        "required": [
          "current_p50",
          "current_p95",
          "current_p99"
        ],
        "title": "LatencyPercentiles",
        "description": "Latency percentile data for a time period."
      },
      "LatencyPercentilesResponse": {
        "properties": {
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/LatencyBucket"
            },
            "type": "array",
            "title": "Buckets"
          },
          "summary": {
            "$ref": "#/components/schemas/LatencySummary"
          }
        },
        "type": "object",
        "required": [
          "buckets",
          "summary"
        ],
        "title": "LatencyPercentilesResponse",
        "description": "Response for latency percentiles over time."
      },
      "LatencySummary": {
        "properties": {
          "p50": {
            "type": "number",
            "title": "P50"
          },
          "p90": {
            "type": "number",
            "title": "P90"
          },
          "p95": {
            "type": "number",
            "title": "P95"
          },
          "p99": {
            "type": "number",
            "title": "P99"
          },
          "total_requests": {
            "type": "integer",
            "title": "Total Requests"
          },
          "avg_latency": {
            "type": "number",
            "title": "Avg Latency"
          }
        },
        "type": "object",
        "required": [
          "p50",
          "p90",
          "p95",
          "p99",
          "total_requests",
          "avg_latency"
        ],
        "title": "LatencySummary",
        "description": "Overall latency statistics summary."
      },
      "LocalToolCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "description": {
            "type": "string",
            "maxLength": 10000,
            "minLength": 1,
            "title": "Description"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          }
        },
        "type": "object",
        "required": [
          "name",
          "description"
        ],
        "title": "LocalToolCreate",
        "description": "Schema for creating a tool on a LOCAL server."
      },
      "LocalToolUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10000,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "input_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Schema"
          }
        },
        "type": "object",
        "title": "LocalToolUpdate",
        "description": "Schema for partial update of a tool on a LOCAL server.\n\nAll fields optional. Uses model_fields_set to distinguish\n'field omitted' from 'field explicitly provided'.\nExplicitly sending null for name or description is rejected\nsince those are non-nullable DB columns."
      },
      "LogCleanupPreviewResponse": {
        "properties": {
          "retention_days": {
            "type": "integer",
            "title": "Retention Days",
            "description": "Retention period in days"
          },
          "cutoff_date": {
            "type": "string",
            "format": "date-time",
            "title": "Cutoff Date",
            "description": "Logs older than this will be deleted"
          },
          "mcp_tool_call_logs": {
            "type": "integer",
            "title": "Mcp Tool Call Logs",
            "description": "Tool call logs to be deleted"
          },
          "token_usage_logs": {
            "type": "integer",
            "title": "Token Usage Logs",
            "description": "Token usage logs to be deleted"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total records to be deleted",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "retention_days",
          "cutoff_date",
          "mcp_tool_call_logs",
          "token_usage_logs"
        ],
        "title": "LogCleanupPreviewResponse",
        "description": "Preview of how many logs would be deleted."
      },
      "LogCleanupResponse": {
        "properties": {
          "mcp_tool_call_logs": {
            "type": "integer",
            "title": "Mcp Tool Call Logs",
            "description": "Tool call logs deleted"
          },
          "token_usage_logs": {
            "type": "integer",
            "title": "Token Usage Logs",
            "description": "Token usage logs deleted"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total records deleted",
            "default": 0
          },
          "retention_days": {
            "type": "integer",
            "title": "Retention Days",
            "description": "Retention period used"
          }
        },
        "type": "object",
        "required": [
          "mcp_tool_call_logs",
          "token_usage_logs",
          "retention_days"
        ],
        "title": "LogCleanupResponse",
        "description": "Response after cleaning up old logs."
      },
      "LogStatsResponse": {
        "properties": {
          "mcp_tool_call_logs": {
            "type": "integer",
            "title": "Mcp Tool Call Logs",
            "description": "Number of tool call log records"
          },
          "token_usage_logs": {
            "type": "integer",
            "title": "Token Usage Logs",
            "description": "Number of token usage log records"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total log records",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "mcp_tool_call_logs",
          "token_usage_logs"
        ],
        "title": "LogStatsResponse",
        "description": "Response schema for log table statistics."
      },
      "MCPAnnotations": {
        "properties": {
          "readOnlyHint": {
            "type": "boolean",
            "title": "Readonlyhint",
            "description": "True if tool only reads data (no side effects)",
            "default": false
          },
          "destructiveHint": {
            "type": "boolean",
            "title": "Destructivehint",
            "description": "True if tool deletes/destroys data",
            "default": false
          },
          "idempotentHint": {
            "type": "boolean",
            "title": "Idempotenthint",
            "description": "True if calling multiple times has same effect as once",
            "default": false
          },
          "openWorldHint": {
            "type": "boolean",
            "title": "Openworldhint",
            "description": "True if tool may interact with external world",
            "default": true
          }
        },
        "type": "object",
        "title": "MCPAnnotations",
        "description": "MCP tool annotations for AI clients.\n\nThese hints help AI clients understand tool behavior and make better\ndecisions about when to use them."
      },
      "MCPBundleCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id",
            "description": "Optional external agent identifier"
          },
          "tools": {
            "items": {
              "$ref": "#/components/schemas/BundleToolCreate"
            },
            "type": "array",
            "title": "Tools",
            "description": "Initial tools to include in the bundle"
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "MCPBundleCreate",
        "description": "Schema for creating a bundle."
      },
      "MCPBundleDetailResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "bundle_key": {
            "type": "string",
            "title": "Bundle Key",
            "description": "Opaque sharing key (only shown to bundle creator)"
          },
          "tools": {
            "items": {
              "$ref": "#/components/schemas/BundleToolResponse"
            },
            "type": "array",
            "title": "Tools"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "tool_count",
          "created_at",
          "updated_at",
          "bundle_key",
          "tools"
        ],
        "title": "MCPBundleDetailResponse",
        "description": "Schema for detailed bundle response including tools."
      },
      "MCPBundleListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MCPBundleResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "MCPBundleListResponse",
        "description": "Schema for paginated list of bundles."
      },
      "MCPBundleResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "tool_count",
          "created_at",
          "updated_at"
        ],
        "title": "MCPBundleResponse",
        "description": "Schema for bundle response (without bundle_key for non-creators)."
      },
      "MCPBundleUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          }
        },
        "type": "object",
        "title": "MCPBundleUpdate",
        "description": "Schema for updating a bundle.\n\nUses model_fields_set to distinguish \"set agent_id to null\" from\n\"field not provided\" \u2014 same pattern as tool PATCH in Phase 2."
      },
      "MCPBundleWithKeyResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "bundle_key": {
            "type": "string",
            "title": "Bundle Key",
            "description": "Opaque sharing key (only shown to bundle creator)"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "tool_count",
          "created_at",
          "updated_at",
          "bundle_key"
        ],
        "title": "MCPBundleWithKeyResponse",
        "description": "Schema for bundle response with bundle_key (for creators only)."
      },
      "MCPServerCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Display Name"
          },
          "type": {
            "$ref": "#/components/schemas/MCPServerType"
          },
          "config": {
            "additionalProperties": true,
            "type": "object",
            "title": "Config"
          },
          "source_doc_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Doc Url"
          },
          "credential_mode": {
            "$ref": "#/components/schemas/CredentialMode",
            "description": "How credentials are handled: managed, user_provided, or none",
            "default": "none"
          },
          "auth_method": {
            "$ref": "#/components/schemas/AuthMethod",
            "description": "Authentication method: none, bearer, or oauth2",
            "default": "none"
          },
          "initial_bearer_token": {
            "anyOf": [
              {
                "type": "string",
                "format": "password",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "title": "Initial Bearer Token",
            "description": "Initial bearer token for platform connections (never logged)"
          },
          "portal_visible": {
            "type": "boolean",
            "title": "Portal Visible",
            "description": "Visible in customer portal",
            "default": false
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category",
            "description": "Portal category"
          },
          "portal_tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Portal Tags",
            "description": "Portal tags"
          },
          "exposure_mode": {
            "$ref": "#/components/schemas/ExposureMode",
            "description": "Tool exposure mode: 'all', 'raw', or 'script_only'",
            "default": "all"
          }
        },
        "type": "object",
        "required": [
          "name",
          "display_name",
          "type"
        ],
        "title": "MCPServerCreate",
        "description": "Schema for creating an MCP server."
      },
      "MCPServerListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/MCPServerResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          },
          "status_counts": {
            "$ref": "#/components/schemas/StatusCounts"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size",
          "status_counts"
        ],
        "title": "MCPServerListResponse",
        "description": "Schema for paginated list of MCP servers."
      },
      "MCPServerResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "type": {
            "$ref": "#/components/schemas/MCPServerType"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MCPServerStatus"
              },
              {
                "type": "string"
              }
            ],
            "title": "Status"
          },
          "config": {
            "additionalProperties": true,
            "type": "object",
            "title": "Config"
          },
          "source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ServerSource"
              },
              {
                "type": "string"
              }
            ],
            "title": "Source"
          },
          "source_doc_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Doc Url"
          },
          "sync_schedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SyncSchedule"
              },
              {
                "type": "null"
              }
            ]
          },
          "credential_mode": {
            "$ref": "#/components/schemas/CredentialMode"
          },
          "last_synced_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Synced At"
          },
          "tool_sync_hash": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tool Sync Hash"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "enriched_error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EnrichedError"
              },
              {
                "type": "null"
              }
            ]
          },
          "portal_visible": {
            "type": "boolean",
            "title": "Portal Visible",
            "default": false
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category"
          },
          "portal_tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Portal Tags"
          },
          "exposure_mode": {
            "$ref": "#/components/schemas/ExposureMode",
            "description": "Tool exposure mode: 'all', 'raw', or 'script_only'",
            "default": "all"
          },
          "oauth_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oauth Config"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count",
            "default": 0
          },
          "mcp_endpoint_url": {
            "type": "string",
            "title": "Mcp Endpoint Url",
            "description": "MCP endpoint URL for direct server access.",
            "readOnly": true
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "type",
          "status",
          "config",
          "source",
          "source_doc_url",
          "sync_schedule",
          "credential_mode",
          "last_synced_at",
          "tool_sync_hash",
          "created_at",
          "updated_at",
          "mcp_endpoint_url"
        ],
        "title": "MCPServerResponse",
        "description": "Schema for MCP server response."
      },
      "MCPServerStatus": {
        "type": "string",
        "enum": [
          "pending",
          "deploying",
          "running",
          "stopped",
          "error"
        ],
        "title": "MCPServerStatus",
        "description": "Status of an MCP server."
      },
      "MCPServerType": {
        "type": "string",
        "enum": [
          "remote",
          "npx",
          "uvx",
          "container",
          "generated",
          "bundle",
          "virtual",
          "local"
        ],
        "title": "MCPServerType",
        "description": "Type of MCP server deployment."
      },
      "MCPServerUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MCPServerType"
              },
              {
                "type": "null"
              }
            ]
          },
          "config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config"
          },
          "sync_schedule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SyncSchedule"
              },
              {
                "type": "null"
              }
            ]
          },
          "credential_mode": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CredentialMode"
              },
              {
                "type": "null"
              }
            ]
          },
          "oauth_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oauth Config"
          },
          "portal_visible": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Visible"
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category"
          },
          "portal_tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Tags"
          },
          "exposure_mode": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ExposureMode"
              },
              {
                "type": "null"
              }
            ],
            "description": "Tool exposure mode: 'all', 'raw', or 'script_only'"
          }
        },
        "type": "object",
        "title": "MCPServerUpdate",
        "description": "Schema for updating an MCP server (partial update)."
      },
      "MCPToolListItem": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          },
          "has_embedding": {
            "type": "boolean",
            "title": "Has Embedding"
          },
          "enrichment_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enrichment Data"
          },
          "origin_type": {
            "type": "string",
            "title": "Origin Type",
            "default": "rest"
          },
          "skill_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Id"
          },
          "entrypoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Entrypoint"
          },
          "script_metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Script Metadata"
          },
          "has_overrides": {
            "type": "boolean",
            "title": "Has Overrides",
            "default": false
          },
          "override_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Description"
          },
          "override_input_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Input Schema"
          },
          "override_enrichment_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Enrichment Data"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "input_schema",
          "has_embedding"
        ],
        "title": "MCPToolListItem",
        "description": "Single tool item in list response."
      },
      "MetricsSummary": {
        "properties": {
          "total_servers": {
            "type": "integer",
            "title": "Total Servers"
          },
          "running_servers": {
            "type": "integer",
            "title": "Running Servers"
          },
          "total_tool_calls_today": {
            "type": "integer",
            "title": "Total Tool Calls Today"
          },
          "total_errors_today": {
            "type": "integer",
            "title": "Total Errors Today"
          },
          "average_latency_ms": {
            "type": "number",
            "title": "Average Latency Ms"
          },
          "p99_latency_ms": {
            "type": "number",
            "title": "P99 Latency Ms"
          }
        },
        "type": "object",
        "required": [
          "total_servers",
          "running_servers",
          "total_tool_calls_today",
          "total_errors_today",
          "average_latency_ms",
          "p99_latency_ms"
        ],
        "title": "MetricsSummary",
        "description": "Summary metrics for dashboard and monitoring."
      },
      "NotificationSettingsResponse": {
        "properties": {
          "email_enabled": {
            "type": "boolean",
            "title": "Email Enabled"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          },
          "webhook_enabled": {
            "type": "boolean",
            "title": "Webhook Enabled"
          },
          "notify_on_server_error": {
            "type": "boolean",
            "title": "Notify On Server Error"
          },
          "notify_on_token_expiry": {
            "type": "boolean",
            "title": "Notify On Token Expiry"
          }
        },
        "type": "object",
        "required": [
          "email_enabled",
          "webhook_url",
          "webhook_enabled",
          "notify_on_server_error",
          "notify_on_token_expiry"
        ],
        "title": "NotificationSettingsResponse",
        "description": "Response schema for notification settings."
      },
      "NotificationSettingsUpdate": {
        "properties": {
          "email_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email Enabled"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url",
            "description": "Set to empty string to clear"
          },
          "webhook_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Enabled"
          },
          "notify_on_server_error": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notify On Server Error"
          },
          "notify_on_token_expiry": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notify On Token Expiry"
          }
        },
        "type": "object",
        "title": "NotificationSettingsUpdate",
        "description": "Partial update schema -- only provided fields are changed."
      },
      "OAuthAppCreate": {
        "properties": {
          "alias": {
            "type": "string",
            "maxLength": 100,
            "minLength": 2,
            "pattern": "^[a-z0-9][a-z0-9-]*[a-z0-9]$",
            "title": "Alias",
            "description": "Unique alias for the OAuth app (used in URLs)"
          },
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "description": "Display name for the OAuth app"
          },
          "template_id": {
            "type": "string",
            "format": "uuid",
            "title": "Template Id",
            "description": "ID of the OAuth app template to use"
          },
          "client_id": {
            "type": "string",
            "minLength": 1,
            "title": "Client Id",
            "description": "OAuth client ID from the provider"
          },
          "client_secret": {
            "type": "string",
            "minLength": 1,
            "title": "Client Secret",
            "description": "OAuth client secret (will be encrypted at rest)"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes",
            "description": "Custom scopes (overrides template default)"
          },
          "auth_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auth Url",
            "description": "Custom auth URL (overrides template)"
          },
          "token_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Url",
            "description": "Custom token URL (overrides template)"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id",
            "description": "Microsoft 365: Azure AD tenant ID"
          },
          "instance_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Url",
            "description": "Salesforce: Instance URL"
          },
          "gitlab_base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gitlab Base Url",
            "description": "GitLab: Base URL for self-hosted instances"
          },
          "hubspot_app_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hubspot App Id",
            "description": "HubSpot: App ID"
          },
          "authorization_server_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization Server Url",
            "description": "Authorization server URL for matching (e.g., https://accounts.google.com)"
          },
          "is_global": {
            "type": "boolean",
            "title": "Is Global",
            "description": "Whether this app is available to all servers",
            "default": false
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "description": "Whether the app is enabled",
            "default": true
          },
          "additional_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Additional Config",
            "description": "Additional provider-specific configuration"
          }
        },
        "type": "object",
        "required": [
          "alias",
          "name",
          "template_id",
          "client_id",
          "client_secret"
        ],
        "title": "OAuthAppCreate",
        "description": "Schema for creating an OAuth app from a template."
      },
      "OAuthAppListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/OAuthAppResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "OAuthAppListResponse",
        "description": "Schema for list of OAuth apps response."
      },
      "OAuthAppResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "template_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Id",
            "description": "ID of the template this app was created from"
          },
          "alias": {
            "type": "string",
            "title": "Alias",
            "description": "Unique alias for the OAuth app"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Display name"
          },
          "client_id": {
            "type": "string",
            "title": "Client Id",
            "description": "OAuth client ID"
          },
          "client_secret_masked": {
            "type": "string",
            "title": "Client Secret Masked",
            "description": "Masked client secret (first 4 + last 4 chars)"
          },
          "auth_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auth Url",
            "description": "OAuth authorization URL"
          },
          "token_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Url",
            "description": "OAuth token URL"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes",
            "description": "OAuth scopes"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id",
            "description": "Microsoft 365 tenant ID"
          },
          "instance_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Url",
            "description": "Salesforce instance URL"
          },
          "gitlab_base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gitlab Base Url",
            "description": "GitLab base URL"
          },
          "hubspot_app_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hubspot App Id",
            "description": "HubSpot app ID"
          },
          "authorization_server_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization Server Url",
            "description": "Authorization server URL for matching"
          },
          "is_global": {
            "type": "boolean",
            "title": "Is Global",
            "description": "Whether available to all servers"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "description": "Whether enabled"
          },
          "additional_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Additional Config"
          },
          "template_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OAuthAppType"
              },
              {
                "type": "null"
              }
            ],
            "description": "Type from the template (if loaded)"
          },
          "template_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Name",
            "description": "Name from the template (if loaded)"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "created_by_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Id"
          }
        },
        "type": "object",
        "required": [
          "id",
          "alias",
          "name",
          "client_id",
          "client_secret_masked",
          "is_global",
          "is_enabled",
          "created_at",
          "updated_at"
        ],
        "title": "OAuthAppResponse",
        "description": "Schema for OAuth app response."
      },
      "OAuthAppSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "OAuth app UUID"
          },
          "alias": {
            "type": "string",
            "title": "Alias",
            "description": "Unique alias for the OAuth app"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Display name for the OAuth app"
          },
          "template_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/OAuthAppType"
              },
              {
                "type": "null"
              }
            ],
            "description": "OAuth provider type (github, google, etc.)"
          },
          "template_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template Name",
            "description": "Human-readable name from the template"
          }
        },
        "type": "object",
        "required": [
          "id",
          "alias",
          "name"
        ],
        "title": "OAuthAppSummary",
        "description": "Summary of an OAuth app available for connecting to a server.\n\nThis provides minimal OAuth app info needed for the connection options\ndropdown, showing which OAuth providers can be used to connect.\n\nExample:\n    summary = OAuthAppSummary(\n        id=uuid.uuid4(),\n        alias=\"github-prod\",\n        name=\"GitHub Production\",\n        template_type=OAuthAppType.GITHUB,\n        template_name=\"GitHub\",\n    )"
      },
      "OAuthAppTemplateListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/OAuthAppTemplateResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "OAuthAppTemplateListResponse",
        "description": "Schema for list of OAuth app templates response."
      },
      "OAuthAppTemplateResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "type": {
            "$ref": "#/components/schemas/OAuthAppType",
            "description": "OAuth provider type"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Display name for the provider"
          },
          "icon": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon",
            "description": "Icon name or URL"
          },
          "auth_url": {
            "type": "string",
            "title": "Auth Url",
            "description": "OAuth authorization endpoint"
          },
          "token_url": {
            "type": "string",
            "title": "Token Url",
            "description": "OAuth token endpoint"
          },
          "user_info_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Info Url",
            "description": "User info endpoint"
          },
          "default_scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Scopes",
            "description": "Default OAuth scopes for this provider"
          },
          "pkce_required": {
            "type": "boolean",
            "title": "Pkce Required",
            "description": "Whether PKCE is required",
            "default": true
          },
          "token_endpoint_auth_method": {
            "$ref": "#/components/schemas/TokenEndpointAuthMethod",
            "description": "How to authenticate with the token endpoint",
            "default": "client_secret_post"
          },
          "additional_params": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Additional Params",
            "description": "Additional parameters for auth URL"
          },
          "setup_instructions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Setup Instructions",
            "description": "Markdown instructions for setting up this provider"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "type",
          "name",
          "auth_url",
          "token_url",
          "created_at"
        ],
        "title": "OAuthAppTemplateResponse",
        "description": "Schema for OAuth app template response."
      },
      "OAuthAppType": {
        "type": "string",
        "enum": [
          "github",
          "google",
          "microsoft365",
          "slack",
          "notion",
          "hubspot",
          "salesforce",
          "zoom",
          "linkedin",
          "pagerduty",
          "atlassian",
          "gitlab",
          "smartthings",
          "custom"
        ],
        "title": "OAuthAppType",
        "description": "OAuth provider types supported by the gateway.\n\nAdapted from Obot's OAuthAppType (14 providers)."
      },
      "OAuthAppUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "Display name for the OAuth app"
          },
          "client_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id",
            "description": "OAuth client ID from the provider"
          },
          "client_secret": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Secret",
            "description": "New OAuth client secret (will be re-encrypted)"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes",
            "description": "Custom scopes (overrides template default)"
          },
          "auth_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auth Url",
            "description": "Custom auth URL (overrides template)"
          },
          "token_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Url",
            "description": "Custom token URL (overrides template)"
          },
          "tenant_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Id",
            "description": "Microsoft 365: Azure AD tenant ID"
          },
          "instance_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Instance Url",
            "description": "Salesforce: Instance URL"
          },
          "gitlab_base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gitlab Base Url",
            "description": "GitLab: Base URL for self-hosted instances"
          },
          "hubspot_app_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hubspot App Id",
            "description": "HubSpot: App ID"
          },
          "authorization_server_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization Server Url",
            "description": "Authorization server URL for matching (e.g., https://accounts.google.com)"
          },
          "is_global": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Global",
            "description": "Whether this app is available to all servers"
          },
          "is_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Enabled",
            "description": "Whether the app is enabled"
          },
          "additional_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Additional Config",
            "description": "Additional provider-specific configuration"
          }
        },
        "type": "object",
        "title": "OAuthAppUpdate",
        "description": "Schema for updating an OAuth app."
      },
      "OAuthDiscoveryRequest": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2083,
            "minLength": 1,
            "format": "uri",
            "title": "Url"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "OAuthDiscoveryRequest",
        "description": "Request to discover OAuth configuration from a server URL."
      },
      "OAuthDiscoveryResponse": {
        "properties": {
          "supports_oauth": {
            "type": "boolean",
            "title": "Supports Oauth"
          },
          "authorization_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization Endpoint"
          },
          "token_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Token Endpoint"
          },
          "registration_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registration Endpoint"
          },
          "scopes_supported": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes Supported"
          },
          "pkce_required": {
            "type": "boolean",
            "title": "Pkce Required",
            "default": true
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "authorization_server_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Authorization Server Url"
          },
          "suggested_template_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Suggested Template Type"
          }
        },
        "type": "object",
        "required": [
          "supports_oauth"
        ],
        "title": "OAuthDiscoveryResponse",
        "description": "Response containing discovered OAuth configuration.\n\nPer MCP Nov 2025 spec:\n- Discovery via .well-known/oauth-protected-resource\n- Fallback to .well-known/oauth-authorization-server\n- PKCE is always required (S256 only)"
      },
      "OAuthProviderCreate": {
        "properties": {
          "provider_type": {
            "type": "string",
            "enum": [
              "github",
              "google",
              "entra",
              "okta"
            ],
            "title": "Provider Type",
            "description": "Provider identifier (github, google, microsoft, okta)"
          },
          "display_name": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Display Name",
            "description": "Human-readable name shown in the UI"
          },
          "client_id": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Client Id",
            "description": "OAuth client ID"
          },
          "client_secret": {
            "type": "string",
            "minLength": 1,
            "title": "Client Secret",
            "description": "OAuth client secret (will be encrypted before storage)"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "description": "Whether this provider is available for login",
            "default": true
          },
          "display_order": {
            "type": "integer",
            "minimum": 0.0,
            "title": "Display Order",
            "description": "Order in which to show providers in the UI",
            "default": 0
          },
          "config": {
            "additionalProperties": true,
            "type": "object",
            "title": "Config",
            "description": "Provider-specific configuration (e.g., tenant_id for Microsoft)"
          }
        },
        "type": "object",
        "required": [
          "provider_type",
          "display_name",
          "client_id",
          "client_secret"
        ],
        "title": "OAuthProviderCreate",
        "description": "Request schema for creating an OAuth provider.\n\nRequired fields: provider_type, display_name, client_id, client_secret.\nThe client_secret will be encrypted before storage."
      },
      "OAuthProviderListResponse": {
        "properties": {
          "providers": {
            "items": {
              "$ref": "#/components/schemas/OAuthProviderResponse"
            },
            "type": "array",
            "title": "Providers"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total number of providers"
          }
        },
        "type": "object",
        "required": [
          "providers",
          "total"
        ],
        "title": "OAuthProviderListResponse",
        "description": "Response schema for listing OAuth providers."
      },
      "OAuthProviderResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "provider_type": {
            "type": "string",
            "title": "Provider Type",
            "description": "Provider identifier"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Human-readable name shown in the UI"
          },
          "client_id": {
            "type": "string",
            "title": "Client Id",
            "description": "OAuth client ID (public)"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "description": "Whether this provider is available for login"
          },
          "display_order": {
            "type": "integer",
            "title": "Display Order",
            "description": "Order in which to show providers in the UI"
          },
          "config": {
            "additionalProperties": true,
            "type": "object",
            "title": "Config",
            "description": "Provider-specific configuration"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider_type",
          "display_name",
          "client_id",
          "is_enabled",
          "display_order",
          "config",
          "created_at",
          "updated_at"
        ],
        "title": "OAuthProviderResponse",
        "description": "Response schema for an OAuth provider.\n\nExcludes sensitive data like client_secret_encrypted and client_secret_iv.\nOnly returns public configuration."
      },
      "OAuthProviderUpdate": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name",
            "description": "Human-readable name shown in the UI"
          },
          "client_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id",
            "description": "OAuth client ID"
          },
          "client_secret": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Secret",
            "description": "OAuth client secret (will be encrypted before storage)"
          },
          "is_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Enabled",
            "description": "Whether this provider is available for login"
          },
          "display_order": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Order",
            "description": "Order in which to show providers in the UI"
          },
          "config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Config",
            "description": "Provider-specific configuration (e.g., tenant_id for Microsoft)"
          }
        },
        "type": "object",
        "title": "OAuthProviderUpdate",
        "description": "Request schema for updating an OAuth provider.\n\nAll fields are optional to support partial updates.\nIf client_secret is provided, it will be encrypted before storage."
      },
      "ObservabilitySettingsResponse": {
        "properties": {
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "otlp_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Otlp Endpoint"
          },
          "otlp_protocol": {
            "type": "string",
            "title": "Otlp Protocol",
            "default": "grpc"
          },
          "otlp_auth_header_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Otlp Auth Header Name"
          },
          "has_auth_value": {
            "type": "boolean",
            "title": "Has Auth Value",
            "default": false
          },
          "has_provider_secrets": {
            "type": "boolean",
            "title": "Has Provider Secrets",
            "default": false
          },
          "provider_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Config"
          },
          "export_traces": {
            "type": "boolean",
            "title": "Export Traces",
            "default": true
          },
          "export_metrics": {
            "type": "boolean",
            "title": "Export Metrics",
            "default": true
          },
          "export_logs": {
            "type": "boolean",
            "title": "Export Logs",
            "default": true
          },
          "trace_sample_rate": {
            "type": "number",
            "title": "Trace Sample Rate",
            "default": 1.0
          },
          "prometheus_enabled": {
            "type": "boolean",
            "title": "Prometheus Enabled",
            "default": true
          },
          "service_name": {
            "type": "string",
            "title": "Service Name",
            "default": "mcpgateway"
          },
          "excluded_endpoints": {
            "type": "string",
            "title": "Excluded Endpoints",
            "default": "/health,/ready,/api/v1/metrics,/docs,/openapi.json,/redoc"
          },
          "is_connected": {
            "type": "boolean",
            "title": "Is Connected",
            "default": false
          },
          "last_tested_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Tested At"
          },
          "settings_version": {
            "type": "integer",
            "title": "Settings Version",
            "default": 1
          }
        },
        "type": "object",
        "title": "ObservabilitySettingsResponse",
        "description": "Response schema -- secrets are masked."
      },
      "ObservabilitySettingsUpdate": {
        "properties": {
          "provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider"
          },
          "otlp_endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Otlp Endpoint"
          },
          "otlp_protocol": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Otlp Protocol"
          },
          "otlp_auth_header_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Otlp Auth Header Name"
          },
          "auth_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Auth Value",
            "description": "Plaintext auth credential (will be encrypted)"
          },
          "provider_secrets": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Secrets",
            "description": "Provider secrets (will be encrypted)"
          },
          "provider_config": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Config"
          },
          "export_traces": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Export Traces"
          },
          "export_metrics": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Export Metrics"
          },
          "export_logs": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Export Logs"
          },
          "trace_sample_rate": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 1.0,
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Trace Sample Rate"
          },
          "prometheus_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prometheus Enabled"
          },
          "service_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Service Name"
          },
          "excluded_endpoints": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Excluded Endpoints"
          }
        },
        "type": "object",
        "title": "ObservabilitySettingsUpdate",
        "description": "Update schema -- accepts plaintext secrets for encryption."
      },
      "OnboardingStatusResponse": {
        "properties": {
          "onboarding_required": {
            "type": "boolean",
            "title": "Onboarding Required"
          },
          "steps": {
            "additionalProperties": {
              "$ref": "#/components/schemas/OnboardingStepStatus"
            },
            "type": "object",
            "title": "Steps"
          }
        },
        "type": "object",
        "required": [
          "onboarding_required",
          "steps"
        ],
        "title": "OnboardingStatusResponse",
        "description": "Full onboarding status returned to the frontend."
      },
      "OnboardingStepStatus": {
        "properties": {
          "configured": {
            "type": "boolean",
            "title": "Configured"
          },
          "required": {
            "type": "boolean",
            "title": "Required"
          }
        },
        "type": "object",
        "required": [
          "configured",
          "required"
        ],
        "title": "OnboardingStepStatus",
        "description": "Status of a single onboarding step."
      },
      "OriginType": {
        "type": "string",
        "enum": [
          "rest",
          "script",
          "mcp",
          "local"
        ],
        "title": "OriginType",
        "description": "How a tool was created/sourced."
      },
      "PlannedTool": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Tool name (function name)"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Tool description"
          },
          "endpoint": {
            "type": "string",
            "title": "Endpoint",
            "description": "API endpoint path"
          },
          "method": {
            "type": "string",
            "title": "Method",
            "description": "HTTP method (GET, POST, etc.)"
          },
          "parameters": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Parameters",
            "description": "List of parameter names"
          },
          "include": {
            "type": "boolean",
            "title": "Include",
            "description": "Whether to include this tool",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "endpoint",
          "method"
        ],
        "title": "PlannedTool",
        "description": "A tool planned for generation from API analysis."
      },
      "PlaygroundAvailableToolsResponse": {
        "properties": {
          "servers": {
            "items": {
              "$ref": "#/components/schemas/PlaygroundServerInfo"
            },
            "type": "array",
            "title": "Servers"
          },
          "skills": {
            "items": {
              "$ref": "#/components/schemas/PlaygroundSkillInfo"
            },
            "type": "array",
            "title": "Skills"
          },
          "sandbox_images": {
            "items": {
              "$ref": "#/components/schemas/PlaygroundSandboxImageInfo"
            },
            "type": "array",
            "title": "Sandbox Images"
          }
        },
        "type": "object",
        "title": "PlaygroundAvailableToolsResponse",
        "description": "Response listing available tools for selection."
      },
      "PlaygroundChatRequest": {
        "properties": {
          "session_id": {
            "type": "string",
            "title": "Session Id",
            "description": "Session ID from create session"
          },
          "message": {
            "type": "string",
            "maxLength": 10000,
            "minLength": 1,
            "title": "Message",
            "description": "User message"
          }
        },
        "type": "object",
        "required": [
          "session_id",
          "message"
        ],
        "title": "PlaygroundChatRequest",
        "description": "Request to send a chat message."
      },
      "PlaygroundSandboxImageInfo": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "description"
        ],
        "title": "PlaygroundSandboxImageInfo",
        "description": "Sandbox image info for playground image selector."
      },
      "PlaygroundServerInfo": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count"
          },
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "tool_count",
          "status"
        ],
        "title": "PlaygroundServerInfo",
        "description": "Server info for selection UI."
      },
      "PlaygroundSessionCreate": {
        "properties": {
          "server_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "maxItems": 50,
            "title": "Server Ids",
            "description": "MCP server IDs to include"
          },
          "skill_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "maxItems": 50,
            "title": "Skill Ids",
            "description": "Skill IDs to include"
          },
          "use_gateway_mode": {
            "type": "boolean",
            "title": "Use Gateway Mode",
            "description": "If true, use gateway mode instead of direct server mode. In gateway mode, server_ids is ignored and tools are loaded based on user's gateway settings (AUTO/LIST/SEARCH_EXECUTE mode).",
            "default": false
          },
          "sandbox_image_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sandbox Image Id",
            "description": "Override sandbox image for this session. If None, the system auto-selects based on selected skills."
          }
        },
        "type": "object",
        "title": "PlaygroundSessionCreate",
        "description": "Request to create a new playground session.\n\nSupports two modes:\n1. Direct Server Mode (default): Specify server_ids to load tools directly\n2. Gateway Mode: Set use_gateway_mode=True to use the same behavior as /mcp/gateway\n   - Respects user's gateway settings (AUTO/LIST/SEARCH_EXECUTE)\n   - In LIST mode: Returns all tools with SERVER_PREFIX__tool_name format\n   - In SEARCH_EXECUTE mode: Returns SEARCH_TOOLS and EXECUTE_TOOL meta-tools"
      },
      "PlaygroundSessionResponse": {
        "properties": {
          "session_id": {
            "type": "string",
            "title": "Session Id",
            "description": "Unique session identifier"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count",
            "description": "Total number of tools loaded"
          },
          "server_count": {
            "type": "integer",
            "title": "Server Count",
            "description": "Number of servers"
          },
          "skill_count": {
            "type": "integer",
            "title": "Skill Count",
            "description": "Number of skills"
          },
          "sandbox_image_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sandbox Image Id",
            "description": "Resolved sandbox image UUID (null if no sandbox used)"
          },
          "sandbox_image_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sandbox Image Name",
            "description": "Resolved sandbox image display name"
          },
          "warning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Warning",
            "description": "Optional warning when tool count is high"
          }
        },
        "type": "object",
        "required": [
          "session_id",
          "tool_count",
          "server_count",
          "skill_count"
        ],
        "title": "PlaygroundSessionResponse",
        "description": "Response after creating a playground session."
      },
      "PlaygroundSkillInfo": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description"
        ],
        "title": "PlaygroundSkillInfo",
        "description": "Skill info for selection UI."
      },
      "PoolImageSummary": {
        "properties": {
          "image_id": {
            "type": "string",
            "title": "Image Id"
          },
          "image_name": {
            "type": "string",
            "title": "Image Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "warm_pool_min": {
            "type": "integer",
            "title": "Warm Pool Min"
          },
          "warm_pool_max": {
            "type": "integer",
            "title": "Warm Pool Max"
          },
          "idle_count": {
            "type": "integer",
            "title": "Idle Count"
          }
        },
        "type": "object",
        "required": [
          "image_id",
          "image_name",
          "display_name",
          "warm_pool_min",
          "warm_pool_max",
          "idle_count"
        ],
        "title": "PoolImageSummary",
        "description": "Per-image warm pool summary."
      },
      "PoolStatusResponse": {
        "properties": {
          "image_id": {
            "type": "string",
            "title": "Image Id"
          },
          "image_name": {
            "type": "string",
            "title": "Image Name"
          },
          "warm_pool_min": {
            "type": "integer",
            "title": "Warm Pool Min"
          },
          "warm_pool_max": {
            "type": "integer",
            "title": "Warm Pool Max"
          },
          "idle_count": {
            "type": "integer",
            "title": "Idle Count"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          }
        },
        "type": "object",
        "required": [
          "image_id",
          "image_name",
          "warm_pool_min",
          "warm_pool_max",
          "idle_count",
          "provider"
        ],
        "title": "PoolStatusResponse",
        "description": "Pool status for a sandbox image."
      },
      "PoolSummaryResponse": {
        "properties": {
          "total_images": {
            "type": "integer",
            "title": "Total Images"
          },
          "images_with_pool": {
            "type": "integer",
            "title": "Images With Pool"
          },
          "total_idle": {
            "type": "integer",
            "title": "Total Idle"
          },
          "total_min_target": {
            "type": "integer",
            "title": "Total Min Target"
          },
          "total_max_target": {
            "type": "integer",
            "title": "Total Max Target"
          },
          "provider": {
            "type": "string",
            "enum": [
              "docker",
              "k8s",
              "agent-sandbox"
            ],
            "title": "Provider"
          },
          "warm_pool_enabled": {
            "type": "boolean",
            "title": "Warm Pool Enabled"
          },
          "per_image": {
            "items": {
              "$ref": "#/components/schemas/PoolImageSummary"
            },
            "type": "array",
            "title": "Per Image"
          }
        },
        "type": "object",
        "required": [
          "total_images",
          "images_with_pool",
          "total_idle",
          "total_min_target",
          "total_max_target",
          "provider",
          "warm_pool_enabled",
          "per_image"
        ],
        "title": "PoolSummaryResponse",
        "description": "Aggregate warm pool status."
      },
      "PortalConnectionListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PortalConnectionResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "PortalConnectionListResponse",
        "description": "List of user connections."
      },
      "PortalConnectionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name"
          },
          "server_display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Display Name"
          },
          "provider_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Name"
          },
          "credential_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Type"
          },
          "is_valid": {
            "type": "boolean",
            "title": "Is Valid",
            "default": true
          },
          "connected_at": {
            "type": "string",
            "format": "date-time",
            "title": "Connected At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "server_id",
          "server_name",
          "connected_at"
        ],
        "title": "PortalConnectionResponse",
        "description": "A user's connection to an MCP server."
      },
      "PortalServerDetailResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category"
          },
          "portal_tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Portal Tags"
          },
          "credential_mode": {
            "type": "string",
            "title": "Credential Mode",
            "description": "none, managed, or user_provided"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count",
            "description": "Number of tools available",
            "default": 0
          },
          "is_connected": {
            "type": "boolean",
            "title": "Is Connected",
            "description": "Whether current user is connected",
            "default": false
          },
          "oauth_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oauth Provider",
            "description": "OAuth provider if available"
          },
          "oauth_app_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oauth App Id",
            "description": "OAuth app ID for initiating OAuth flow"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "tools": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Tools",
            "description": "List of tool summaries"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "credential_mode",
          "created_at"
        ],
        "title": "PortalServerDetailResponse",
        "description": "Detailed server view for portal detail page."
      },
      "PortalServerListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PortalServerResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "PortalServerListResponse",
        "description": "Paginated list of portal servers."
      },
      "PortalServerResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category"
          },
          "portal_tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Portal Tags"
          },
          "credential_mode": {
            "type": "string",
            "title": "Credential Mode",
            "description": "none, managed, or user_provided"
          },
          "tool_count": {
            "type": "integer",
            "title": "Tool Count",
            "description": "Number of tools available",
            "default": 0
          },
          "is_connected": {
            "type": "boolean",
            "title": "Is Connected",
            "description": "Whether current user is connected",
            "default": false
          },
          "oauth_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oauth Provider",
            "description": "OAuth provider if available"
          },
          "oauth_app_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oauth App Id",
            "description": "OAuth app ID for initiating OAuth flow"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "credential_mode",
          "created_at"
        ],
        "title": "PortalServerResponse",
        "description": "Server visible in the customer portal."
      },
      "PortalSettingsResponse": {
        "properties": {
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url",
            "description": "URL to organization logo"
          },
          "primary_color": {
            "type": "string",
            "title": "Primary Color",
            "description": "Hex color for primary brand color",
            "default": "#6366f1"
          },
          "dark_mode_default": {
            "type": "boolean",
            "title": "Dark Mode Default",
            "description": "Whether dark mode is default",
            "default": true
          }
        },
        "type": "object",
        "title": "PortalSettingsResponse",
        "description": "Portal branding settings (public, for theming)."
      },
      "PortalSettingsUpdate": {
        "properties": {
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url",
            "description": "URL to logo (null to clear)"
          },
          "primary_color": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Color",
            "description": "Hex color code (e.g., #6366f1)"
          },
          "dark_mode_default": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dark Mode Default",
            "description": "Default to dark mode"
          }
        },
        "type": "object",
        "title": "PortalSettingsUpdate",
        "description": "Schema for updating portal settings (admin only)."
      },
      "PortalSkillDetailResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category"
          },
          "portal_tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Portal Tags"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type",
            "description": "imported, generated, or manual"
          },
          "download_count": {
            "type": "integer",
            "title": "Download Count",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "skill_md_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Md Content",
            "description": "SKILL.md preview"
          },
          "package_size_bytes": {
            "type": "integer",
            "title": "Package Size Bytes",
            "description": "Size of downloadable package",
            "default": 0
          },
          "skill_metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Metadata",
            "description": "Skill metadata (files, author, etc.)"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "source_type",
          "created_at"
        ],
        "title": "PortalSkillDetailResponse",
        "description": "Detailed skill view for portal detail page."
      },
      "PortalSkillListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PortalSkillResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "page": {
            "type": "integer",
            "title": "Page"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "page_size"
        ],
        "title": "PortalSkillListResponse",
        "description": "Paginated list of portal skills."
      },
      "PortalSkillResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category"
          },
          "portal_tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Portal Tags"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type",
            "description": "imported, generated, or manual"
          },
          "download_count": {
            "type": "integer",
            "title": "Download Count",
            "default": 0
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "source_type",
          "created_at"
        ],
        "title": "PortalSkillResponse",
        "description": "Skill visible in the customer portal."
      },
      "PortalStatsResponse": {
        "properties": {
          "trending_servers": {
            "items": {
              "$ref": "#/components/schemas/PortalTrendingServer"
            },
            "type": "array",
            "title": "Trending Servers",
            "description": "Top servers by tool call count (7 days)"
          },
          "trending_tools": {
            "items": {
              "$ref": "#/components/schemas/PortalTrendingTool"
            },
            "type": "array",
            "title": "Trending Tools",
            "description": "Top tools by call count (24h)"
          }
        },
        "type": "object",
        "title": "PortalStatsResponse",
        "description": "Aggregated stats for the portal home page."
      },
      "PortalTrendingServer": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Server UUID"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Server identifier name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Human-readable server name"
          },
          "call_count": {
            "type": "integer",
            "title": "Call Count",
            "description": "Number of tool calls (7 days)"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "call_count"
        ],
        "title": "PortalTrendingServer",
        "description": "A server ranked by usage (call count) for portal display."
      },
      "PortalTrendingTool": {
        "properties": {
          "tool_name": {
            "type": "string",
            "title": "Tool Name",
            "description": "Name of the tool"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Server this tool belongs to"
          },
          "server_id": {
            "type": "string",
            "title": "Server Id",
            "description": "Server UUID"
          },
          "call_count": {
            "type": "integer",
            "title": "Call Count",
            "description": "Number of calls (24h)"
          }
        },
        "type": "object",
        "required": [
          "tool_name",
          "server_name",
          "server_id",
          "call_count"
        ],
        "title": "PortalTrendingTool",
        "description": "A tool ranked by usage for portal display."
      },
      "PromptDetailResponse": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "base_content": {
            "type": "string",
            "title": "Base Content"
          },
          "custom_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Custom Content"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "variables": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Variables"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated By"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "description",
          "category",
          "base_content",
          "custom_content",
          "is_active",
          "variables",
          "updated_at",
          "updated_by"
        ],
        "title": "PromptDetailResponse",
        "description": "Response for a single prompt detail."
      },
      "PromptListItem": {
        "properties": {
          "slug": {
            "type": "string",
            "title": "Slug"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "has_override": {
            "type": "boolean",
            "title": "Has Override"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "variables": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Variables"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated By"
          }
        },
        "type": "object",
        "required": [
          "slug",
          "description",
          "category",
          "has_override",
          "is_active",
          "variables",
          "updated_at",
          "updated_by"
        ],
        "title": "PromptListItem",
        "description": "A prompt in the list view."
      },
      "PromptListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PromptListItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "PromptListResponse",
        "description": "Response for listing all prompts."
      },
      "PromptToggleRequest": {
        "properties": {
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          }
        },
        "type": "object",
        "required": [
          "is_active"
        ],
        "title": "PromptToggleRequest",
        "description": "Request to toggle prompt active state."
      },
      "PromptUpdateRequest": {
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 50000,
            "minLength": 1,
            "title": "Content"
          }
        },
        "type": "object",
        "required": [
          "content"
        ],
        "title": "PromptUpdateRequest",
        "description": "Request to save a prompt override."
      },
      "ProviderType": {
        "type": "string",
        "enum": [
          "llm",
          "embedding"
        ],
        "title": "ProviderType",
        "description": "Type of AI provider configuration."
      },
      "PrunedEndpointInfo": {
        "properties": {
          "path": {
            "type": "string",
            "title": "Path",
            "description": "Endpoint path (e.g., /health)",
            "default": ""
          },
          "method": {
            "type": "string",
            "title": "Method",
            "description": "HTTP method (e.g., GET)",
            "default": ""
          },
          "reason": {
            "type": "string",
            "title": "Reason",
            "description": "Why this endpoint was pruned",
            "default": ""
          }
        },
        "type": "object",
        "title": "PrunedEndpointInfo",
        "description": "An API endpoint pruned during enrichment."
      },
      "QuotaListEntry": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "max_sandboxes": {
            "type": "integer",
            "title": "Max Sandboxes"
          },
          "max_memory_mb": {
            "type": "integer",
            "title": "Max Memory Mb"
          },
          "max_cpu_cores": {
            "type": "number",
            "title": "Max Cpu Cores"
          },
          "max_exec_per_day": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Exec Per Day"
          },
          "is_custom": {
            "type": "boolean",
            "title": "Is Custom"
          },
          "active_sandboxes": {
            "type": "integer",
            "title": "Active Sandboxes",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "max_sandboxes",
          "max_memory_mb",
          "max_cpu_cores",
          "is_custom"
        ],
        "title": "QuotaListEntry",
        "description": "Entry in the quota list (includes current usage)."
      },
      "QuotaListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/QuotaListEntry"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          },
          "page": {
            "type": "integer",
            "title": "Page",
            "default": 1
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "default": 50
          },
          "platform_defaults": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "number"
                }
              ]
            },
            "type": "object",
            "title": "Platform Defaults"
          }
        },
        "type": "object",
        "title": "QuotaListResponse",
        "description": "Paginated quota list with platform defaults."
      },
      "QuotaResponse": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "max_sandboxes": {
            "type": "integer",
            "title": "Max Sandboxes",
            "default": 5
          },
          "max_memory_mb": {
            "type": "integer",
            "title": "Max Memory Mb",
            "default": 2048
          },
          "max_cpu_cores": {
            "type": "number",
            "title": "Max Cpu Cores",
            "default": 4.0
          },
          "max_exec_per_day": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Exec Per Day"
          },
          "is_custom": {
            "type": "boolean",
            "title": "Is Custom",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "user_id"
        ],
        "title": "QuotaResponse",
        "description": "Per-user sandbox quota."
      },
      "QuotaUpdateRequest": {
        "properties": {
          "max_sandboxes": {
            "type": "integer",
            "maximum": 100.0,
            "minimum": 1.0,
            "title": "Max Sandboxes",
            "default": 5
          },
          "max_memory_mb": {
            "type": "integer",
            "maximum": 65536.0,
            "minimum": 512.0,
            "title": "Max Memory Mb",
            "default": 2048
          },
          "max_cpu_cores": {
            "type": "number",
            "maximum": 64.0,
            "minimum": 0.5,
            "title": "Max Cpu Cores",
            "default": 4.0
          },
          "max_exec_per_day": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Exec Per Day"
          }
        },
        "type": "object",
        "title": "QuotaUpdateRequest",
        "description": "Request to set per-user quota."
      },
      "ReasoningMessage": {
        "properties": {
          "timestamp": {
            "type": "string",
            "title": "Timestamp",
            "description": "ISO timestamp when message was logged"
          },
          "agent": {
            "type": "string",
            "title": "Agent",
            "description": "Agent name (analyzer, generator, reviewer, deployer)"
          },
          "phase": {
            "type": "string",
            "title": "Phase",
            "description": "Current phase of the pipeline"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Human-readable reasoning message"
          },
          "details": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details",
            "description": "Optional structured details"
          }
        },
        "type": "object",
        "required": [
          "timestamp",
          "agent",
          "phase",
          "message"
        ],
        "title": "ReasoningMessage",
        "description": "A single reasoning message from an agent."
      },
      "RecentAuditItem": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Audit log UUID"
          },
          "tool_name": {
            "type": "string",
            "title": "Tool Name",
            "description": "Name of the tool called"
          },
          "server_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Name",
            "description": "Name of the server"
          },
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Call status (success, error)"
          },
          "latency_ms": {
            "type": "integer",
            "title": "Latency Ms",
            "description": "Call latency in milliseconds"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "When the call was made"
          }
        },
        "type": "object",
        "required": [
          "id",
          "tool_name",
          "status",
          "latency_ms",
          "created_at"
        ],
        "title": "RecentAuditItem",
        "description": "A recent tool call audit entry."
      },
      "RegistryCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name"
          },
          "url": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Url"
          },
          "username": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Username"
          },
          "password": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "name",
          "url",
          "username"
        ],
        "title": "RegistryCreate",
        "description": "Request to create or update the container registry."
      },
      "RegistryCredentialCreate": {
        "properties": {
          "registry_type": {
            "type": "string",
            "enum": [
              "docker_hub",
              "npm",
              "pypi",
              "github"
            ],
            "title": "Registry Type",
            "description": "Registry type: docker_hub, npm, pypi, or github"
          },
          "username": {
            "type": "string",
            "maxLength": 255,
            "title": "Username",
            "description": "Username for registry auth (optional for github, defaults to 'token')",
            "default": "token"
          },
          "credential": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "title": "Credential",
            "description": "Password or access token"
          },
          "credential_type": {
            "type": "string",
            "enum": [
              "password",
              "access_token",
              "api_token"
            ],
            "title": "Credential Type",
            "description": "Type of credential: password, access_token, or api_token",
            "default": "access_token"
          }
        },
        "type": "object",
        "required": [
          "registry_type",
          "credential"
        ],
        "title": "RegistryCredentialCreate",
        "description": "Schema for creating a registry credential."
      },
      "RegistryCredentialListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/RegistryCredentialResponse"
            },
            "type": "array",
            "title": "Items",
            "description": "List of registry credentials"
          }
        },
        "type": "object",
        "title": "RegistryCredentialListResponse",
        "description": "Schema for list of registry credentials."
      },
      "RegistryCredentialResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Unique identifier for the credential"
          },
          "registry_type": {
            "type": "string",
            "enum": [
              "docker_hub",
              "npm",
              "pypi",
              "github"
            ],
            "title": "Registry Type",
            "description": "Registry type: docker_hub, npm, or pypi"
          },
          "username": {
            "type": "string",
            "title": "Username",
            "description": "Username for registry authentication"
          },
          "credential_masked": {
            "type": "string",
            "title": "Credential Masked",
            "description": "Masked credential value (e.g., 'test****oken')"
          },
          "credential_type": {
            "type": "string",
            "enum": [
              "password",
              "access_token",
              "api_token"
            ],
            "title": "Credential Type",
            "description": "Type of credential: password, access_token, or api_token"
          },
          "is_enabled": {
            "type": "boolean",
            "title": "Is Enabled",
            "description": "Whether this credential is active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "When the credential was created"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At",
            "description": "When the credential was last updated"
          }
        },
        "type": "object",
        "required": [
          "id",
          "registry_type",
          "username",
          "credential_masked",
          "credential_type",
          "is_enabled",
          "created_at",
          "updated_at"
        ],
        "title": "RegistryCredentialResponse",
        "description": "Schema for registry credential response."
      },
      "RegistryCredentialTestResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "description": "Whether the connection test succeeded"
          },
          "message": {
            "type": "string",
            "title": "Message",
            "description": "Human-readable result message"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms",
            "description": "Response latency in milliseconds (if successful)"
          }
        },
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "title": "RegistryCredentialTestResponse",
        "description": "Schema for credential test result."
      },
      "RegistryResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "url": {
            "type": "string",
            "title": "Url"
          },
          "username": {
            "type": "string",
            "title": "Username"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "url",
          "username",
          "created_at",
          "updated_at"
        ],
        "title": "RegistryResponse",
        "description": "Registry response (password never returned)."
      },
      "RequirementAnalysisResult": {
        "properties": {
          "server_type": {
            "type": "string",
            "enum": [
              "npx",
              "uvx",
              "container",
              "remote",
              "generated",
              "virtual"
            ],
            "title": "Server Type",
            "description": "Type of MCP server"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Human-readable name for the server"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Description of what the server does"
          },
          "requirements": {
            "items": {
              "$ref": "#/components/schemas/CredentialRequirement"
            },
            "type": "array",
            "title": "Requirements",
            "description": "List of discovered requirements"
          },
          "auth_method": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "none",
                  "api_key",
                  "bearer",
                  "oauth2"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Auth Method",
            "description": "Primary authentication method detected"
          },
          "sources_analyzed": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Sources Analyzed",
            "description": "Sources examined during analysis (e.g., README, npm page)"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Warnings",
            "description": "Warnings from the analysis"
          },
          "analysis_confidence": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Analysis Confidence",
            "description": "Overall confidence in analysis accuracy"
          }
        },
        "type": "object",
        "required": [
          "server_type",
          "display_name",
          "description",
          "analysis_confidence"
        ],
        "title": "RequirementAnalysisResult",
        "description": "Complete result from RequirementAnalyzerAgent.\n\nContains all discovered requirements for an MCP server along with\nmetadata about the analysis."
      },
      "SDKCacheSetRequest": {
        "properties": {
          "value": {
            "title": "Value"
          },
          "ttl": {
            "type": "integer",
            "maximum": 86400.0,
            "minimum": 1.0,
            "title": "Ttl",
            "default": 300
          }
        },
        "type": "object",
        "required": [
          "value"
        ],
        "title": "SDKCacheSetRequest",
        "description": "Request body for SDK cache set."
      },
      "SDKExecuteRequest": {
        "properties": {
          "tool_name": {
            "type": "string",
            "title": "Tool Name",
            "description": "Prefixed tool name (e.g. SALESFORCE__opps_list)"
          },
          "arguments": {
            "additionalProperties": true,
            "type": "object",
            "title": "Arguments"
          }
        },
        "type": "object",
        "required": [
          "tool_name"
        ],
        "title": "SDKExecuteRequest",
        "description": "Request body for SDK tool execution."
      },
      "SDKExecuteResponse": {
        "properties": {
          "result": {
            "title": "Result"
          },
          "tool_name": {
            "type": "string",
            "title": "Tool Name"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms",
            "default": 0
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "result",
          "tool_name"
        ],
        "title": "SDKExecuteResponse",
        "description": "Response for SDK tool execution."
      },
      "SDKSearchRequest": {
        "properties": {
          "query": {
            "type": "string",
            "minLength": 1,
            "title": "Query"
          },
          "limit": {
            "type": "integer",
            "maximum": 50.0,
            "minimum": 1.0,
            "title": "Limit",
            "default": 5
          }
        },
        "type": "object",
        "required": [
          "query"
        ],
        "title": "SDKSearchRequest",
        "description": "Request body for SDK tool search."
      },
      "SDKSearchResponse": {
        "properties": {
          "tools": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Tools"
          }
        },
        "type": "object",
        "required": [
          "tools"
        ],
        "title": "SDKSearchResponse",
        "description": "Response for SDK tool search."
      },
      "SandboxAdminListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SandboxResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          },
          "page": {
            "type": "integer",
            "title": "Page",
            "default": 1
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "default": 50
          }
        },
        "type": "object",
        "title": "SandboxAdminListResponse",
        "description": "Paginated list of sandboxes (admin \u2014 all users)."
      },
      "SandboxCreate": {
        "properties": {
          "image": {
            "type": "string",
            "maxLength": 255,
            "title": "Image",
            "description": "Container image for the sandbox (must be in allowlist)",
            "default": "mcpgateway/sandbox-runtime:latest"
          },
          "idle_timeout_seconds": {
            "type": "integer",
            "maximum": 28800.0,
            "minimum": 60.0,
            "title": "Idle Timeout Seconds",
            "description": "Seconds of inactivity before auto-stop",
            "default": 1800
          },
          "memory_mb": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 8192.0,
                "minimum": 128.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Memory Mb",
            "description": "Memory limit in MB (uses image default if not specified)"
          },
          "cpu_cores": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 8.0,
                "minimum": 0.25
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpu Cores",
            "description": "CPU core limit (uses image default if not specified)"
          },
          "disk_mb": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 10240.0,
                "minimum": 256.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Disk Mb",
            "description": "Disk limit in MB (uses image default if not specified)"
          },
          "env_vars": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "Env Vars",
            "description": "Environment variables for the sandbox"
          },
          "network_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Network Enabled",
            "description": "Network access. Uses image default if not specified."
          },
          "session_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Key",
            "description": "Session affinity key \u2014 reuses existing sandbox if one matches"
          }
        },
        "type": "object",
        "title": "SandboxCreate",
        "description": "Request to create a new sandbox."
      },
      "SandboxExecRequest": {
        "properties": {
          "command": {
            "type": "string",
            "maxLength": 10000,
            "minLength": 1,
            "title": "Command",
            "description": "Shell command to execute"
          },
          "working_dir": {
            "type": "string",
            "title": "Working Dir",
            "description": "Working directory for the command",
            "default": "/workspace"
          },
          "timeout_seconds": {
            "type": "integer",
            "maximum": 3600.0,
            "minimum": 1.0,
            "title": "Timeout Seconds",
            "description": "Command timeout in seconds",
            "default": 300
          }
        },
        "type": "object",
        "required": [
          "command"
        ],
        "title": "SandboxExecRequest",
        "description": "Request to execute a command in a sandbox."
      },
      "SandboxExecResponse": {
        "properties": {
          "exit_code": {
            "type": "integer",
            "title": "Exit Code"
          },
          "stdout": {
            "type": "string",
            "title": "Stdout",
            "default": ""
          },
          "stderr": {
            "type": "string",
            "title": "Stderr",
            "default": ""
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms",
            "default": 0
          },
          "files_changed": {
            "items": {
              "$ref": "#/components/schemas/FileChange"
            },
            "type": "array",
            "title": "Files Changed"
          }
        },
        "type": "object",
        "required": [
          "exit_code"
        ],
        "title": "SandboxExecResponse",
        "description": "Response from sandbox command execution."
      },
      "SandboxImageCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "pattern": "^[a-z0-9][a-z0-9._/\\-]+:[a-z0-9._\\-]+$",
            "title": "Name",
            "description": "Image name in registry format (e.g. mcpgateway/sandbox-python:3.12)"
          },
          "display_name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Display Name",
            "description": "Human-readable display name"
          },
          "description": {
            "type": "string",
            "minLength": 10,
            "title": "Description",
            "description": "Description of the image (minimum 10 characters)"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language",
            "description": "Programming language this image supports (e.g. python, node)"
          },
          "template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template",
            "description": "Template used: anthropic-skills, data-science, blank"
          },
          "base_image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Image",
            "description": "Docker base image (e.g. python:3.12-slim)"
          },
          "packages": {
            "anyOf": [
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Packages",
            "description": "Structured packages: {\"pip\": [...], \"npm\": [...], \"apt\": [...]}"
          },
          "dockerfile": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 10
              },
              {
                "type": "null"
              }
            ],
            "title": "Dockerfile",
            "description": "Dockerfile content (auto-generated if packages provided)"
          },
          "default_memory_mb": {
            "type": "integer",
            "maximum": 8192.0,
            "minimum": 128.0,
            "title": "Default Memory Mb",
            "description": "Default memory limit in MB",
            "default": 512
          },
          "default_cpu_cores": {
            "type": "number",
            "maximum": 8.0,
            "minimum": 0.25,
            "title": "Default Cpu Cores",
            "description": "Default CPU core limit",
            "default": 1.0
          },
          "default_disk_mb": {
            "type": "integer",
            "maximum": 10240.0,
            "minimum": 256.0,
            "title": "Default Disk Mb",
            "description": "Default disk limit in MB",
            "default": 1024
          },
          "default_network_enabled": {
            "type": "boolean",
            "title": "Default Network Enabled",
            "description": "Whether sandboxes from this image have network access by default",
            "default": false
          },
          "build_status": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(pending|ready)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Build Status",
            "description": "Initial build status: \"pending\" (default) or \"ready\" for pre-built images"
          }
        },
        "type": "object",
        "required": [
          "name",
          "display_name",
          "description"
        ],
        "title": "SandboxImageCreate",
        "description": "Request to create a new sandbox image (admin only)."
      },
      "SandboxImageListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SandboxImageResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "SandboxImageListResponse",
        "description": "Paginated response for admin image listing."
      },
      "SandboxImagePublicResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template"
          },
          "base_image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Image"
          },
          "registry_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registry Ref"
          },
          "packages": {
            "anyOf": [
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Packages"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          },
          "image_size_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Size Mb"
          },
          "default_memory_mb": {
            "type": "integer",
            "title": "Default Memory Mb"
          },
          "default_cpu_cores": {
            "type": "number",
            "title": "Default Cpu Cores"
          },
          "default_disk_mb": {
            "type": "integer",
            "title": "Default Disk Mb"
          },
          "default_network_enabled": {
            "type": "boolean",
            "title": "Default Network Enabled",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "description",
          "language",
          "default_memory_mb",
          "default_cpu_cores",
          "default_disk_mb"
        ],
        "title": "SandboxImagePublicResponse",
        "description": "Public image response for user-facing endpoints.\n\nExcludes internal fields like build_log, created_by, dockerfile."
      },
      "SandboxImageResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "template": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Template"
          },
          "base_image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Image"
          },
          "registry_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Registry Ref"
          },
          "packages": {
            "anyOf": [
              {
                "additionalProperties": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Packages"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          },
          "dockerfile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dockerfile"
          },
          "build_status": {
            "type": "string",
            "title": "Build Status"
          },
          "build_log": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Build Log"
          },
          "image_size_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Image Size Mb"
          },
          "default_memory_mb": {
            "type": "integer",
            "title": "Default Memory Mb"
          },
          "default_cpu_cores": {
            "type": "number",
            "title": "Default Cpu Cores"
          },
          "default_disk_mb": {
            "type": "integer",
            "title": "Default Disk Mb"
          },
          "default_network_enabled": {
            "type": "boolean",
            "title": "Default Network Enabled",
            "default": false
          },
          "warm_pool_min": {
            "type": "integer",
            "title": "Warm Pool Min",
            "default": 0
          },
          "warm_pool_max": {
            "type": "integer",
            "title": "Warm Pool Max",
            "default": 10
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "instance_count": {
            "type": "integer",
            "title": "Instance Count",
            "default": 0
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "created_by_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By Name"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "description",
          "language",
          "build_status",
          "default_memory_mb",
          "default_cpu_cores",
          "default_disk_mb",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "SandboxImageResponse",
        "description": "Full image response for admin endpoints."
      },
      "SandboxImageUpdate": {
        "properties": {
          "display_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Display Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 10
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "default_memory_mb": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 8192.0,
                "minimum": 128.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Memory Mb"
          },
          "default_cpu_cores": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 8.0,
                "minimum": 0.25
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Cpu Cores"
          },
          "default_disk_mb": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 10240.0,
                "minimum": 256.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Disk Mb"
          },
          "default_network_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Network Enabled",
            "description": "Whether sandboxes from this image have network access by default"
          },
          "warm_pool_min": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Warm Pool Min",
            "description": "Minimum idle containers in warm pool"
          },
          "warm_pool_max": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Warm Pool Max",
            "description": "Maximum idle containers in warm pool"
          }
        },
        "type": "object",
        "title": "SandboxImageUpdate",
        "description": "Request to update sandbox image metadata (admin only)."
      },
      "SandboxInstallSkillsRequest": {
        "properties": {
          "skill_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "maxItems": 20,
            "minItems": 1,
            "title": "Skill Ids"
          }
        },
        "type": "object",
        "required": [
          "skill_ids"
        ],
        "title": "SandboxInstallSkillsRequest",
        "description": "Request to install skills on a sandbox."
      },
      "SandboxInstallSkillsResponse": {
        "properties": {
          "installed": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Installed"
          },
          "already_installed": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Already Installed"
          },
          "not_found": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Not Found"
          },
          "extraction_errors": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Extraction Errors"
          }
        },
        "type": "object",
        "required": [
          "installed",
          "already_installed",
          "not_found",
          "extraction_errors"
        ],
        "title": "SandboxInstallSkillsResponse",
        "description": "Response from skill installation."
      },
      "SandboxListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SandboxResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          },
          "page": {
            "type": "integer",
            "title": "Page",
            "default": 1
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "default": 20
          },
          "status_counts": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Status Counts"
          }
        },
        "type": "object",
        "title": "SandboxListResponse",
        "description": "Paginated list of sandboxes."
      },
      "SandboxMetricsResponse": {
        "properties": {
          "cpu_percent": {
            "type": "number",
            "title": "Cpu Percent",
            "default": 0.0
          },
          "memory_used_mb": {
            "type": "integer",
            "title": "Memory Used Mb",
            "default": 0
          },
          "memory_limit_mb": {
            "type": "integer",
            "title": "Memory Limit Mb",
            "default": 0
          },
          "disk_used_mb": {
            "type": "integer",
            "title": "Disk Used Mb",
            "default": 0
          },
          "disk_limit_mb": {
            "type": "integer",
            "title": "Disk Limit Mb",
            "default": 0
          },
          "uptime_seconds": {
            "type": "integer",
            "title": "Uptime Seconds",
            "default": 0
          }
        },
        "type": "object",
        "title": "SandboxMetricsResponse",
        "description": "Real-time container resource usage."
      },
      "SandboxResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "user_id": {
            "type": "string",
            "format": "uuid",
            "title": "User Id"
          },
          "user_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "image": {
            "type": "string",
            "title": "Image"
          },
          "container_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Container Id"
          },
          "volume_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Volume Name"
          },
          "workspace_path": {
            "type": "string",
            "title": "Workspace Path",
            "default": "/workspace"
          },
          "created_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created At"
          },
          "last_activity_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Activity At"
          },
          "stopped_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stopped At"
          },
          "memory_mb": {
            "type": "integer",
            "title": "Memory Mb",
            "default": 512
          },
          "cpu_cores": {
            "type": "number",
            "title": "Cpu Cores",
            "default": 1.0
          },
          "disk_mb": {
            "type": "integer",
            "title": "Disk Mb",
            "default": 1024
          },
          "idle_timeout_seconds": {
            "type": "integer",
            "title": "Idle Timeout Seconds",
            "default": 1800
          },
          "network_enabled": {
            "type": "boolean",
            "title": "Network Enabled",
            "default": false
          },
          "exec_count": {
            "type": "integer",
            "title": "Exec Count",
            "default": 0
          },
          "exec_total_ms": {
            "type": "integer",
            "title": "Exec Total Ms",
            "default": 0
          },
          "bytes_uploaded": {
            "type": "integer",
            "title": "Bytes Uploaded",
            "default": 0
          },
          "bytes_downloaded": {
            "type": "integer",
            "title": "Bytes Downloaded",
            "default": 0
          },
          "session_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Session Key"
          },
          "skills": {
            "items": {
              "$ref": "#/components/schemas/SandboxSkillInfo"
            },
            "type": "array",
            "title": "Skills"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "status",
          "image"
        ],
        "title": "SandboxResponse",
        "description": "Response for sandbox operations."
      },
      "SandboxSettingsResponse": {
        "properties": {
          "provider_type": {
            "type": "string",
            "enum": [
              "docker",
              "k8s",
              "agent-sandbox"
            ],
            "title": "Provider Type"
          },
          "warm_pool_enabled": {
            "type": "boolean",
            "title": "Warm Pool Enabled"
          },
          "default_max_per_user": {
            "type": "integer",
            "title": "Default Max Per User"
          },
          "idle_timeout_seconds": {
            "type": "integer",
            "title": "Idle Timeout Seconds"
          },
          "stopped_retention_seconds": {
            "type": "integer",
            "title": "Stopped Retention Seconds"
          },
          "config_fallback_image": {
            "type": "string",
            "title": "Config Fallback Image"
          },
          "db_default_image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Db Default Image"
          },
          "env_allowlist": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Env Allowlist"
          },
          "db_active_images": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Db Active Images"
          },
          "k8s_namespace": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "K8S Namespace"
          }
        },
        "type": "object",
        "required": [
          "provider_type",
          "warm_pool_enabled",
          "default_max_per_user",
          "idle_timeout_seconds",
          "stopped_retention_seconds",
          "config_fallback_image",
          "db_default_image",
          "env_allowlist",
          "db_active_images"
        ],
        "title": "SandboxSettingsResponse",
        "description": "Current sandbox configuration (env + DB)."
      },
      "SandboxSettingsUpdate": {
        "properties": {
          "default_max_per_user": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Max Per User"
          },
          "idle_timeout_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Idle Timeout Seconds"
          },
          "stopped_retention_seconds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stopped Retention Seconds"
          },
          "warm_pool_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Warm Pool Enabled"
          }
        },
        "type": "object",
        "title": "SandboxSettingsUpdate",
        "description": "Admin-editable sandbox settings."
      },
      "SandboxSkillInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "installed_at": {
            "type": "string",
            "title": "Installed At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "installed_at"
        ],
        "title": "SandboxSkillInfo",
        "description": "Skill installed in a sandbox."
      },
      "SandboxStatsResponse": {
        "properties": {
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          },
          "running": {
            "type": "integer",
            "title": "Running",
            "default": 0
          },
          "stopped": {
            "type": "integer",
            "title": "Stopped",
            "default": 0
          },
          "archived": {
            "type": "integer",
            "title": "Archived",
            "default": 0
          },
          "destroyed": {
            "type": "integer",
            "title": "Destroyed",
            "default": 0
          },
          "total_memory_mb": {
            "type": "integer",
            "title": "Total Memory Mb",
            "default": 0
          },
          "total_cpu_cores": {
            "type": "number",
            "title": "Total Cpu Cores",
            "default": 0.0
          }
        },
        "type": "object",
        "title": "SandboxStatsResponse",
        "description": "Aggregate sandbox counts and resource totals."
      },
      "SandboxUpdate": {
        "properties": {
          "idle_timeout_seconds": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 86400.0,
                "minimum": 60.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Idle Timeout Seconds"
          },
          "env_vars": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Env Vars"
          },
          "network_enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Network Enabled"
          },
          "memory_mb": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 8192.0,
                "minimum": 128.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Memory Mb"
          },
          "cpu_cores": {
            "anyOf": [
              {
                "type": "number",
                "maximum": 8.0,
                "minimum": 0.25
              },
              {
                "type": "null"
              }
            ],
            "title": "Cpu Cores"
          }
        },
        "type": "object",
        "title": "SandboxUpdate",
        "description": "PATCH request for updating sandbox configuration.\n\nFields are optional \u2014 only set fields are applied.\nSee REQUIRES_RESTART for fields that need the sandbox stopped first."
      },
      "SaveRequirementsRequest": {
        "properties": {
          "requirements": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Requirements",
            "description": "List of requirement dictionaries to save"
          },
          "values": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Values",
            "description": "Admin-provided credential values (name -> plaintext)"
          },
          "credential_mode": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "managed",
                  "user_provided",
                  "none"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Credential Mode",
            "description": "Server-level credential mode to set"
          }
        },
        "type": "object",
        "required": [
          "requirements"
        ],
        "title": "SaveRequirementsRequest",
        "description": "Request to save analyzed requirements to a server."
      },
      "SchemaCorrection": {
        "properties": {
          "corrected_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Corrected Schema"
          },
          "explanation": {
            "type": "string",
            "title": "Explanation"
          },
          "changes_made": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Changes Made"
          }
        },
        "type": "object",
        "required": [
          "corrected_schema",
          "explanation",
          "changes_made"
        ],
        "title": "SchemaCorrection",
        "description": "Response schema for AI schema correction."
      },
      "SchemaCorrectionRequest": {
        "properties": {
          "schema_json": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schema Json",
            "description": "Current editor content; falls back to DB"
          },
          "prompt": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Prompt"
          },
          "selected_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Selected Text"
          }
        },
        "type": "object",
        "title": "SchemaCorrectionRequest",
        "description": "Optional request body for AI schema correction."
      },
      "ServerAssignResponse": {
        "properties": {
          "tools_added": {
            "type": "integer",
            "title": "Tools Added"
          },
          "tools_existing": {
            "type": "integer",
            "title": "Tools Existing"
          }
        },
        "type": "object",
        "required": [
          "tools_added",
          "tools_existing"
        ],
        "title": "ServerAssignResponse",
        "description": "Response for POST /bundles/{id}/servers/{server_id}."
      },
      "ServerConnectionOptions": {
        "properties": {
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id",
            "description": "Server UUID"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Server display name"
          },
          "credential_mode": {
            "$ref": "#/components/schemas/CredentialMode",
            "description": "How credentials are handled: 'none' (no auth needed), 'managed' (admin provides shared credentials), 'user_provided' (users provide their own)"
          },
          "oauth_apps": {
            "items": {
              "$ref": "#/components/schemas/OAuthAppSummary"
            },
            "type": "array",
            "title": "Oauth Apps",
            "description": "OAuth apps available for connecting to this server"
          },
          "allowed_credential_types": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Allowed Credential Types",
            "description": "Credential types users can provide: 'oauth', 'api_key', 'bearer', 'basic'"
          },
          "existing_connections": {
            "items": {
              "$ref": "#/components/schemas/ExistingConnectionSummary"
            },
            "type": "array",
            "title": "Existing Connections",
            "description": "User's existing connections to this server"
          }
        },
        "type": "object",
        "required": [
          "server_id",
          "server_name",
          "credential_mode"
        ],
        "title": "ServerConnectionOptions",
        "description": "Schema for server connection options response.\n\nReturns what connection options are available for a server, including:\n- OAuth apps that can be used to connect\n- Whether API keys can be provided directly\n- Existing user connections to this server\n\nThis is used by the frontend to render the connection dialog with\nappropriate options based on server configuration.\n\nExample:\n    options = ServerConnectionOptions(\n        server_id=uuid.uuid4(),\n        server_name=\"GitHub MCP Server\",\n        credential_mode=CredentialMode.USER_PROVIDED,\n        oauth_apps=[\n            OAuthAppSummary(\n                id=uuid.uuid4(),\n                alias=\"github-prod\",\n                name=\"GitHub Production\",\n                template_type=OAuthAppType.GITHUB,\n                template_name=\"GitHub\",\n            ),\n        ],\n        allowed_credential_types=[\"oauth\", \"api_key\", \"bearer\"],\n        existing_connections=[],\n    )"
      },
      "ServerLoadItem": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Server display name"
          },
          "call_count": {
            "type": "integer",
            "title": "Call Count",
            "description": "Number of calls in period"
          },
          "percentage": {
            "type": "number",
            "title": "Percentage",
            "description": "Percentage of total calls (0-100)"
          },
          "success_rate": {
            "type": "number",
            "title": "Success Rate",
            "description": "Success rate for this server (0-100)"
          }
        },
        "type": "object",
        "required": [
          "name",
          "call_count",
          "percentage",
          "success_rate"
        ],
        "title": "ServerLoadItem",
        "description": "Load data for a single server."
      },
      "ServerOAuthConfigCreate": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "OAuth provider: github, slack, google, custom"
          },
          "client_id": {
            "type": "string",
            "title": "Client Id",
            "description": "OAuth client ID"
          },
          "client_secret": {
            "type": "string",
            "title": "Client Secret",
            "description": "OAuth client secret (will be encrypted)"
          },
          "authorize_url": {
            "type": "string",
            "title": "Authorize Url",
            "description": "OAuth authorization endpoint"
          },
          "token_url": {
            "type": "string",
            "title": "Token Url",
            "description": "OAuth token endpoint"
          },
          "refresh_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Url",
            "description": "Token refresh endpoint (defaults to token_url)"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scopes",
            "description": "Default OAuth scopes"
          },
          "token_endpoint_auth_method": {
            "type": "string",
            "title": "Token Endpoint Auth Method",
            "description": "Token endpoint auth method: client_secret_post or client_secret_basic",
            "default": "client_secret_post"
          },
          "pkce_required": {
            "type": "boolean",
            "title": "Pkce Required",
            "description": "Whether to use PKCE",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "provider",
          "client_id",
          "client_secret",
          "authorize_url",
          "token_url"
        ],
        "title": "ServerOAuthConfigCreate",
        "description": "Schema for configuring OAuth on an MCP server."
      },
      "ServerOAuthConfigResponse": {
        "properties": {
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "client_id": {
            "type": "string",
            "title": "Client Id"
          },
          "client_secret_masked": {
            "type": "string",
            "title": "Client Secret Masked",
            "description": "Masked client secret (first 4 + last 4 chars)"
          },
          "authorize_url": {
            "type": "string",
            "title": "Authorize Url"
          },
          "token_url": {
            "type": "string",
            "title": "Token Url"
          },
          "refresh_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Url"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scopes"
          },
          "token_endpoint_auth_method": {
            "type": "string",
            "title": "Token Endpoint Auth Method"
          },
          "pkce_required": {
            "type": "boolean",
            "title": "Pkce Required"
          }
        },
        "type": "object",
        "required": [
          "provider",
          "client_id",
          "client_secret_masked",
          "authorize_url",
          "token_url",
          "scopes",
          "token_endpoint_auth_method",
          "pkce_required"
        ],
        "title": "ServerOAuthConfigResponse",
        "description": "Schema for OAuth config response (secret is masked)."
      },
      "ServerSource": {
        "type": "string",
        "enum": [
          "manual",
          "generated",
          "imported",
          "curated"
        ],
        "title": "ServerSource",
        "description": "How the MCP server was created."
      },
      "ServerSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "Server UUID"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Server unique name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Human-readable display name"
          },
          "logo_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Logo Url",
            "description": "Server logo URL from config"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name"
        ],
        "title": "ServerSummary",
        "description": "Summary of an MCP server for connected accounts display.\n\nThis provides minimal server info needed for the Gate22-style\nconnected accounts table without loading full server details.\n\nExample:\n    summary = ServerSummary(\n        id=uuid.uuid4(),\n        name=\"github-mcp\",\n        display_name=\"GitHub MCP Server\",\n        logo_url=\"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png\",\n    )"
      },
      "SessionCreate": {
        "properties": {
          "server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Id",
            "description": "Server UUID (mutually exclusive with bundle_id)"
          },
          "bundle_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bundle Id",
            "description": "Bundle UUID (mutually exclusive with server_id)"
          },
          "allowed_tool_names": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Tool Names",
            "description": "If set, only these prefixed tool names are visible in this session"
          }
        },
        "type": "object",
        "title": "SessionCreate",
        "description": "Schema for creating a session."
      },
      "SessionFileInfo": {
        "properties": {
          "path": {
            "type": "string",
            "title": "Path"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "is_directory": {
            "type": "boolean",
            "title": "Is Directory"
          },
          "modified": {
            "type": "string",
            "title": "Modified"
          }
        },
        "type": "object",
        "required": [
          "path",
          "size",
          "is_directory",
          "modified"
        ],
        "title": "SessionFileInfo",
        "description": "Information about a file in the session's virtual filesystem."
      },
      "SessionFilesResponse": {
        "properties": {
          "files": {
            "items": {
              "$ref": "#/components/schemas/SessionFileInfo"
            },
            "type": "array",
            "title": "Files"
          }
        },
        "type": "object",
        "required": [
          "files"
        ],
        "title": "SessionFilesResponse",
        "description": "Response for listing session files."
      },
      "SessionListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SessionResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "SessionListResponse",
        "description": "Schema for paginated session list."
      },
      "SessionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Id"
          },
          "bundle_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bundle Id"
          },
          "process_state": {
            "additionalProperties": true,
            "type": "object",
            "title": "Process State"
          },
          "external_sessions": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "External Sessions"
          },
          "last_accessed_at": {
            "type": "string",
            "format": "date-time",
            "title": "Last Accessed At"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "is_expired": {
            "type": "boolean",
            "title": "Is Expired"
          },
          "is_idle": {
            "type": "boolean",
            "title": "Is Idle"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "allowed_tool_names": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Tool Names"
          }
        },
        "type": "object",
        "required": [
          "id",
          "server_id",
          "bundle_id",
          "process_state",
          "external_sessions",
          "last_accessed_at",
          "expires_at",
          "is_active",
          "is_expired",
          "is_idle",
          "created_at"
        ],
        "title": "SessionResponse",
        "description": "Schema for session response."
      },
      "SessionStatsResponse": {
        "properties": {
          "total_active": {
            "type": "integer",
            "title": "Total Active",
            "description": "Total active sessions"
          },
          "server_sessions": {
            "type": "integer",
            "title": "Server Sessions",
            "description": "Active sessions for servers"
          },
          "bundle_sessions": {
            "type": "integer",
            "title": "Bundle Sessions",
            "description": "Active sessions for bundles"
          },
          "expired_not_cleaned": {
            "type": "integer",
            "title": "Expired Not Cleaned",
            "description": "Expired sessions not yet cleaned"
          },
          "idle_sessions": {
            "type": "integer",
            "title": "Idle Sessions",
            "description": "Sessions idle for too long"
          }
        },
        "type": "object",
        "required": [
          "total_active",
          "server_sessions",
          "bundle_sessions",
          "expired_not_cleaned",
          "idle_sessions"
        ],
        "title": "SessionStatsResponse",
        "description": "Schema for session statistics."
      },
      "SessionUpdate": {
        "properties": {
          "allowed_tool_names": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Tool Names",
            "description": "Replace the allowed tool names list. Set to null to remove restriction."
          }
        },
        "type": "object",
        "title": "SessionUpdate",
        "description": "Schema for updating a session (PATCH)."
      },
      "SetupStatusResponse": {
        "properties": {
          "setup_required": {
            "type": "boolean",
            "title": "Setup Required",
            "description": "Whether initial setup is required (no users and setup not completed)"
          },
          "has_users": {
            "type": "boolean",
            "title": "Has Users",
            "description": "Whether any users exist in the system"
          },
          "has_providers": {
            "type": "boolean",
            "title": "Has Providers",
            "description": "Whether at least one OAuth provider is configured"
          },
          "recovery_mode": {
            "type": "boolean",
            "title": "Recovery Mode",
            "description": "Whether setup recovery mode is active"
          }
        },
        "type": "object",
        "required": [
          "setup_required",
          "has_users",
          "has_providers",
          "recovery_mode"
        ],
        "title": "SetupStatusResponse",
        "description": "Response schema for setup status check."
      },
      "SkillCatalogEntryResponse": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "source_url": {
            "type": "string",
            "title": "Source Url"
          },
          "author": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Author"
          },
          "version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          },
          "license": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "License"
          },
          "files": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Files"
          },
          "metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Metadata",
            "description": "Additional metadata including installs count from skills.sh"
          }
        },
        "type": "object",
        "required": [
          "name",
          "description",
          "source",
          "source_url"
        ],
        "title": "SkillCatalogEntryResponse",
        "description": "Response schema for a skill from the catalog (not yet imported)."
      },
      "SkillCatalogListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SkillCatalogEntryResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "source",
          "total"
        ],
        "title": "SkillCatalogListResponse",
        "description": "Response schema for skill catalog listing."
      },
      "SkillCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Name",
            "description": "Skill name (lowercase with hyphens, max 64 chars)",
            "examples": [
              "github-pr-reviewer"
            ]
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Skill description (max 1024 chars)",
            "examples": [
              "Reviews GitHub PRs with best practices"
            ]
          },
          "skill_md_content": {
            "type": "string",
            "title": "Skill Md Content",
            "description": "Full SKILL.md content with YAML frontmatter"
          },
          "mcp_server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Id",
            "description": "Optional MCP server to link this skill to"
          },
          "skill_metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Skill Metadata",
            "description": "Additional metadata (author, version, tags, etc.)"
          }
        },
        "type": "object",
        "required": [
          "name",
          "skill_md_content"
        ],
        "title": "SkillCreate",
        "description": "Schema for creating a skill from generated content."
      },
      "SkillDetailResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "source_type": {
            "$ref": "#/components/schemas/SkillSourceType"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "mcp_server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Id"
          },
          "mcp_server_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Name",
            "description": "Display name of linked MCP server"
          },
          "skill_metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Skill Metadata"
          },
          "package_size_bytes": {
            "type": "integer",
            "title": "Package Size Bytes",
            "description": "Size of the .skill package in bytes"
          },
          "portal_visible": {
            "type": "boolean",
            "title": "Portal Visible",
            "description": "Whether this skill is visible in the customer portal",
            "default": false
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category",
            "description": "Portal display category"
          },
          "portal_tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Portal Tags",
            "description": "Portal display tags"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "skill_md_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Md Content"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "source_type",
          "source_url",
          "mcp_server_id",
          "skill_metadata",
          "package_size_bytes",
          "created_at",
          "updated_at",
          "skill_md_content"
        ],
        "title": "SkillDetailResponse",
        "description": "Detailed response including SKILL.md content."
      },
      "SkillImportRequest": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source",
            "description": "Source catalog name or GitHub URL",
            "examples": [
              "anthropics",
              "https://github.com/anthropics/skills"
            ]
          },
          "skill_name": {
            "type": "string",
            "title": "Skill Name",
            "description": "Skill name in the catalog",
            "examples": [
              "code-reviewer"
            ]
          },
          "mcp_server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Id",
            "description": "Optional MCP server to link this skill to"
          },
          "github_repo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Github Repo",
            "description": "GitHub repo (owner/repo) for disambiguation when same name exists",
            "examples": [
              "anthropics/skills",
              "sickn33/antigravity-awesome-skills"
            ]
          }
        },
        "type": "object",
        "required": [
          "source",
          "skill_name"
        ],
        "title": "SkillImportRequest",
        "description": "Request schema for importing a skill from a catalog."
      },
      "SkillListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SkillResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "offset",
          "limit"
        ],
        "title": "SkillListResponse",
        "description": "Response schema for skill list."
      },
      "SkillResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "source_type": {
            "$ref": "#/components/schemas/SkillSourceType"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "mcp_server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Id"
          },
          "mcp_server_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Name",
            "description": "Display name of linked MCP server"
          },
          "skill_metadata": {
            "additionalProperties": true,
            "type": "object",
            "title": "Skill Metadata"
          },
          "package_size_bytes": {
            "type": "integer",
            "title": "Package Size Bytes",
            "description": "Size of the .skill package in bytes"
          },
          "portal_visible": {
            "type": "boolean",
            "title": "Portal Visible",
            "description": "Whether this skill is visible in the customer portal",
            "default": false
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category",
            "description": "Portal display category"
          },
          "portal_tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Portal Tags",
            "description": "Portal display tags"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "source_type",
          "source_url",
          "mcp_server_id",
          "skill_metadata",
          "package_size_bytes",
          "created_at",
          "updated_at"
        ],
        "title": "SkillResponse",
        "description": "Response schema for a single skill."
      },
      "SkillSourceType": {
        "type": "string",
        "enum": [
          "imported",
          "generated",
          "manual"
        ],
        "title": "SkillSourceType",
        "description": "How the skill was created."
      },
      "SkillTemplate": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Template identifier"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Template display name"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "What this template is for"
          },
          "category": {
            "type": "string",
            "title": "Category",
            "description": "Template category"
          },
          "skill_md_template": {
            "type": "string",
            "title": "Skill Md Template",
            "description": "SKILL.md template content with placeholders"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags",
            "description": "Template tags"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "category",
          "skill_md_template"
        ],
        "title": "SkillTemplate",
        "description": "A predefined skill template."
      },
      "SkillTemplateListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SkillTemplate"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "SkillTemplateListResponse",
        "description": "Response for listing skill templates."
      },
      "SkillUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "New skill name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "New description"
          },
          "skill_md_content": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Md Content",
            "description": "New SKILL.md content"
          },
          "mcp_server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Mcp Server Id",
            "description": "MCP server to link to"
          },
          "skill_metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Skill Metadata",
            "description": "New metadata (replaces existing)"
          },
          "clear_server_link": {
            "type": "boolean",
            "title": "Clear Server Link",
            "description": "If true, removes the MCP server link",
            "default": false
          },
          "portal_visible": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Visible",
            "description": "Whether this skill is visible in the customer portal"
          },
          "portal_category": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Category",
            "description": "Portal display category"
          },
          "portal_tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Portal Tags",
            "description": "Portal display tags"
          }
        },
        "type": "object",
        "title": "SkillUpdate",
        "description": "Schema for updating a skill."
      },
      "StarterKitConfigResponse": {
        "properties": {
          "skills": {
            "items": {
              "$ref": "#/components/schemas/StarterKitSkillItem"
            },
            "type": "array",
            "title": "Skills"
          },
          "servers": {
            "items": {
              "$ref": "#/components/schemas/StarterKitServerItem"
            },
            "type": "array",
            "title": "Servers"
          }
        },
        "type": "object",
        "required": [
          "skills",
          "servers"
        ],
        "title": "StarterKitConfigResponse",
        "description": "GET /api/v1/starter-kit response.\n\nReturns the available skills and servers for the onboarding wizard."
      },
      "StarterKitServerItem": {
        "properties": {
          "catalog_name": {
            "type": "string",
            "title": "Catalog Name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "category": {
            "type": "string",
            "title": "Category"
          },
          "icon_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Icon Url"
          },
          "server_type": {
            "type": "string",
            "title": "Server Type"
          },
          "pre_checked": {
            "type": "boolean",
            "title": "Pre Checked"
          },
          "already_activated": {
            "type": "boolean",
            "title": "Already Activated"
          }
        },
        "type": "object",
        "required": [
          "catalog_name",
          "display_name",
          "description",
          "category",
          "icon_url",
          "server_type",
          "pre_checked",
          "already_activated"
        ],
        "title": "StarterKitServerItem",
        "description": "A server enriched with catalog metadata for the starter kit."
      },
      "StarterKitSetupRequest": {
        "properties": {
          "server_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Server Names"
          }
        },
        "type": "object",
        "required": [
          "server_names"
        ],
        "title": "StarterKitSetupRequest",
        "description": "POST /api/v1/starter-kit/setup request body.\n\nFix #7: deduplicated, max 10 entries."
      },
      "StarterKitSkillItem": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "source": {
            "type": "string",
            "title": "Source"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "already_imported": {
            "type": "boolean",
            "title": "Already Imported",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "name",
          "source",
          "display_name",
          "description"
        ],
        "title": "StarterKitSkillItem",
        "description": "A skill available in the starter kit config."
      },
      "StatusCounts": {
        "properties": {
          "running": {
            "type": "integer",
            "title": "Running",
            "default": 0
          },
          "deploying": {
            "type": "integer",
            "title": "Deploying",
            "default": 0
          },
          "stopped": {
            "type": "integer",
            "title": "Stopped",
            "default": 0
          },
          "pending": {
            "type": "integer",
            "title": "Pending",
            "default": 0
          },
          "error": {
            "type": "integer",
            "title": "Error",
            "default": 0
          }
        },
        "type": "object",
        "title": "StatusCounts",
        "description": "Count of servers by status."
      },
      "SuccessRateTrend": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/HourlyDataPoint"
            },
            "type": "array",
            "title": "Data",
            "description": "Hourly success rate (0-100)"
          },
          "current_rate": {
            "type": "number",
            "title": "Current Rate",
            "description": "Current hour success rate"
          },
          "average_rate": {
            "type": "number",
            "title": "Average Rate",
            "description": "24h average success rate"
          }
        },
        "type": "object",
        "required": [
          "current_rate",
          "average_rate"
        ],
        "title": "SuccessRateTrend",
        "description": "Hourly success rate trend over 24 hours."
      },
      "SyncSchedule": {
        "type": "string",
        "enum": [
          "manual",
          "hourly",
          "daily",
          "weekly"
        ],
        "title": "SyncSchedule",
        "description": "Schedule for tool synchronization."
      },
      "TestConnectionRequest": {
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2083,
            "minLength": 1,
            "format": "uri",
            "title": "Url"
          },
          "auth_method": {
            "$ref": "#/components/schemas/AuthMethod",
            "default": "none"
          },
          "bearer_token": {
            "anyOf": [
              {
                "type": "string",
                "format": "password",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "title": "Bearer Token",
            "description": "Bearer token for Authorization header (never logged)"
          }
        },
        "type": "object",
        "required": [
          "url"
        ],
        "title": "TestConnectionRequest",
        "description": "Request to test connection to an MCP server.\n\nUses SecretStr for bearer_token to prevent accidental logging."
      },
      "TestConnectionWithoutSaveRequest": {
        "properties": {
          "provider_type": {
            "$ref": "#/components/schemas/ProviderType"
          },
          "provider": {
            "type": "string",
            "title": "Provider",
            "description": "Provider name (e.g., 'openai', 'anthropic')"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "api_key": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Api Key"
          },
          "endpoint": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Endpoint"
          }
        },
        "type": "object",
        "required": [
          "provider_type",
          "provider",
          "model"
        ],
        "title": "TestConnectionWithoutSaveRequest",
        "description": "Request schema for testing connection before saving."
      },
      "TestProviderConnectionResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "verified_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Verified At"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          }
        },
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "title": "TestProviderConnectionResponse",
        "description": "Response from testing provider connection."
      },
      "ThemeOption": {
        "type": "string",
        "enum": [
          "light",
          "dark",
          "system"
        ],
        "title": "ThemeOption",
        "description": "Valid theme options."
      },
      "TokenEndpointAuthMethod": {
        "type": "string",
        "enum": [
          "client_secret_post",
          "client_secret_basic",
          "none"
        ],
        "title": "TokenEndpointAuthMethod",
        "description": "Token endpoint authentication method (RFC 7591).\n\nSpecifies how the client authenticates when exchanging code for tokens."
      },
      "TokenResponse": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "access_token",
          "expires_at"
        ],
        "title": "TokenResponse",
        "description": "Token refresh response."
      },
      "TokenUsageSummary": {
        "properties": {
          "total_input_tokens": {
            "type": "integer",
            "title": "Total Input Tokens"
          },
          "total_output_tokens": {
            "type": "integer",
            "title": "Total Output Tokens"
          },
          "total_tokens": {
            "type": "integer",
            "title": "Total Tokens",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "total_input_tokens",
          "total_output_tokens"
        ],
        "title": "TokenUsageSummary",
        "description": "Summary of token usage for a period or entity."
      },
      "ToolCallLogListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ToolCallLogResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          },
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "offset": {
            "type": "integer",
            "title": "Offset"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "ToolCallLogListResponse",
        "description": "Paginated list of tool call logs."
      },
      "ToolCallLogResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Id"
          },
          "server_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Name"
          },
          "user_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Id"
          },
          "user_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "User Name"
          },
          "tool_name": {
            "type": "string",
            "title": "Tool Name"
          },
          "arguments": {
            "additionalProperties": true,
            "type": "object",
            "title": "Arguments"
          },
          "response": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "latency_ms": {
            "type": "integer",
            "title": "Latency Ms"
          },
          "error_message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Message"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type",
            "default": "server"
          },
          "source_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Name"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "user_id",
          "tool_name",
          "arguments",
          "response",
          "status",
          "latency_ms",
          "error_message",
          "created_at"
        ],
        "title": "ToolCallLogResponse",
        "description": "Response schema for a single tool call log entry."
      },
      "ToolLookupResponse": {
        "properties": {
          "tool_id": {
            "type": "string",
            "format": "uuid",
            "title": "Tool Id"
          },
          "tool_name": {
            "type": "string",
            "title": "Tool Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name"
          },
          "server_type": {
            "$ref": "#/components/schemas/MCPServerType"
          },
          "origin_type": {
            "$ref": "#/components/schemas/OriginType"
          }
        },
        "type": "object",
        "required": [
          "tool_id",
          "tool_name",
          "description",
          "input_schema",
          "server_id",
          "server_name",
          "server_type",
          "origin_type"
        ],
        "title": "ToolLookupResponse",
        "description": "Response for GET /api/v1/tools/by-name."
      },
      "ToolOverrideResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          },
          "has_overrides": {
            "type": "boolean",
            "title": "Has Overrides"
          },
          "override_description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Description"
          },
          "override_input_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Input Schema"
          },
          "override_enrichment_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Override Enrichment Data"
          },
          "enrichment_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enrichment Data"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "input_schema",
          "has_overrides"
        ],
        "title": "ToolOverrideResponse",
        "description": "Response schema after updating tool overrides."
      },
      "ToolOverrideUpdate": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "input_schema": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Input Schema"
          },
          "enrichment_data": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enrichment Data"
          }
        },
        "type": "object",
        "title": "ToolOverrideUpdate",
        "description": "Request schema for PATCH tool overrides.\n\nAll fields are optional. Use model_fields_set to distinguish\n'field omitted' from 'field set to null' (which clears the override)."
      },
      "ToolParameter": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Parameter name (snake_case)"
          },
          "type": {
            "type": "string",
            "title": "Type",
            "description": "Python type annotation (str, int, bool, list, dict, etc.)"
          },
          "description": {
            "type": "string",
            "title": "Description",
            "description": "Human-readable description of what this parameter does"
          },
          "required": {
            "type": "boolean",
            "title": "Required",
            "description": "Whether this parameter is required",
            "default": true
          },
          "default": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Default",
            "description": "Default value as string (None if required)"
          },
          "example": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Example",
            "description": "Example value for documentation"
          }
        },
        "type": "object",
        "required": [
          "name",
          "type",
          "description"
        ],
        "title": "ToolParameter",
        "description": "Parameter definition for a curated tool."
      },
      "ToolScope": {
        "type": "string",
        "enum": [
          "read",
          "write",
          "destructive"
        ],
        "title": "ToolScope",
        "description": "Tool scope for MCP annotations.\n\nIndicates the type of operation for AI clients to understand risk level."
      },
      "ToolSelectionItem": {
        "properties": {
          "tool_id": {
            "type": "string",
            "format": "uuid",
            "title": "Tool Id"
          },
          "tool_name": {
            "type": "string",
            "title": "Tool Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "tool_id",
          "tool_name",
          "description",
          "enabled",
          "created_at",
          "updated_at"
        ],
        "title": "ToolSelectionItem",
        "description": "A single tool selection item."
      },
      "ToolSelectionListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ToolSelectionItem"
            },
            "type": "array",
            "title": "Items"
          }
        },
        "type": "object",
        "required": [
          "items"
        ],
        "title": "ToolSelectionListResponse",
        "description": "Response for listing tool selections."
      },
      "ToolSelectionUpdate": {
        "properties": {
          "tool_ids": {
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "type": "array",
            "title": "Tool Ids"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "type": "object",
        "required": [
          "tool_ids",
          "enabled"
        ],
        "title": "ToolSelectionUpdate",
        "description": "Request to update tool selections."
      },
      "ToolSelectionUpdateResponse": {
        "properties": {
          "updated": {
            "type": "integer",
            "title": "Updated"
          }
        },
        "type": "object",
        "required": [
          "updated"
        ],
        "title": "ToolSelectionUpdateResponse",
        "description": "Response for updating tool selections."
      },
      "ToolSyncResponse": {
        "properties": {
          "added": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Added"
          },
          "removed": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Removed"
          },
          "modified": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Modified"
          },
          "total_tools": {
            "type": "integer",
            "title": "Total Tools"
          },
          "sync_hash": {
            "type": "string",
            "title": "Sync Hash"
          }
        },
        "type": "object",
        "required": [
          "added",
          "removed",
          "modified",
          "total_tools",
          "sync_hash"
        ],
        "title": "ToolSyncResponse",
        "description": "Response schema for tool sync operation."
      },
      "ToolsExecuteRequest": {
        "properties": {
          "server_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Id"
          },
          "server_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Name"
          },
          "tool_name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Tool Name"
          },
          "arguments": {
            "additionalProperties": true,
            "type": "object",
            "title": "Arguments"
          }
        },
        "type": "object",
        "required": [
          "tool_name"
        ],
        "title": "ToolsExecuteRequest",
        "description": "Request for POST /api/v1/tools/execute."
      },
      "ToolsExecuteResponse": {
        "properties": {
          "result": {
            "title": "Result"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "tool_name": {
            "type": "string",
            "title": "Tool Name"
          },
          "duration_ms": {
            "type": "integer",
            "title": "Duration Ms"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "result",
          "server_id",
          "tool_name",
          "duration_ms"
        ],
        "title": "ToolsExecuteResponse",
        "description": "Response for POST /api/v1/tools/execute."
      },
      "ToolsSearchRequest": {
        "properties": {
          "query": {
            "type": "string",
            "maxLength": 1000,
            "minLength": 1,
            "title": "Query"
          },
          "limit": {
            "type": "integer",
            "maximum": 50.0,
            "minimum": 1.0,
            "title": "Limit",
            "default": 10
          },
          "server_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Ids",
            "description": "Optional server IDs to restrict search scope"
          },
          "bundle_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bundle Id",
            "description": "Optional bundle ID to restrict search to bundle tools"
          },
          "agent_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id",
            "description": "Optional agent ID (resolved to bundle_id internally)"
          }
        },
        "type": "object",
        "required": [
          "query"
        ],
        "title": "ToolsSearchRequest",
        "description": "Request for POST /api/v1/tools/search."
      },
      "ToolsSearchResponse": {
        "properties": {
          "tools": {
            "items": {
              "$ref": "#/components/schemas/ToolsSearchResult"
            },
            "type": "array",
            "title": "Tools"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "tools",
          "total"
        ],
        "title": "ToolsSearchResponse",
        "description": "Response for POST /api/v1/tools/search."
      },
      "ToolsSearchResult": {
        "properties": {
          "tool_id": {
            "type": "string",
            "format": "uuid",
            "title": "Tool Id"
          },
          "tool_name": {
            "type": "string",
            "title": "Tool Name"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "server_id": {
            "type": "string",
            "format": "uuid",
            "title": "Server Id"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name"
          },
          "score": {
            "type": "number",
            "maximum": 1.0,
            "minimum": 0.0,
            "title": "Score"
          },
          "input_schema": {
            "additionalProperties": true,
            "type": "object",
            "title": "Input Schema"
          }
        },
        "type": "object",
        "required": [
          "tool_id",
          "tool_name",
          "description",
          "server_id",
          "server_name",
          "score",
          "input_schema"
        ],
        "title": "ToolsSearchResult",
        "description": "Single tool search result."
      },
      "TopServer": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Server UUID"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Server identifier name"
          },
          "display_name": {
            "type": "string",
            "title": "Display Name",
            "description": "Human-readable server name"
          },
          "call_count": {
            "type": "integer",
            "title": "Call Count",
            "description": "Number of tool calls in the period"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "display_name",
          "call_count"
        ],
        "title": "TopServer",
        "description": "A server with its call count for ranking."
      },
      "TopSkill": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id",
            "description": "Skill UUID"
          },
          "name": {
            "type": "string",
            "title": "Name",
            "description": "Skill name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Skill description"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type",
            "description": "How the skill was created (imported, generated, manual)"
          },
          "download_count": {
            "type": "integer",
            "title": "Download Count",
            "description": "Number of times downloaded/imported",
            "default": 0
          },
          "usage_count": {
            "type": "integer",
            "title": "Usage Count",
            "description": "Number of times used in playground",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "source_type"
        ],
        "title": "TopSkill",
        "description": "A skill with usage metrics for ranking."
      },
      "TopTool": {
        "properties": {
          "tool_name": {
            "type": "string",
            "title": "Tool Name",
            "description": "Name of the tool"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Name of the server this tool belongs to"
          },
          "server_id": {
            "type": "string",
            "title": "Server Id",
            "description": "Server UUID"
          },
          "call_count": {
            "type": "integer",
            "title": "Call Count",
            "description": "Number of calls in the last 24 hours"
          },
          "success_rate": {
            "type": "number",
            "title": "Success Rate",
            "description": "Percentage of successful calls (0-100)"
          },
          "avg_latency_ms": {
            "type": "number",
            "title": "Avg Latency Ms",
            "description": "Average latency in milliseconds"
          }
        },
        "type": "object",
        "required": [
          "tool_name",
          "server_name",
          "server_id",
          "call_count",
          "success_rate",
          "avg_latency_ms"
        ],
        "title": "TopTool",
        "description": "A tool with usage metrics for ranking."
      },
      "UpgradeOperationResponse": {
        "properties": {
          "operation_id": {
            "type": "string",
            "title": "Operation Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "target_version": {
            "type": "string",
            "title": "Target Version"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          }
        },
        "type": "object",
        "required": [
          "operation_id",
          "status",
          "target_version",
          "created_at"
        ],
        "title": "UpgradeOperationResponse",
        "description": "Response from the upgrade status endpoint."
      },
      "UpgradeRequest": {
        "properties": {
          "target_version": {
            "type": "string",
            "title": "Target Version"
          }
        },
        "type": "object",
        "required": [
          "target_version"
        ],
        "title": "UpgradeRequest",
        "description": "Request body for triggering an upgrade."
      },
      "UpgradeResponse": {
        "properties": {
          "operation_id": {
            "type": "string",
            "title": "Operation Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "target_version": {
            "type": "string",
            "title": "Target Version"
          }
        },
        "type": "object",
        "required": [
          "operation_id",
          "status",
          "target_version"
        ],
        "title": "UpgradeResponse",
        "description": "Response from the upgrade trigger endpoint."
      },
      "UsageEventResponse": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "sandbox_id": {
            "type": "string",
            "title": "Sandbox Id"
          },
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "quantity": {
            "type": "integer",
            "title": "Quantity",
            "default": 0
          },
          "metadata": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Metadata"
          },
          "created_at": {
            "type": "string",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "sandbox_id",
          "user_id",
          "event_type",
          "created_at"
        ],
        "title": "UsageEventResponse",
        "description": "Single usage event record."
      },
      "UsageQueryResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UsageEventResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "default": 0
          },
          "page": {
            "type": "integer",
            "title": "Page",
            "default": 1
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "default": 50
          }
        },
        "type": "object",
        "title": "UsageQueryResponse",
        "description": "Paginated list of usage events."
      },
      "UsageSummaryEntry": {
        "properties": {
          "user_id": {
            "type": "string",
            "title": "User Id"
          },
          "total_exec_count": {
            "type": "integer",
            "title": "Total Exec Count",
            "default": 0
          },
          "total_exec_ms": {
            "type": "integer",
            "title": "Total Exec Ms",
            "default": 0
          },
          "total_bytes_uploaded": {
            "type": "integer",
            "title": "Total Bytes Uploaded",
            "default": 0
          },
          "total_bytes_downloaded": {
            "type": "integer",
            "title": "Total Bytes Downloaded",
            "default": 0
          },
          "sandbox_count": {
            "type": "integer",
            "title": "Sandbox Count",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "user_id"
        ],
        "title": "UsageSummaryEntry",
        "description": "Per-user usage summary for a billing period."
      },
      "UsageSummaryResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UsageSummaryEntry"
            },
            "type": "array",
            "title": "Items"
          },
          "period_start": {
            "type": "string",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "title": "Period End"
          }
        },
        "type": "object",
        "required": [
          "period_start",
          "period_end"
        ],
        "title": "UsageSummaryResponse",
        "description": "Aggregated usage summary across users."
      },
      "UserAdminListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UserAdminResponse"
            },
            "type": "array",
            "title": "Items",
            "description": "List of users"
          },
          "total": {
            "type": "integer",
            "title": "Total",
            "description": "Total number of users matching criteria"
          },
          "page": {
            "type": "integer",
            "title": "Page",
            "description": "Current page number (1-indexed)"
          },
          "page_size": {
            "type": "integer",
            "title": "Page Size",
            "description": "Number of items per page"
          },
          "has_next": {
            "type": "boolean",
            "title": "Has Next",
            "description": "Whether there are more pages"
          }
        },
        "type": "object",
        "required": [
          "total",
          "page",
          "page_size",
          "has_next"
        ],
        "title": "UserAdminListResponse",
        "description": "Schema for paginated admin user list response."
      },
      "UserAdminResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "Unique user identifier"
          },
          "email": {
            "type": "string",
            "title": "Email",
            "description": "User email address"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "User display name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url",
            "description": "User avatar URL"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole",
            "description": "User role (owner, admin, member)"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "description": "Whether user account is active"
          },
          "deactivated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deactivated At",
            "description": "When user was deactivated (if applicable)"
          },
          "api_key_count": {
            "type": "integer",
            "title": "Api Key Count",
            "description": "Number of active API keys",
            "default": 0
          },
          "last_login_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At",
            "description": "Last login timestamp"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "When user was created"
          },
          "can_change_role": {
            "type": "boolean",
            "title": "Can Change Role",
            "description": "Whether the current admin can change this user's role",
            "default": true
          },
          "can_deactivate": {
            "type": "boolean",
            "title": "Can Deactivate",
            "description": "Whether the current admin can deactivate this user",
            "default": true
          },
          "can_delete": {
            "type": "boolean",
            "title": "Can Delete",
            "description": "Whether the current admin can delete this user",
            "default": true
          },
          "available_roles": {
            "items": {
              "$ref": "#/components/schemas/UserRole"
            },
            "type": "array",
            "title": "Available Roles",
            "description": "Roles the current admin can assign to this user"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "is_active",
          "created_at"
        ],
        "title": "UserAdminResponse",
        "description": "Schema for user response in admin context with permission hints."
      },
      "UserApiKeyCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "description": "Key name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "title": "Description",
            "description": "Key description"
          },
          "environment": {
            "$ref": "#/components/schemas/ApiKeyEnvironment",
            "description": "Key environment",
            "default": "live"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes",
            "description": "Permission scopes (e.g., ['read', 'write'])"
          },
          "rate_limit_rpm": {
            "type": "integer",
            "maximum": 10000.0,
            "minimum": 1.0,
            "title": "Rate Limit Rpm",
            "description": "Rate limit (requests per minute)",
            "default": 60
          },
          "expires_in_days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 365.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires In Days",
            "description": "Days until expiration (None = no expiration)"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At",
            "description": "Explicit expiration datetime (ISO 8601). Takes precedence over expires_in_days."
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "UserApiKeyCreate",
        "description": "Schema for creating a user API key."
      },
      "UserApiKeyCreateResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "key_prefix": {
            "type": "string",
            "title": "Key Prefix",
            "description": "First ~20 chars for identification"
          },
          "environment": {
            "$ref": "#/components/schemas/ApiKeyEnvironment"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes"
          },
          "rate_limit_rpm": {
            "type": "integer",
            "title": "Rate Limit Rpm"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "last_used_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used Ip"
          },
          "key": {
            "type": "string",
            "title": "Key",
            "description": "Full API key - ONLY shown once at creation time. Store it securely!"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "key_prefix",
          "environment",
          "rate_limit_rpm",
          "is_active",
          "created_at",
          "updated_at",
          "key"
        ],
        "title": "UserApiKeyCreateResponse",
        "description": "Schema for API key creation response (includes secret once)."
      },
      "UserApiKeyListResponse": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/UserApiKeyResponse"
            },
            "type": "array",
            "title": "Items"
          },
          "total": {
            "type": "integer",
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "title": "UserApiKeyListResponse",
        "description": "Schema for API key list response."
      },
      "UserApiKeyResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "key_prefix": {
            "type": "string",
            "title": "Key Prefix",
            "description": "First ~20 chars for identification"
          },
          "environment": {
            "$ref": "#/components/schemas/ApiKeyEnvironment"
          },
          "scopes": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scopes"
          },
          "rate_limit_rpm": {
            "type": "integer",
            "title": "Rate Limit Rpm"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "last_used_ip": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used Ip"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "key_prefix",
          "environment",
          "rate_limit_rpm",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "UserApiKeyResponse",
        "description": "Schema for user API key response (without secret)."
      },
      "UserApiKeyRevokeRequest": {
        "properties": {
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Reason",
            "description": "Revocation reason"
          }
        },
        "type": "object",
        "title": "UserApiKeyRevokeRequest",
        "description": "Schema for API key revocation request."
      },
      "UserApiKeyRotateRequest": {
        "properties": {
          "grace_period_hours": {
            "type": "integer",
            "maximum": 168.0,
            "minimum": 0.0,
            "title": "Grace Period Hours",
            "description": "Hours to keep old key active (for transition)",
            "default": 24
          }
        },
        "type": "object",
        "title": "UserApiKeyRotateRequest",
        "description": "Schema for API key rotation request."
      },
      "UserApiKeyRotateResponse": {
        "properties": {
          "new_key": {
            "$ref": "#/components/schemas/UserApiKeyCreateResponse"
          },
          "old_key_revoked": {
            "type": "boolean",
            "title": "Old Key Revoked",
            "description": "Whether old key was immediately revoked (grace_period=0)"
          },
          "grace_period_ends_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grace Period Ends At",
            "description": "When old key will be auto-revoked (if grace period set)"
          }
        },
        "type": "object",
        "required": [
          "new_key",
          "old_key_revoked"
        ],
        "title": "UserApiKeyRotateResponse",
        "description": "Schema for API key rotation response."
      },
      "UserCreateAdmin": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email",
            "description": "User email address"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "User display name"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole",
            "description": "User role",
            "default": "member"
          },
          "create_api_key": {
            "type": "boolean",
            "title": "Create Api Key",
            "description": "If true, create an API key and return it with the user",
            "default": false
          },
          "api_key_config": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiKeyConfigInline"
              },
              {
                "type": "null"
              }
            ],
            "description": "API key configuration (only used if create_api_key is true)"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "UserCreateAdmin",
        "description": "Schema for admin creating a user directly (no OAuth)."
      },
      "UserCreateAdminResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "User ID"
          },
          "email": {
            "type": "string",
            "title": "Email",
            "description": "User email"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "User display name"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole",
            "description": "User role"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active",
            "description": "Whether user is active"
          },
          "email_verified": {
            "type": "boolean",
            "title": "Email Verified",
            "description": "Whether email is verified"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At",
            "description": "Creation timestamp"
          },
          "api_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ApiKeyInResponse"
              },
              {
                "type": "null"
              }
            ],
            "description": "API key (only present if create_api_key was true)"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "is_active",
          "email_verified",
          "created_at"
        ],
        "title": "UserCreateAdminResponse",
        "description": "Response schema for admin user creation."
      },
      "UserCredentialsRequest": {
        "properties": {
          "credentials": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "minProperties": 1,
            "title": "Credentials",
            "description": "Map of credential name to value"
          }
        },
        "type": "object",
        "required": [
          "credentials"
        ],
        "title": "UserCredentialsRequest",
        "description": "Request to submit user-provided credentials for a server.\n\nUsed by non-admin users to provide their own credentials for servers\nthat have user_provided credential requirements."
      },
      "UserCredentialsResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status",
            "description": "Status of the operation"
          },
          "credential_count": {
            "type": "integer",
            "title": "Credential Count",
            "description": "Number of credentials saved"
          },
          "server_id": {
            "type": "string",
            "title": "Server Id",
            "description": "Server UUID"
          },
          "server_name": {
            "type": "string",
            "title": "Server Name",
            "description": "Human-readable server name"
          }
        },
        "type": "object",
        "required": [
          "status",
          "credential_count",
          "server_id",
          "server_name"
        ],
        "title": "UserCredentialsResponse",
        "description": "Response after successfully submitting user credentials.\n\nReturns the status and count of credentials saved."
      },
      "UserDeleteConfirm": {
        "properties": {
          "confirm_email": {
            "type": "string",
            "title": "Confirm Email",
            "description": "Enter the user's email to confirm deletion"
          }
        },
        "type": "object",
        "required": [
          "confirm_email"
        ],
        "title": "UserDeleteConfirm",
        "description": "Schema for confirming user deletion.\n\nRequires entering the user's email to confirm permanent deletion."
      },
      "UserInfo": {
        "properties": {
          "id": {
            "type": "string",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "provider": {
            "type": "string",
            "title": "Provider"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "last_login_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "name",
          "avatar_url",
          "provider",
          "role",
          "created_at",
          "last_login_at"
        ],
        "title": "UserInfo",
        "description": "Current user info response."
      },
      "UserMeResponse": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "email_verified": {
            "type": "boolean",
            "title": "Email Verified"
          },
          "sso_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sso Provider"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "last_login_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At"
          },
          "api_key_count": {
            "type": "integer",
            "title": "Api Key Count",
            "description": "Number of active API keys",
            "default": 0
          },
          "connection_count": {
            "type": "integer",
            "title": "Connection Count",
            "description": "Number of active service connections",
            "default": 0
          }
        },
        "type": "object",
        "required": [
          "email",
          "id",
          "role",
          "is_active",
          "email_verified",
          "created_at",
          "updated_at"
        ],
        "title": "UserMeResponse",
        "description": "Schema for current user response with additional details."
      },
      "UserPreferencesResponse": {
        "properties": {
          "theme": {
            "type": "string",
            "title": "Theme"
          },
          "default_page": {
            "type": "string",
            "title": "Default Page"
          },
          "locale": {
            "type": "string",
            "title": "Locale"
          },
          "items_per_page": {
            "type": "integer",
            "title": "Items Per Page"
          }
        },
        "type": "object",
        "required": [
          "theme",
          "default_page",
          "locale",
          "items_per_page"
        ],
        "title": "UserPreferencesResponse",
        "description": "Response schema for user preferences."
      },
      "UserPreferencesUpdate": {
        "properties": {
          "theme": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ThemeOption"
              },
              {
                "type": "null"
              }
            ]
          },
          "default_page": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Default Page"
          },
          "locale": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 10,
                "minLength": 2
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "items_per_page": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100.0,
                "minimum": 5.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Items Per Page"
          }
        },
        "type": "object",
        "title": "UserPreferencesUpdate",
        "description": "Partial update schema -- only provided fields are changed."
      },
      "UserResponse": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "email_verified": {
            "type": "boolean",
            "title": "Email Verified"
          },
          "sso_provider": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sso Provider"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          },
          "last_login_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Login At"
          }
        },
        "type": "object",
        "required": [
          "email",
          "id",
          "role",
          "is_active",
          "email_verified",
          "created_at",
          "updated_at"
        ],
        "title": "UserResponse",
        "description": "Schema for user response."
      },
      "UserRole": {
        "type": "string",
        "enum": [
          "owner",
          "admin",
          "member"
        ],
        "title": "UserRole",
        "description": "User roles (single-tenant, so no org-specific roles yet)."
      },
      "UserStatsResponse": {
        "properties": {
          "total_users": {
            "type": "integer",
            "title": "Total Users",
            "description": "Total number of users"
          },
          "active_users": {
            "type": "integer",
            "title": "Active Users",
            "description": "Number of active users"
          },
          "deactivated_users": {
            "type": "integer",
            "title": "Deactivated Users",
            "description": "Number of deactivated users"
          },
          "pending_invitations": {
            "type": "integer",
            "title": "Pending Invitations",
            "description": "Number of pending invitations"
          },
          "by_role": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "By Role",
            "description": "User count by role (e.g., {'owner': 1, 'admin': 2, 'member': 10})"
          }
        },
        "type": "object",
        "required": [
          "total_users",
          "active_users",
          "deactivated_users",
          "pending_invitations"
        ],
        "title": "UserStatsResponse",
        "description": "Schema for user statistics dashboard."
      },
      "UserSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id",
            "description": "User UUID"
          },
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name",
            "description": "User's display name"
          },
          "email": {
            "type": "string",
            "title": "Email",
            "description": "User's email address"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email"
        ],
        "title": "UserSummary",
        "description": "Summary of a user for connected accounts display.\n\nUsed when showing shared connections where user info may be relevant.\n\nExample:\n    summary = UserSummary(\n        id=uuid.uuid4(),\n        name=\"John Doe\",\n        email=\"john@example.com\",\n    )"
      },
      "UserUpdate": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "avatar_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Avatar Url"
          },
          "role": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UserRole"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          }
        },
        "type": "object",
        "title": "UserUpdate",
        "description": "Schema for updating user fields."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VersionCheckResponse": {
        "properties": {
          "current_version": {
            "type": "string",
            "title": "Current Version"
          },
          "latest_version": {
            "type": "string",
            "title": "Latest Version",
            "default": ""
          },
          "update_available": {
            "type": "boolean",
            "title": "Update Available",
            "default": false
          },
          "severity": {
            "type": "string",
            "title": "Severity",
            "default": "info"
          },
          "release_notes_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Release Notes Url"
          },
          "upgrade_command": {
            "type": "string",
            "title": "Upgrade Command",
            "default": ""
          },
          "published_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Published At"
          },
          "offline_mode": {
            "type": "boolean",
            "title": "Offline Mode",
            "default": false
          },
          "marketplace": {
            "anyOf": [
              {
                "type": "string",
                "const": "azure"
              },
              {
                "type": "null"
              }
            ],
            "title": "Marketplace"
          },
          "images": {
            "anyOf": [
              {
                "additionalProperties": {
                  "type": "string"
                },
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Images"
          },
          "sdk_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sdk Version"
          }
        },
        "type": "object",
        "required": [
          "current_version"
        ],
        "title": "VersionCheckResponse",
        "description": "Response from the version check endpoint."
      },
      "mcpgateway__api__v1__observability_settings__TestConnectionResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "tested_at": {
            "type": "string",
            "format": "date-time",
            "title": "Tested At"
          }
        },
        "type": "object",
        "required": [
          "success",
          "message",
          "tested_at"
        ],
        "title": "TestConnectionResponse",
        "description": "Response from connection test."
      },
      "mcpgateway__schemas__test_connection__TestConnectionResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success"
          },
          "server_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Name"
          },
          "server_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Server Version"
          },
          "protocol_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Protocol Version"
          },
          "tools_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tools Count"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          }
        },
        "type": "object",
        "required": [
          "success"
        ],
        "title": "TestConnectionResponse",
        "description": "Response from testing MCP server connection."
      }
    },
    "securitySchemes": {
      "User API Key": {
        "type": "http",
        "description": "User API key (mgw_usr_live_* or mgw_usr_test_*)",
        "scheme": "bearer"
      }
    }
  }
}