Skip to main content
POST
/
mcp-server
/
call-tool
Call Tool
curl --request POST \
  --url https://api.klavis.ai/mcp-server/call-tool \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "serverUrl": "<string>",
  "toolName": "<string>",
  "toolArgs": {},
  "connectionType": "StreamableHttp",
  "headers": {}
}
'
{
  "success": true,
  "result": {
    "content": [
      "<unknown>"
    ],
    "isError": false
  },
  "error": "<string>"
}

Authorizations

Authorization
string
header
required

Your Klavis AI API key.

Body

application/json
serverUrl
string
required

The full URL for connecting to the MCP server

toolName
string
required

The name of the tool to call

toolArgs
Toolargs · object

The input parameters for the tool

connectionType
enum<string>
default:StreamableHttp

The connection type to use for the MCP server. Default is STREAMABLE_HTTP.

Available options:
SSE,
StreamableHttp
headers
Headers · object

Optional HTTP headers to include when connecting to the server

Response

Successful Response

success
boolean
required

Whether the API call was successful

result
CallToolResult · object

The result of the tool call, if successful

error
string | null

Error message, if the tool call failed