Requests are JSON-RPC 2.0. Every call is a single POST; there is no session to
open or keep alive.
initialize
tools/list
name, description, and inputSchema. The list
is sorted by name, so it is stable between calls.
Discover the surface here rather than hard-coding it. Adding a tool is an
additive change we may make at any time; changing an existing tool’s schema is
not.
tools/call
result.content[0].text as JSON.
Errors
Two layers, and they look different. Protocol errors come back as JSON-RPC errors:
Tool errors are a successful JSON-RPC response with
isError: true, and
the text block holds { "error": "..." }. An unknown tool name is one of
these rather than a silent no-op, because a client that thinks it filed a
draft and got a quiet success is the worst outcome available.
Transport errors are ordinary HTTP. A 401 means the credential is
missing, malformed, revoked, or an API token rather than an MCP one. A 429
means you are over the rate limit and Retry-After
says when to come back.