MCPA Certification Curriculum

The Contract Inside a Tool Definition

An inputSchema is not a suggestion the model can approximate: a server checks arguments against it before a handler ever runs, and a broken argument still comes back as a result the model can read and fix. Name the fields on a tool definition beyond name and description, including outputSchema, icons, and annotations, and state the one thing inputSchema must never be. Explain why JSON Schema 2020-12 is the default dialect for inputSchema and outputSchema, when a schema declares a different one explicitly, and what SEP-2106 loosened about which keywords a schema may use. Trace how structuredContent conforms to outputSchema and why a server also serializes that same value into a text content block. State the tool naming rules and why a host that aggregates several servers prefixes names instead of trusting serverInfo for uniqueness. Separate an unknown tool, a protocol error, from arguments that fail a schema, a tool execution error with isError true, and explain why only the second one reliably reaches the model. The discovery step from lesson 07 gets a client a list of tools, each with a name and a description a model can read. A description is prose, though, and prose is not something a program checks an arguments object against. "Look up a product by its SKU" tells a reader what the tool…

The Contract Inside a Tool Definition: An inputSchema is not a suggestion the model can approximate: a server checks arguments against it before a handler…

This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.

Browse the complete course catalog or open this lesson on GitHub.