Skip to main content
POST
/
v1
/
mcp
/
tools
/
call
curl -X POST https://api.mcprank.com/v1/mcp/tools/call \
  -H "X-API-Key: sk_mcp_rank_..." \
  -H "Content-Type: application/json" \
  -d '{
    "server_id": "ai.exa/exa",
    "name": "web_search",
    "arguments": {"query": "latest AI news", "numResults": 5}
  }'
{
  "content": [
    {
      "type": "text",
      "text": "Here are the top results for 'latest AI news':\n\n1. OpenAI announces GPT-5...\n2. Google DeepMind releases..."
    }
  ],
  "isError": false
}

Call Tool

Call a specific tool on an MCP server. This is a convenience wrapper around the generic /mcp/call endpoint.

Request

curl -X POST https://api.mcprank.com/v1/mcp/tools/call \
  -H "X-API-Key: sk_mcp_rank_..." \
  -H "Content-Type: application/json" \
  -d '{
    "server_id": "ai.exa/exa",
    "name": "web_search",
    "arguments": {"query": "latest AI news"}
  }'

Headers

X-API-Key
string
required
Your MCP Rank API key

Body Parameters

server_id
string
required
The MCP Rank server ID
name
string
required
Name of the tool to call
arguments
object
Tool arguments (structure depends on tool’s inputSchema)

Response

Returns the tool’s execution result. The structure depends on the specific tool.
curl -X POST https://api.mcprank.com/v1/mcp/tools/call \
  -H "X-API-Key: sk_mcp_rank_..." \
  -H "Content-Type: application/json" \
  -d '{
    "server_id": "ai.exa/exa",
    "name": "web_search",
    "arguments": {"query": "latest AI news", "numResults": 5}
  }'
{
  "content": [
    {
      "type": "text",
      "text": "Here are the top results for 'latest AI news':\n\n1. OpenAI announces GPT-5...\n2. Google DeepMind releases..."
    }
  ],
  "isError": false
}

Tool Result Format

MCP tools return results in a standard format:
FieldTypeDescription
contentarrayArray of content blocks
isErrorbooleanWhether the tool encountered an error
Content blocks can be:
  • Text: {"type": "text", "text": "..."}
  • Image: {"type": "image", "data": "base64...", "mimeType": "image/png"}
  • Resource: {"type": "resource", "resource": {...}}

Error Responses

Status CodeDescription
401Missing or invalid API key
404Server not found
410Server is no longer active
429Rate limit exceeded
502Tool execution failed
Error Response
{
  "detail": "Tool call failed: Invalid query parameter"
}