Skip to main content
Version: 2.0

Create Tool Server API Definition

The Create Tool Server API enables you to register Model Context Protocol (MCP) compliant servers that expose tools for use by AI agents. Tool servers act as bridges between your enterprise systems and the Vectara platform, making capabilities like database queries, API integrations, and custom business logic available to agents through a standardized protocol.

This API is fundamental to extending agent capabilities beyond built-in functions, allowing organizations to expose their internal systems, third-party integrations, and custom tools in a secure, managed way that maintains governance and access control.

Create Tool Server Request and Response

To create a tool server, send a POST request to /v2/tool_servers. You specify the following parameters in the request body:

  • name (string, required): The human-readable name of the tool server
  • type (string, required): Must be mcp (Model Context Protocol)
  • description (string, optional): A detailed description of what this tool server provides
  • uri (string, required): The URI of the tool server (must be a valid URI)
  • transport (string, required): Transport protocol, must be sse (Server-Sent Events)
  • headers (object, optional): HTTP headers to include when connecting to the server
  • auth (object, optional): Authentication configuration for connecting to the tool server
    • Various auth types supported (see Authentication documentation)
  • enabled (boolean, optional): Whether the server is enabled upon creation (defaults to true)
  • metadata (object, optional): Arbitrary metadata for tracking and organization

The response includes the complete tool server configuration with a system-generated ID and timestamps.

Example Request

EXAMPLE REQUEST
1

Example Response

EXAMPLE RESPONSE
1

Error Responses

The API returns standard HTTP error codes with detailed error information:

HTTP CodeError CodeDescription
400invalid_requestMissing required fields or malformed request structure
400invalid_uriURI format is invalid or uses unsupported protocol
400invalid_transportTransport must be 'sse'
400invalid_typeType must be 'mcp'
401unauthorizedInvalid or missing API key
403forbiddenInsufficient permissions for creating tool servers
409server_existsA tool server with this URI already exists
429rate_limit_exceededTool server creation rate limit exceeded

Next Steps

After creating a tool server, you should:

  1. Synchronize the server to discover available tools using the Sync Tool Server API
  2. Verify tools were discovered using the List Tools API
  3. Configure agents to use the discovered tools