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": [
      "<any>"
    ],
    "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
object

The input parameters for the tool

connectionType
enum<string>

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

Available options:
SSE,
StreamableHttp
headers
object | null

Optional HTTP headers to include when connecting to the server

Response

Successful Response

success
boolean
required

Whether the API call was successful

result
object | null

The result of the tool call, if successful The server's response to a tool call.

error
string | null

Error message, if the tool call failed

I