schema · growing
Anatomy of a server
Declare capabilities, answer list, handle call, return content. Smaller than it sounds.
A server is smaller than it sounds. It declares what it can do, then answers two kinds of call for each primitive: list them and do one.
Declare capabilities
Answer tools/list
Handle tools/call
Return content
Validate input
Talk to the real system
Shape the result
Report errors as text
The shape of one tool
| Field | Why it matters |
|---|---|
| name | stable identifier — renaming it breaks callers |
| description | the only documentation the model reads |
| inputSchema | JSON Schema; the client can validate before calling |
| handler | your code — and the only place privileges are used |
The hardest part of writing a server is not the protocol — the SDKs handle that. It is deciding what to expose and what to keep out of reach.