Protocol Messages

MCP interview question · Medium difficulty

What do MCP's actual protocol messages look like?medium

Status
✓
Type
conceptual
Topic
protocol-messages
Frequency
common
Tags
mcp, tools/list, tools/call, JSON-RPC, protocol
Answer

MCP defines two core message exchanges: tools/list, where the client asks a server what it can do and the server returns tool names, descriptions, and input schemas, and tools/call, where the client sends a tool name and arguments and the server returns a result in a consistent content shape.

Explanation

The server never changes the response shape and the client never has to guess how to parse it — that consistency is the actual protocol. A tools/list reply is an array of objects like {name, description, inputSchema}; a tools/call reply is shaped like {content: [{type, text}]}. Because every compliant server returns exactly this shape, a client written against one MCP server works against any other without special-casing.

Follow-upWhat happens if a tool's inputSchema doesn't match the arguments a client sends?
Follow-upWhy does keeping the response shape identical across servers matter for client code?
Follow-upHow does tools/list differ from a REST API's OpenAPI schema?