ADK Python declares no client capabilities unless the application passes callbacks
Kind: nuance · Status: current · Last verified: 2026-11-16 · Clients: adk-python · Revisions: 2025-11-25, 2026-07-28
Read at c6586f19. SDK behaviour is from the mcp 2.3.0 wheel.
The default
The Python SDK derives the client capability object from the callbacks given to ClientSession. ADK builds its ClientSession in one place, SessionContext._run. It passes sampling_callback, sampling_capabilities, elicitation_callback and message_handler through from the application, and all four default to None on McpToolset. It always passes client_info, which is google-adk and the ADK version. It never passes list_roots_callback or logging_callback.
A default construction therefore sends "capabilities": {}. The probe's initialize capture at 2.14.0 shows the same.
| Capability | Default | What the application can change |
|---|---|---|
sampling |
not declared | Pass sampling_callback. The SDK then declares sampling, using sampling_capabilities as the value when it is given. |
elicitation |
not declared | Pass elicitation_callback. The SDK then declares form and url together. |
roots |
not declared | Nothing. McpToolset has no parameter for a roots callback. |
| logging | no client capability exists | Pass message_handler to receive notifications/message with every other notification. ADK never calls logging/setLevel. |
ADK ships no implementation of either callback. The handler, and for sampling the model behind it, are the application's code. No file under src/ outside the three MCP client modules mentions sampling_callback or elicitation_callback.
Two construction routes cannot carry a callback at all. McpInstructionProvider builds its own MCPSessionManager with only the connection params and an error stream. McpToolset.from_config, used for agent config files, reads McpToolsetConfig, which has no callback field.
On a 2026-07-28 connection
This section was read from source and not run.
With ADK_ENABLE_MCP_MODERN_PROTOCOL set on SDK 2.x, the capability object travels in the _meta of every request. It is built by the same function, so an application callback is still advertised.
At 2026-07-28 a server asks for sampling, elicitation or roots by returning an InputRequiredResult from tools/call. McpTool._call_tool_on_session calls session.call_tool(name, arguments=..., progress_callback=..., meta=...) and does not pass allow_input_required. In mcp 2.3.0 that makes call_tool raise RuntimeError when the server returns an InputRequiredResult. The loop that answers the embedded requests from the callbacks and retries is built by the SDK's high-level Client, and ADK uses ClientSession directly.
McpTool.run_async catches the error under its default graceful-error setting and returns {"error": "Unexpected error during MCP tool execution: ..."} to the model. The application callback is not called. A comment in _run_async_impl beside the resultType handling says that acting on input_required "is a feature, not compatibility".
Sources
- src/google/adk/tools/mcp_tool/session_context.py, the ClientSession construction, commit
03725e8c,src/google/adk/tools/mcp_tool/session_context.py:SessionContext._run, 2026-11-27 - src/google/adk/tools/mcp_tool/mcp_toolset.py, the McpToolset constructor and McpToolsetConfig, commit
03725e8c,src/google/adk/tools/mcp_tool/mcp_toolset.py:McpToolset.__init__,McpToolsetConfig, 2026-11-27 - src/google/adk/agents/mcp_instruction_provider.py, a session manager with no callbacks, commit
03725e8c,src/google/adk/agents/mcp_instruction_provider.py:McpInstructionProvider.__init__, 2026-11-27 - src/google/adk/tools/mcp_tool/mcp_tool.py, the tools/call request and the error boundary, commit
03725e8c,src/google/adk/tools/mcp_tool/mcp_tool.py:McpTool.run_async,McpTool._run_async_impl,McpTool._call_tool_on_session, 2026-11-27 - mcp 2.3.0, _build_capabilities, call_tool and the input_required driver,
mcp/client/session.py, mcp/client/_input_required.py, 2026-11-16