Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Check the server's capabilities during initialize and degrade gracefully up front; never blindly call a feature the server never advertised.
Imagine plugging a new appliance into a wall socket. Before you switch it on, you check whether the socket actually supplies what the appliance needs. If the socket has no grounding pin, you do not just flip the switch and hope. You either pick a different socket or tell the user the appliance will run in a limited mode. MCP capability negotiation works the same way. During the opening handshake, the server hands the client a list of what it actually supports. The client reads that list first. If a feature is missing, the client disables the matching button or warns the user, instead of firing a call that is doomed to error.
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: the initialize handshake + what each side advertises + why detect at init not runtime + graceful degradation patterns + compatibility payoff.
| Behavior | When detected | User experience |
|---|---|---|
| Graceful degradation | At initialize, from capabilities object | Feature hidden or explained; no failed call |
| Call anyway, handle error | At runtime, via error response | Wasted round trip; cryptic error to debug |
| Silent skip | At runtime, no signal | Functionality vanishes with no explanation |
| Assume full support | Never; assumption only | Breaks against any partial server |
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.
Calling a capability the server never advertised and treating the runtime error as the discovery mechanism. The handshake exists precisely to avoid that.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.