Appearance
JSON-RPC Reference โ
Complete specification for Fantasy402 MCP API using JSON-RPC 2.0 protocol.
Protocol Overview โ
The Fantasy402 MCP API uses JSON-RPC 2.0 for all communication. All requests and responses follow the JSON-RPC 2.0 specification.
Request Format โ
json
{
"jsonrpc": "2.0",
"id": "unique-request-id",
"method": "tools/call",
"params": {
"name": "toolName",
"arguments": {
// Tool-specific arguments
}
}
}Request Fields โ
| Field | Type | Required | Description |
|---|---|---|---|
jsonrpc | string | Yes | Must be "2.0" |
id | string/number | Yes | Unique identifier for the request |
method | string | Yes | Must be "tools/call" |
params | object | Yes | Method parameters |
params.name | string | Yes | Name of the MCP tool to execute |
params.arguments | object | Yes | Arguments for the tool |
Response Format โ
Success Response โ
json
{
"jsonrpc": "2.0",
"id": "unique-request-id",
"result": {
"content": [
{
"type": "text",
"text": "Tool execution result"
}
],
"isError": false
}
}Error Response โ
json
{
"jsonrpc": "2.0",
"id": "unique-request-id",
"error": {
"code": -32601,
"message": "Tool not found",
"data": {
"toolName": "unknownTool"
}
}
}Error Codes โ
| Code | Message | Description |
|---|---|---|
| -32700 | Parse error | Invalid JSON received |
| -32600 | Invalid Request | Request doesn't match JSON-RPC spec |
| -32601 | Method not found | Unknown method requested |
| -32602 | Invalid params | Invalid method parameters |
| -32603 | Internal error | Internal server error |
| -32000 | Server error | Tool execution failed |
HTTP Transport โ
Endpoint โ
POST https://fantasy402-api-production.utahj4754.workers.dev/mcpHeaders โ
Content-Type: application/json
Authorization: Bearer <your-api-token>HTTP Status Codes โ
| Status | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request (invalid JSON-RPC) |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 500 | Internal Server Error |
Authentication โ
All requests must include proper authentication via the Authorization header:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Contact your Fantasy402 representative for API credentials.
Rate Limiting โ
- Requests per minute: 1000
- Burst limit: 2000
- Refill rate: 16.67 tokens/ms
Rate limit headers are included in responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 950
X-RateLimit-Reset: 1640995200Examples โ
Successful Tool Call โ
Request:
json
{
"jsonrpc": "2.0",
"id": "req-123",
"method": "tools/call",
"params": {
"name": "getActiveAccounts",
"arguments": {
"limit": 10
}
}
}Response:
json
{
"jsonrpc": "2.0",
"id": "req-123",
"result": {
"content": [
{
"type": "text",
"text": "[{\"id\":\"123\",\"balance\":1500.00,\"status\":\"active\"}]"
}
],
"isError": false
}
}Error Response โ
Request:
json
{
"jsonrpc": "2.0",
"id": "req-456",
"method": "tools/call",
"params": {
"name": "unknownTool",
"arguments": {}
}
}Response:
json
{
"jsonrpc": "2.0",
"id": "req-456",
"error": {
"code": -32601,
"message": "Tool 'unknownTool' not found",
"data": {
"availableTools": ["getActiveAccounts", "getCustomerData", ...]
}
}
}