← Documentation home
POST/hyax-api/mcp

Call an MCP tool

Invoke a tool by name with arguments matching its inputSchema. Successful results return content[].text as a JSON string. Errors set isError: true on the result.

Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.

Request examples

Same request in cURL, Node.js (fetch), and PHP (ext-curl).

curl -X POST 'https://platform.hyax.com/hyax-api/mcp' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": 3,
    "method": "tools/call",
    "params": {
      "name": "posts_list",
      "arguments": {
        "limit": 5,
        "status": "PUBLISHED"
      }
    }
  }'

Example response

Shape varies by data; values are illustrative.

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{\"success\":true,\"data\":[{\"id\":\"clx…\",\"title\":\"Hello world\",\"slug\":\"hello-world\",\"status\":\"PUBLISHED\"}],\"pagination\":{\"page\":1,\"limit\":5,\"total\":1,\"totalPages\":1}}"
      }
    ],
    "isError": false
  }
}