{
  "source": "docs/api/openapi.v1.json",
  "operations": [
    {
      "path": "/v1/tools",
      "method": "GET",
      "operationId": "listTools",
      "capability": "tools:read",
      "chapter": "api-tools",
      "urlTemplate": "https://ctx4.me/v1/tools",
      "documentation": "https://ctx4.me/docs/api-tools.md"
    },
    {
      "path": "/v1/tools/{toolId}",
      "method": "GET",
      "operationId": "getTool",
      "capability": "tools:read",
      "chapter": "api-tools",
      "urlTemplate": "https://ctx4.me/v1/tools/{toolId}",
      "documentation": "https://ctx4.me/docs/api-tools.md"
    },
    {
      "path": "/v1/identity",
      "method": "GET",
      "operationId": "getIdentity",
      "capability": "connections:read",
      "chapter": "api-tools",
      "urlTemplate": "https://ctx4.me/v1/identity",
      "documentation": "https://ctx4.me/docs/api-tools.md"
    },
    {
      "path": "/v1/executions",
      "method": "POST",
      "operationId": "createExecution",
      "capability": "executions:write",
      "chapter": "api-executions",
      "urlTemplate": "https://ctx4.me/v1/executions",
      "documentation": "https://ctx4.me/docs/api-executions.md"
    },
    {
      "path": "/v1/executions",
      "method": "GET",
      "operationId": "listExecutions",
      "capability": "executions:read",
      "chapter": "api-executions",
      "urlTemplate": "https://ctx4.me/v1/executions",
      "documentation": "https://ctx4.me/docs/api-executions.md"
    },
    {
      "path": "/v1/executions/{executionId}",
      "method": "GET",
      "operationId": "getExecution",
      "capability": "executions:read",
      "chapter": "api-executions",
      "urlTemplate": "https://ctx4.me/v1/executions/{executionId}",
      "documentation": "https://ctx4.me/docs/api-executions.md"
    },
    {
      "path": "/v1/executions/{executionId}/attempts",
      "method": "GET",
      "operationId": "listExecutionAttempts",
      "capability": "executions:read",
      "chapter": "api-executions",
      "urlTemplate": "https://ctx4.me/v1/executions/{executionId}/attempts",
      "documentation": "https://ctx4.me/docs/api-executions.md"
    },
    {
      "path": "/v1/executions/{executionId}/cancel",
      "method": "POST",
      "operationId": "cancelExecution",
      "capability": "executions:write",
      "chapter": "api-executions",
      "urlTemplate": "https://ctx4.me/v1/executions/{executionId}/cancel",
      "documentation": "https://ctx4.me/docs/api-executions.md"
    },
    {
      "path": "/v1/connections",
      "method": "GET",
      "operationId": "listConnections",
      "capability": "connections:read",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/connections",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/connections",
      "method": "POST",
      "operationId": "createConnection",
      "capability": "connections:write",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/connections",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/connections/{connectionId}",
      "method": "GET",
      "operationId": "getConnection",
      "capability": "connections:read",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/connections/{connectionId}",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/auth-configs",
      "method": "GET",
      "operationId": "listAuthConfigs",
      "capability": "connections:read",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/auth-configs",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/auth-configs",
      "method": "POST",
      "operationId": "createAuthConfig",
      "capability": "connections:write",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/auth-configs",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/auth-configs/{authConfigId}",
      "method": "GET",
      "operationId": "getAuthConfig",
      "capability": "connections:read",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/auth-configs/{authConfigId}",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/auth-configs/{authConfigId}",
      "method": "PATCH",
      "operationId": "updateAuthConfig",
      "capability": "connections:write",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/auth-configs/{authConfigId}",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/auth-configs/{authConfigId}",
      "method": "DELETE",
      "operationId": "deleteAuthConfig",
      "capability": "connections:write",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/auth-configs/{authConfigId}",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/connections/{connectionId}/schemas/{entity}",
      "method": "GET",
      "operationId": "getProviderSchema",
      "capability": "connections:read",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/connections/{connectionId}/schemas/{entity}",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/connections/{connectionId}/schemas/{entity}",
      "method": "POST",
      "operationId": "discoverProviderSchema",
      "capability": "connections:write",
      "chapter": "api-connections",
      "urlTemplate": "https://ctx4.me/v1/connections/{connectionId}/schemas/{entity}",
      "documentation": "https://ctx4.me/docs/api-connections.md"
    },
    {
      "path": "/v1/network-attachments/{networkAttachmentId}/connectivity",
      "method": "PATCH",
      "operationId": "setNetworkAttachmentConnectivity",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/network-attachments/{networkAttachmentId}/connectivity",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/network-attachments",
      "method": "GET",
      "operationId": "listNetworkAttachments",
      "capability": "connections:read",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/network-attachments",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/network-attachments",
      "method": "POST",
      "operationId": "createNetworkAttachment",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/network-attachments",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/network-attachments/{networkAttachmentId}",
      "method": "GET",
      "operationId": "getNetworkAttachment",
      "capability": "connections:read",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/network-attachments/{networkAttachmentId}",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/network-attachments/{networkAttachmentId}",
      "method": "PATCH",
      "operationId": "updateNetworkAttachment",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/network-attachments/{networkAttachmentId}",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/network-attachments/{networkAttachmentId}",
      "method": "DELETE",
      "operationId": "revokeNetworkAttachment",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/network-attachments/{networkAttachmentId}",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections/{dataSourceConnectionId}/discover-databases",
      "method": "POST",
      "operationId": "discoverSavedDatabases",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections/{dataSourceConnectionId}/discover-databases",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections/{dataSourceConnectionId}/databases",
      "method": "POST",
      "operationId": "addDatabaseFromConnection",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections/{dataSourceConnectionId}/databases",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections/discover-databases",
      "method": "POST",
      "operationId": "discoverPostgresDatabases",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections/discover-databases",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections",
      "method": "GET",
      "operationId": "listDataSourceConnections",
      "capability": "connections:read",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections",
      "method": "POST",
      "operationId": "createDataSourceConnection",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections/{dataSourceConnectionId}",
      "method": "GET",
      "operationId": "getDataSourceConnection",
      "capability": "connections:read",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections/{dataSourceConnectionId}",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections/{dataSourceConnectionId}",
      "method": "DELETE",
      "operationId": "revokeDataSourceConnection",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections/{dataSourceConnectionId}",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections/{dataSourceConnectionId}/credential",
      "method": "POST",
      "operationId": "replaceDataSourceCredential",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections/{dataSourceConnectionId}/credential",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections/{dataSourceConnectionId}/schema",
      "method": "GET",
      "operationId": "getDataSourceSchema",
      "capability": "connections:read",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections/{dataSourceConnectionId}/schema",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/data-source-connections/{dataSourceConnectionId}/schema",
      "method": "POST",
      "operationId": "discoverDataSourceSchema",
      "capability": "connections:write",
      "chapter": "api-sources",
      "urlTemplate": "https://ctx4.me/v1/data-source-connections/{dataSourceConnectionId}/schema",
      "documentation": "https://ctx4.me/docs/api-sources.md"
    },
    {
      "path": "/v1/tool-sessions",
      "method": "POST",
      "operationId": "createToolSession",
      "capability": "tool-sessions:write",
      "chapter": "api-sessions",
      "urlTemplate": "https://ctx4.me/v1/tool-sessions",
      "documentation": "https://ctx4.me/docs/api-sessions.md"
    },
    {
      "path": "/v1/tool-sessions/{toolSessionId}",
      "method": "GET",
      "operationId": "getToolSession",
      "capability": "tool-sessions:read",
      "chapter": "api-sessions",
      "urlTemplate": "https://ctx4.me/v1/tool-sessions/{toolSessionId}",
      "documentation": "https://ctx4.me/docs/api-sessions.md"
    },
    {
      "path": "/v1/tool-sessions/{toolSessionId}",
      "method": "PATCH",
      "operationId": "patchToolSession",
      "capability": "tool-sessions:write",
      "chapter": "api-sessions",
      "urlTemplate": "https://ctx4.me/v1/tool-sessions/{toolSessionId}",
      "documentation": "https://ctx4.me/docs/api-sessions.md"
    },
    {
      "path": "/v1/tool-sessions/{toolSessionId}/tools",
      "method": "GET",
      "operationId": "listToolSessionTools",
      "capability": "tool-sessions:read",
      "chapter": "api-sessions",
      "urlTemplate": "https://ctx4.me/v1/tool-sessions/{toolSessionId}/tools",
      "documentation": "https://ctx4.me/docs/api-sessions.md"
    },
    {
      "path": "/v1/syncs/{syncId}/delivery-authority",
      "method": "GET",
      "operationId": "getSyncDeliveryAuthority",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}/delivery-authority",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs",
      "method": "POST",
      "operationId": "createSync",
      "capability": "syncs:write",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs",
      "method": "GET",
      "operationId": "listSyncs",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}",
      "method": "GET",
      "operationId": "getSync",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}",
      "method": "PATCH",
      "operationId": "patchSync",
      "capability": "syncs:write",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}",
      "method": "DELETE",
      "operationId": "deleteSync",
      "capability": "syncs:write",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/test-fire",
      "method": "POST",
      "operationId": "testFireSync",
      "capability": "syncs:write",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/test-fire",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}/trigger",
      "method": "POST",
      "operationId": "triggerSyncRun",
      "capability": "syncs:write",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}/trigger",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}/runs",
      "method": "GET",
      "operationId": "listSyncRuns",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}/runs",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}/records",
      "method": "GET",
      "operationId": "pullSyncRecords",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}/records",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}/replay",
      "method": "POST",
      "operationId": "replaySyncRecords",
      "capability": "syncs:write",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}/replay",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/connectors/{connectorId}/syncable-entities",
      "method": "GET",
      "operationId": "listSyncableEntities",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/connectors/{connectorId}/syncable-entities",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/sync-delivery-capabilities",
      "method": "GET",
      "operationId": "getSyncDeliveryCapabilities",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/sync-delivery-capabilities",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}/exports",
      "method": "POST",
      "operationId": "createSyncExport",
      "capability": "syncs:write",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}/exports",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}/exports/{exportId}/cancel",
      "method": "POST",
      "operationId": "cancelSyncExport",
      "capability": "syncs:write",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}/exports/{exportId}/cancel",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/syncs/{syncId}/exports/{exportId}",
      "method": "GET",
      "operationId": "getSyncExport",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/syncs/{syncId}/exports/{exportId}",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/sync-providers",
      "method": "GET",
      "operationId": "listSyncProviders",
      "capability": "syncs:read",
      "chapter": "api-syncs",
      "urlTemplate": "https://ctx4.me/v1/sync-providers",
      "documentation": "https://ctx4.me/docs/api-syncs.md"
    },
    {
      "path": "/v1/provider-event-types",
      "method": "GET",
      "operationId": "listProviderEventTypes",
      "capability": "events:read",
      "chapter": "api-events",
      "urlTemplate": "https://ctx4.me/v1/provider-event-types",
      "documentation": "https://ctx4.me/docs/api-events.md"
    },
    {
      "path": "/v1/provider-event-subscriptions",
      "method": "POST",
      "operationId": "subscribeProviderEvents",
      "capability": "events:write",
      "chapter": "api-events",
      "urlTemplate": "https://ctx4.me/v1/provider-event-subscriptions",
      "documentation": "https://ctx4.me/docs/api-events.md"
    },
    {
      "path": "/v1/provider-event-subscriptions",
      "method": "GET",
      "operationId": "getProviderEventSubscription",
      "capability": "events:read",
      "chapter": "api-events",
      "urlTemplate": "https://ctx4.me/v1/provider-event-subscriptions",
      "documentation": "https://ctx4.me/docs/api-events.md"
    },
    {
      "path": "/v1/provider-event-subscriptions/{subscriptionId}",
      "method": "DELETE",
      "operationId": "disableProviderEventSubscription",
      "capability": "events:write",
      "chapter": "api-events",
      "urlTemplate": "https://ctx4.me/v1/provider-event-subscriptions/{subscriptionId}",
      "documentation": "https://ctx4.me/docs/api-events.md"
    },
    {
      "path": "/v1/connectors/{connectorId}/endpoints",
      "method": "GET",
      "operationId": "listConnectorEndpoints",
      "capability": "tools:read",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/connectors/{connectorId}/endpoints",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    },
    {
      "path": "/v1/connectors/{connectorId}/endpoint",
      "method": "GET",
      "operationId": "getConnectorEndpoint",
      "capability": "tools:read",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/connectors/{connectorId}/endpoint",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    },
    {
      "path": "/v1/connectors/{connectorId}/openapi.json",
      "method": "GET",
      "operationId": "getConnectorOpenApi",
      "capability": "tools:read",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/connectors/{connectorId}/openapi.json",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    },
    {
      "path": "/v1/endpoints/search",
      "method": "POST",
      "operationId": "searchEndpoints",
      "capability": "connections:read",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/endpoints/search",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    },
    {
      "path": "/v1/api/{connectorId}/{vendorPath}",
      "method": "GET",
      "operationId": "callConnectorApiGet",
      "capability": "executions:write",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/api/{connectorId}/{vendorPath}",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    },
    {
      "path": "/v1/api/{connectorId}/{vendorPath}",
      "method": "POST",
      "operationId": "callConnectorApiPost",
      "capability": "executions:write",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/api/{connectorId}/{vendorPath}",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    },
    {
      "path": "/v1/api/{connectorId}/{vendorPath}",
      "method": "PUT",
      "operationId": "callConnectorApiPut",
      "capability": "executions:write",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/api/{connectorId}/{vendorPath}",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    },
    {
      "path": "/v1/api/{connectorId}/{vendorPath}",
      "method": "PATCH",
      "operationId": "callConnectorApiPatch",
      "capability": "executions:write",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/api/{connectorId}/{vendorPath}",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    },
    {
      "path": "/v1/api/{connectorId}/{vendorPath}",
      "method": "DELETE",
      "operationId": "callConnectorApiDelete",
      "capability": "executions:write",
      "chapter": "api-endpoints",
      "urlTemplate": "https://ctx4.me/v1/api/{connectorId}/{vendorPath}",
      "documentation": "https://ctx4.me/docs/api-endpoints.md"
    }
  ],
  "mcpTools": [
    {
      "name": "CONTEXT4_SEARCH_TOOLS",
      "title": "Search available Context4 tools",
      "description": "Search Context4 for provider tools needed for a task. Results include connection readiness.",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "query": {
            "type": "string",
            "minLength": 2,
            "maxLength": 500
          },
          "connector_id": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9-]{1,78}$"
              },
              {
                "type": "string",
                "minLength": 2,
                "maxLength": 80,
                "pattern": "^[a-z][a-z0-9-]*$"
              }
            ]
          },
          "limit": {
            "default": 10,
            "type": "integer",
            "minimum": 1,
            "maximum": 20
          },
          "tags": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read-only",
                "destructive",
                "idempotent",
                "open-world",
                "curated"
              ]
            }
          },
          "exclude_tags": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read-only",
                "destructive",
                "idempotent",
                "open-world",
                "curated"
              ]
            }
          }
        },
        "required": [
          "query"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "title": "Search available Context4 tools",
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": true
      },
      "outputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tool_slug": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 240,
                  "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$"
                },
                "connector_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{1,78}$"
                    },
                    {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 80,
                      "pattern": "^[a-z][a-z0-9-]*$"
                    }
                  ]
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                },
                "description": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 2000
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "tags": {
                  "maxItems": 5,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "read-only",
                      "destructive",
                      "idempotent",
                      "open-world",
                      "curated"
                    ]
                  }
                },
                "connection_status": {
                  "type": "string",
                  "enum": [
                    "connected",
                    "connection_required",
                    "multiple_connections"
                  ]
                }
              },
              "required": [
                "tool_slug",
                "connector_id",
                "name",
                "description",
                "connection_status"
              ],
              "additionalProperties": false
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "tools",
          "next_cursor"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "CONTEXT4_GET_TOOL_SCHEMAS",
      "title": "Get Context4 tool schemas",
      "description": "Get exact input and output schemas for tool slugs returned by tool search.",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "tool_slugs": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 240,
              "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$"
            }
          }
        },
        "required": [
          "tool_slugs"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "title": "Get Context4 tool schemas",
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": true
      },
      "outputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "tools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tool_slug": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 240,
                  "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$"
                },
                "connector_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9-]{1,78}$"
                    },
                    {
                      "type": "string",
                      "minLength": 2,
                      "maxLength": 80,
                      "pattern": "^[a-z][a-z0-9-]*$"
                    }
                  ]
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 160
                },
                "description": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 2000
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "input_schema": {},
                "output_schema": {
                  "anyOf": [
                    {},
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "tool_slug",
                "connector_id",
                "name",
                "description",
                "input_schema",
                "output_schema"
              ],
              "additionalProperties": false
            }
          },
          "missing": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 3,
              "maxLength": 240,
              "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$"
            }
          }
        },
        "required": [
          "tools",
          "missing"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "CONTEXT4_MANAGE_CONNECTIONS",
      "title": "Manage connected accounts",
      "description": "List connected accounts or create a hosted authorization link.",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "list"
              },
              "connector_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{1,78}$"
                  },
                  {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 80,
                    "pattern": "^[a-z][a-z0-9-]*$"
                  }
                ]
              }
            },
            "required": [
              "action",
              "connector_id"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "connect"
              },
              "connector_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{1,78}$"
                  },
                  {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 80,
                    "pattern": "^[a-z][a-z0-9-]*$"
                  }
                ]
              },
              "display_name": {
                "type": "string",
                "minLength": 2,
                "maxLength": 120
              },
              "return_path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 512,
                "pattern": "^\\/(?!\\/)[A-Za-z0-9/_.-]*$"
              }
            },
            "required": [
              "action",
              "connector_id"
            ],
            "additionalProperties": false
          }
        ]
      },
      "annotations": {
        "title": "Manage connected accounts",
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      },
      "outputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "listed"
              },
              "connections": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "connection_id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "connector_id": {
                      "anyOf": [
                        {
                          "type": "string",
                          "pattern": "^[a-z0-9][a-z0-9-]{1,78}$"
                        },
                        {
                          "type": "string",
                          "minLength": 2,
                          "maxLength": 80,
                          "pattern": "^[a-z][a-z0-9-]*$"
                        }
                      ]
                    },
                    "display_name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 120
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "active",
                        "degraded",
                        "revoked",
                        "failed"
                      ]
                    }
                  },
                  "required": [
                    "connection_id",
                    "connector_id",
                    "display_name",
                    "status"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "status",
              "connections"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "authorization_required"
              },
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "connect_url": {
                "type": "string",
                "maxLength": 2048,
                "format": "uri"
              },
              "expires_at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              "instruction": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              }
            },
            "required": [
              "status",
              "connection_id",
              "connect_url",
              "expires_at",
              "instruction"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "credentials_required"
              },
              "connect_url": {
                "type": "string",
                "maxLength": 2048,
                "format": "uri"
              },
              "instruction": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              }
            },
            "required": [
              "status",
              "connect_url",
              "instruction"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "type": "string",
                "const": "active"
              },
              "connection": {
                "type": "object",
                "properties": {
                  "connection_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "connector_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-z0-9][a-z0-9-]{1,78}$"
                      },
                      {
                        "type": "string",
                        "minLength": 2,
                        "maxLength": 80,
                        "pattern": "^[a-z][a-z0-9-]*$"
                      }
                    ]
                  },
                  "display_name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "pending",
                      "active",
                      "degraded",
                      "revoked",
                      "failed"
                    ]
                  }
                },
                "required": [
                  "connection_id",
                  "connector_id",
                  "display_name",
                  "status"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "status",
              "connection"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    {
      "name": "CONTEXT4_WAIT_FOR_CONNECTIONS",
      "title": "Wait for account authorization",
      "description": "Wait for a hosted authorization flow to become active.",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "connection_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "timeout_seconds": {
            "default": 30,
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          }
        },
        "required": [
          "connection_id"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "title": "Wait for account authorization",
        "readOnlyHint": true,
        "destructiveHint": false,
        "openWorldHint": true
      },
      "outputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "pending",
              "failed",
              "revoked",
              "degraded"
            ]
          },
          "connection": {
            "type": "object",
            "properties": {
              "connection_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "connector_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9-]{1,78}$"
                  },
                  {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 80,
                    "pattern": "^[a-z][a-z0-9-]*$"
                  }
                ]
              },
              "display_name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "status": {
                "type": "string",
                "enum": [
                  "pending",
                  "active",
                  "degraded",
                  "revoked",
                  "failed"
                ]
              }
            },
            "required": [
              "connection_id",
              "connector_id",
              "display_name",
              "status"
            ],
            "additionalProperties": false
          },
          "retry_after_ms": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "status",
          "connection",
          "retry_after_ms"
        ],
        "additionalProperties": false
      }
    },
    {
      "name": "CONTEXT4_MULTI_EXECUTE_TOOL",
      "title": "Execute connected service tools",
      "description": "Execute up to 20 discovered tools through tenant-scoped connections.",
      "inputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "tools": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "tool_slug": {
                  "type": "string",
                  "minLength": 3,
                  "maxLength": 240,
                  "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$"
                },
                "arguments": {},
                "connection_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "required": [
                "tool_slug",
                "arguments"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "tools"
        ],
        "additionalProperties": false
      },
      "annotations": {
        "title": "Execute connected service tools",
        "readOnlyHint": false,
        "destructiveHint": true,
        "openWorldHint": true
      },
      "outputSchema": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "succeeded"
                    },
                    "tool_slug": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 240,
                      "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$"
                    },
                    "execution_id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "result": {}
                  },
                  "required": [
                    "status",
                    "tool_slug",
                    "execution_id",
                    "result"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "pending"
                    },
                    "tool_slug": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 240,
                      "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$"
                    },
                    "execution_id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "retry_after_ms": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "status",
                    "tool_slug",
                    "execution_id",
                    "retry_after_ms"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "const": "error"
                    },
                    "tool_slug": {
                      "type": "string",
                      "minLength": 3,
                      "maxLength": 240,
                      "pattern": "^[a-z][a-z0-9-]*\\.[a-z][a-z0-9_.-]*$"
                    },
                    "error_code": {
                      "type": "string",
                      "enum": [
                        "authentication_required",
                        "permission_denied",
                        "connection_required",
                        "connection_ambiguous",
                        "connection_default_required",
                        "workspace_changed",
                        "authorization_pending",
                        "tool_not_found",
                        "invalid_arguments",
                        "rate_limited",
                        "execution_pending",
                        "execution_failed",
                        "internal_error"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 500
                    }
                  },
                  "required": [
                    "status",
                    "tool_slug",
                    "error_code",
                    "message"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": [
          "results"
        ],
        "additionalProperties": false
      }
    }
  ],
  "apiOrigin": "https://ctx4.me",
  "mcpUrl": "https://ctx4.me/mcp",
  "openapi": "https://ctx4.me/docs/openapi.json"
}
