| id | course-mcp-tools-l03 | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| type | course | |||||||||||||||
| title | Validation and error isolation | |||||||||||||||
| summary | Arguments are untrusted input: validate before execution, and never let a handler crash the transport. | |||||||||||||||
| lang | en-US | |||||||||||||||
| content_version | 1 | |||||||||||||||
| status | reviewed | |||||||||||||||
| reviewed_on | 2026-09-12 | |||||||||||||||
| hints |
|
Arguments are untrusted input: validate before execution, and never let a handler crash the transport.
Two boundaries make a tool server safe: validate required arguments against the declared input schema (missing arguments become structured results, not exceptions), and wrap every handler so its failures return isError instead of breaking the connection. 03-missing-argument.json shows the first boundary on the wire.
- Trace each validation test to the contract line it pins
- Ask: what happens if a handler raises InputRequired? (Next lesson.)
The lesson's commands run, and you can answer these in your own words (the agent asks; you answer — that is the gate):
- Which command did this lesson run, and what did it decide?
- What failed at the start, and why — in your own words?
- Before trusting a similar change next time, what would you check first?
The command transcript and your answers.