Skip to main content

POST /api/tools/call/:server

Call a specific tool on an MCP server.

Call a Tool

Execute a specific tool on an MCP server with given arguments.
  • Endpoint: /api/tools/call/:server
  • Method: POST
  • Parameters:
    • :server (string, required): The name of the MCP server.
  • Body:
    • toolName (string, required): The name of the tool to execute. Accepted in either form:
      • The bare upstream tool name (e.g. weather). MCPHub will route it to :server.
      • The fully qualified <server><separator><tool> form (e.g. amap-weather). The separator defaults to - and is configurable via systemConfig.nameSeparator (see System Config API). Use the qualified form when an upstream tool name happens to contain the separator and you need to disambiguate.
    • arguments (object, optional): The arguments to pass to the tool. Defaults to an empty object.
  • Response:
Example Request:
Notes:
  • The tool arguments are automatically converted to the proper types based on the tool’s input schema.
  • Use the x-session-id header to maintain session state across multiple tool calls if needed.
  • This endpoint requires authentication.

Alternative: OpenAPI Tool Execution

For OpenAPI-compatible tool execution without authentication, see the OpenAPI Integration documentation. The OpenAPI endpoints provide:
  • GET /api/tools/:serverName/:toolName - For simple tools with query parameters
  • POST /api/tools/:serverName/:toolName - For complex tools with JSON body
These endpoints are designed for integration with OpenWebUI and other OpenAPI-compatible systems.