{
    "components": {
        "schemas": {
            "ConnectResponse": {
                "properties": {
                    "authorize_url": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ConnectorAuthStatusItem": {
                "properties": {
                    "connection_status": {
                        "enum": [
                            "ready",
                            "needs_auth",
                            "connected",
                            "not_served"
                        ],
                        "type": "string"
                    },
                    "connector_id": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ConnectorAuthStatusListResponse": {
                "properties": {
                    "statuses": {
                        "items": {
                            "$ref": "#/components/schemas/ConnectorAuthStatusItem"
                        },
                        "type": "array",
                        "uniqueItems": false
                    }
                },
                "type": "object"
            },
            "ConnectorAuthStatusResponse": {
                "properties": {
                    "connection_status": {
                        "enum": [
                            "ready",
                            "needs_auth",
                            "connected",
                            "not_served"
                        ],
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ConnectorStatus": {
                "properties": {
                    "connection_status": {
                        "description": "ConnectionStatus is stubbed in phase 3 (see domain.ConnectorStatus); omitted\nfrom the wire until the catalog join lands.",
                        "type": "string"
                    },
                    "connector_id": {
                        "type": "string"
                    },
                    "enabled": {
                        "type": "boolean"
                    },
                    "updated_at": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "ErrorResponse": {
                "properties": {
                    "error": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "GatewayView": {
                "properties": {
                    "connectors": {
                        "items": {
                            "$ref": "#/components/schemas/ConnectorStatus"
                        },
                        "type": "array",
                        "uniqueItems": false
                    },
                    "connectors_retired": {
                        "description": "ConnectorsRetired is always true: the per-User connector configuration has\nmoved to the Connection surface (/v1/me/connections) and is no longer served\nhere.",
                        "type": "boolean"
                    },
                    "endpoint_url": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "Tool": {
                "properties": {
                    "description": {
                        "type": "string"
                    },
                    "destructive_hint": {
                        "description": "DestructiveHint is omitted (not false) when the backend did not advertise the hint —\nmirroring domain.Tool's own nil-means-unknown contract, so a toggle UI can\ndistinguish \"confirmed safe\" from \"the backend never said.\"",
                        "type": "boolean"
                    },
                    "input_schema": {
                        "additionalProperties": {},
                        "type": "object"
                    },
                    "name": {
                        "type": "string"
                    },
                    "read_only_hint": {
                        "description": "ReadOnlyHint is omitted (not false) when the backend did not advertise the hint —\nmirroring domain.Tool's own nil-means-unknown contract, so a toggle UI can\ndistinguish \"confirmed safe\" from \"the backend never said.\"",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "ToolsListResponse": {
                "properties": {
                    "tools": {
                        "items": {
                            "$ref": "#/components/schemas/Tool"
                        },
                        "type": "array",
                        "uniqueItems": false
                    }
                },
                "type": "object"
            },
            "internal_app.ServedTool": {
                "properties": {
                    "annotations": {
                        "$ref": "#/components/schemas/internal_app.ToolCatalogueAnnotations"
                    },
                    "connector_id": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "input_schema": {
                        "additionalProperties": {},
                        "type": "object"
                    },
                    "native_name": {
                        "type": "string"
                    },
                    "output_schema": {
                        "additionalProperties": {},
                        "type": "object"
                    },
                    "served_name": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "internal_app.ToolCatalogueAnnotations": {
                "properties": {
                    "destructiveHint": {
                        "type": "boolean"
                    },
                    "idempotentHint": {
                        "type": "boolean"
                    },
                    "openWorldHint": {
                        "type": "boolean"
                    },
                    "readOnlyHint": {
                        "type": "boolean"
                    },
                    "title": {
                        "type": "string"
                    }
                },
                "type": "object"
            },
            "internal_app.ToolCatalogueResponse": {
                "properties": {
                    "tools": {
                        "items": {
                            "$ref": "#/components/schemas/internal_app.ServedTool"
                        },
                        "type": "array",
                        "uniqueItems": false
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "BearerAuth": {
                "description": "Bearer token from OIDC provider",
                "in": "header",
                "name": "Authorization",
                "type": "apiKey"
            }
        }
    },
    "info": {
        "description": "Stacklok connector-gateway control-plane — user-self API to view and toggle the caller's MCP connectors.",
        "title": "Connector Gateway API",
        "version": "0.1.0"
    },
    "externalDocs": {
        "description": "",
        "url": ""
    },
    "paths": {
        "/v1/users/me/gateway": {
            "get": {
                "operationId": "getMyGateway",
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/GatewayView"
                                }
                            }
                        },
                        "description": "OK",
                        "headers": {
                            "ETag": {
                                "description": "Strong ETag over the gateway view",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "Not Modified"
                    },
                    "401": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Unauthorized"
                    },
                    "500": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Internal Server Error"
                    }
                },
                "summary": "Get the caller's gateway view"
            }
        },
        "/v1/users/me/gateway/connectors/status": {
            "get": {
                "operationId": "listMyConnectorStatuses",
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ConnectorAuthStatusListResponse"
                                }
                            }
                        },
                        "description": "OK",
                        "headers": {
                            "ETag": {
                                "description": "Strong ETag over the status list",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "Not Modified"
                    },
                    "401": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Unauthorized"
                    },
                    "500": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Internal Server Error"
                    }
                },
                "summary": "List every connector's upstream connection status"
            }
        },
        "/v1/users/me/gateway/connectors/{connector_id}/connect": {
            "post": {
                "operationId": "connectMyConnector",
                "parameters": [
                    {
                        "description": "Connector (vmcp backend) ID",
                        "in": "path",
                        "name": "connector_id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ConnectResponse"
                                }
                            }
                        },
                        "description": "OK"
                    },
                    "401": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Unauthorized"
                    },
                    "404": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Not Found"
                    },
                    "409": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Conflict"
                    },
                    "500": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Internal Server Error"
                    }
                },
                "summary": "Start a connector's upstream connect flow"
            }
        },
        "/v1/users/me/gateway/connectors/{connector_id}/status": {
            "get": {
                "operationId": "getMyConnectorStatus",
                "parameters": [
                    {
                        "description": "Directory connectors.id",
                        "in": "path",
                        "name": "connector_id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ConnectorAuthStatusResponse"
                                }
                            }
                        },
                        "description": "OK",
                        "headers": {
                            "ETag": {
                                "description": "Strong ETag over the connection status",
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "304": {
                        "description": "Not Modified"
                    },
                    "400": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Bad Request"
                    },
                    "401": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Unauthorized"
                    },
                    "404": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Not Found"
                    },
                    "500": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Internal Server Error"
                    }
                },
                "summary": "Get one connector's upstream connection status"
            }
        },
        "/v1/users/me/gateway/connectors/{connector_id}/tools": {
            "get": {
                "operationId": "listConnectorTools",
                "parameters": [
                    {
                        "description": "Connector (Directory connectors.id) UUID",
                        "in": "path",
                        "name": "connector_id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "description": "Set to setup for an admin's tool sync; omit for ordinary use",
                        "in": "query",
                        "name": "purpose",
                        "schema": {
                            "enum": [
                                "setup"
                            ],
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ToolsListResponse"
                                }
                            }
                        },
                        "description": "OK"
                    },
                    "400": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Bad Request"
                    },
                    "401": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Unauthorized"
                    },
                    "404": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Not Found"
                    },
                    "409": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Conflict"
                    },
                    "500": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Internal Server Error"
                    },
                    "502": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Bad Gateway"
                    }
                },
                "summary": "List a Connector's Tools"
            }
        },
        "/v1/users/me/gateway/tool-catalogue": {
            "get": {
                "description": "Returns native and served names from live gateway routing. This discovery projection is not an execution credential.",
                "operationId": "getMyServedToolCatalogue",
                "responses": {
                    "200": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/internal_app.ToolCatalogueResponse"
                                }
                            }
                        },
                        "description": "OK"
                    },
                    "401": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Unauthorized"
                    },
                    "503": {
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ErrorResponse"
                                }
                            }
                        },
                        "description": "Service Unavailable"
                    }
                },
                "summary": "Get the caller's served tool catalogue"
            }
        }
    },
    "openapi": "3.1.0",
    "servers": [
        {
            "url": "/"
        }
    ]
}