Context4
Техническая документация

Справочник MCP-инструментов.

Пять метаинструментов: точные входные и выходные JSON Schema.

MCP этого стенда: https://context4.me/mcp.

Это полный стабильный набор глобального /mcp. Инструменты конкретных сервисов обнаруживаются через поиск и получение схем; их список зависит от каталога и прав. Правила подключения и обработки ошибок — AI и MCP. Строгие входные схемы отвергают неизвестные поля. У arguments дополнительно проверяется сериализуемость и предел 65 536 символов JSON; пользовательская проверка Zod не представима стандартным JSON Schema.

CONTEXT4_SEARCH_TOOLS

Search Context4 for provider tools needed for a task. Results include connection readiness.

Входная схема

Data
{
  "$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
}

Выходная схема

Data
{
  "$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
}

CONTEXT4_GET_TOOL_SCHEMAS

Get exact input and output schemas for tool slugs returned by tool search.

Входная схема

Data
{
  "$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
}

Выходная схема

Data
{
  "$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
}

CONTEXT4_MANAGE_CONNECTIONS

List connected accounts or create a hosted authorization link.

Входная схема

Data
{
  "$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
    }
  ]
}

Выходная схема

Data
{
  "$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
    }
  ]
}

CONTEXT4_WAIT_FOR_CONNECTIONS

Wait for a hosted authorization flow to become active.

Входная схема

Data
{
  "$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
}

Выходная схема

Data
{
  "$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
}

CONTEXT4_MULTI_EXECUTE_TOOL

Execute up to 20 discovered tools through tenant-scoped connections.

Входная схема

Data
{
  "$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
}

Выходная схема

Data
{
  "$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
}