# Send an MCP message

> Source: https://truto.one/docs/api-reference/admin/mcp/call/

`POST /mcp/{token}`

Resource: **MCP**

## Path parameters

- **`token`** _(string, required)_
  The MCP server's token, from its `url`.

## Request body

- **`jsonrpc`** _(string)_
  Allowed: `2.0`
- **`id`** _(string | number)_
  The request ID. Omitted on notifications.
- **`method`** _(string)_
  The MCP method. Truto answers `initialize`, `notifications/initialized`, `tools/list`, `tools/call`, `resources/list` and `prompts/list` (both always empty) and `ping`. Any other method is acknowledged with an empty `202`.
- **`params`** _(object)_
  The method's parameters. For `tools/call`, `name` is the tool and `arguments` its input. For `initialize`, `protocolVersion` and `clientInfo`.

## Response body

- **`jsonrpc`** _(string)_
  Allowed: `2.0`
- **`id`** _(string | number)_
- **`result`** _(object)_
  `initialize` returns `protocolVersion`, `capabilities` (tools only), `serverInfo` and `instructions`. `tools/list` returns `tools`. `tools/call` returns `content`, a list of `text` items, and `isError` when the call failed.

## Code examples

### curl

```bash
curl -X POST 'https://api.truto.one/mcp/{token}' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "list_all_hub_spot_contacts",
    "arguments": {
      "limit": 10
    }
  }
}'
```

### JavaScript

```javascript
const body = {
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "list_all_hub_spot_contacts",
    "arguments": {
      "limit": 10
    }
  }
};

const response = await fetch('https://api.truto.one/mcp/{token}', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/mcp/{token}"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "jsonrpc": "2.0",
    "method": "tools/call",
    "params": {
        "name": "list_all_hub_spot_contacts",
        "arguments": {
            "limit": 10
        }
    }
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())
```
