AI & LLM
MCP Message (Model Context Protocol) JSON Example
A JSON example of a Model Context Protocol (MCP) message — JSON-RPC 2.0 tools/list and tools/call requests and responses. Copy-ready for building MCP servers and AI tool integrations.
Field Reference
jsonrpcrequiredstringProtocol version — always '2.0' for MCP (built on JSON-RPC 2.0)idrequiredinteger | stringRequest id echoed in the response to correlate request/response pairsresultrequiredobjectSuccess payload; present on responses (mutually exclusive with 'error')result.tools[].namerequiredstringUnique tool name the model can callresult.tools[].inputSchemarequiredobjectJSON Schema describing the tool's argumentsVariants
tools/list requestThe client asks an MCP server which tools it exposes.
tools/call requestInvoke a tool with arguments.
Error responseJSON-RPC error object returned when a call fails.
Common Use Cases
- →Building an MCP server that exposes tools to Claude or other AI clients
- →Debugging JSON-RPC traffic between an AI host and an MCP server
- →Defining tool input schemas for model-driven tool calling
mcpmodel context protocoljson-rpcai toolsclaudeanthropic
Validate or format this JSON
One click loads this exact example into the tool — no copy-paste needed. Format it, validate it, explore the tree, or generate TypeScript types instantly.
Frequently Asked Questions
Related JSON Examples
AI & LLMLLM Tool / Function CallFunction-calling JSON: a tool definition plus the model's tool_call with arguments.AI & LLMAnthropic Claude Messages ResponseClaude Messages API response with content blocks, stop_reason, and token usage.AI & LLMAI Agent Run TraceAgent run with goal, reasoning steps, tool calls, observations, and final output.