MCP Protocol Details
Complete reference for the MCP protocol implementation.
Methods
initialize
Establishes the connection and negotiates capabilities.
tools/list
Lists all available tools for the service.
Request:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}Response:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"tools": [
{
"name": "ndbc.latest_observation",
"description": "Get the most recent observation",
"inputSchema": {
"type": "object",
"properties": {
"station_id": {
"type": "string"
}
}
}
}
]
}
}tools/call
Executes a tool with provided arguments.
Request:
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "ndbc.latest_observation",
"arguments": {
"station_id": "46108"
}
}
}Response:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"content": [
{
"type": "text",
"text": "{\"station_id\": \"46108\", \"observations\": [...]}"
}
]
}
}Error Handling
Errors follow JSON-RPC 2.0 error format:
{
"jsonrpc": "2.0",
"id": 3,
"error": {
"code": -32603,
"message": "Internal error"
}
}Error Codes
-32600- Invalid Request-32601- Method Not Found-32602- Invalid Params-32603- Internal Error