Put the MCP tool discovery and invocation steps in the correct order
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
MCP tool use is discovery-before-call: the host lists tools, injects their schemas into the model, the model picks one, then the host invokes it and returns the result.
Imagine walking into a workshop you've never seen. First you read the labels on every machine to learn what each does and which buttons it needs. That is the host asking the server for its tool list. Then you decide which machine fits your task, set its dials correctly, and press start. That is the model picking a tool and the host running it. The machine does its work and hands you the finished part, which is the server returning a result. You never press start before reading the labels, because you would not know what the machine expects. MCP enforces the same order: discover what exists and how to call it, then call it.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: handshake then tools/list discovery, schema injection into the model, model selection, tools/call dispatch, content array result, and why the order cannot invert.
| Step | Message | Direction |
|---|---|---|
| Discover tools | tools/list | Host to server |
| Return catalog | Array with name, description, inputSchema | Server to host |
| Expose to model | Tool definitions injected into context | Host to model |
| Model selects | Structured function-call request | Model to host |
| Invoke tool | tools/call with name and arguments | Host to server |
| Return result | content array, optional isError true | Server to host |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Putting the tool call before discovery. The model cannot invoke a tool whose name and argument schema it has never seen injected into context.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.