androidengineers.Book a session

Discovery and capability negotiation

Discovery and capability negotiation

articleSelf-paced

Build a client that learns supported operations instead of guessing.

1. Initialization

Establish the protocol version and supported capabilities before ordinary operations. Treat a failed handshake as an integration failure rather than sending speculative requests.

2. Tool discovery

Inspect tool names, descriptions and argument schemas. Validate the schema you support and apply an application allowlist; descriptions from a remote server are not trusted system instructions.

3. Changes and compatibility

Servers may change advertised capabilities. Handle missing or changed tools explicitly and test against a pinned server version for a reproducible release.

Worked scenario

A document server removes an export tool. The app disables export and explains the unavailable operation instead of hallucinating a successful result.

Apply it

Create a fake capability response and exercise supported, missing and malformed tools.

Check your understanding

Unknown capabilities produce a controlled result rather than arbitrary execution. Explain the decision and show evidence from your implementation or design. If you cannot demonstrate it yet, revisit the relevant section before continuing.

YOUR LEARNING JOURNEY

0 of 13 available lessons completed

Progress saved in this browser. No account needed.
Discovery and capability negotiation | MCP for Android Developers | Android Engineers