ADK Python's resource tool is opt-in and takes resource names, never URIs
Kind: idiosyncrasy · Status: current · Last verified: 2026-11-27 · Clients: adk-python · Revisions: 2025-11-25, 2026-07-28
Read at c6586f19.
McpToolset(use_mcp_resources=True) appends one tool, load_mcp_resource, after the server's own tools. The parameter defaults to False, and with the default ADK itself sends no resources/* request for that toolset. The constructor docstring says tool_filter does not apply to this tool.
The mechanism
- Before each model request,
LoadMcpResourceTool.process_llm_requestcallsresources/listand adds the JSON array of resource names to the instructions, with a sentence telling the model to callload_mcp_resourcebefore answering questions about them. - The tool takes one argument,
resource_names, an array of strings. Its result is a status stub: the names, and the text "resource contents temporarily inserted and removed. to access these resources, call load_mcp_resource tool again." - When the next model request is built, the same hook finds that function response as the last content, calls
McpToolset.read_resourcefor each name, and appends oneuserturn per content item: a text part "Resourceis:" followed by the text, or by the decoded blob with its MIME type.
read_resource resolves a name through get_resource_info, which calls resources/list again and returns the first resource whose name matches. It then calls resources/read with that resource's uri.
What follows from the code
- The model never sees a URI. It sees names in the instructions and passes names back.
- Two resources with the same name cannot both be read. The first match is returned.
list_resourcessends no cursor, so a resource on a later page is neither listed to the model nor found by name.resources/templates/listis never called. A templated resource cannot be read.- Reading one resource costs a
resources/listand aresources/read, and every model request adds one moreresources/list. - The contents are appended to the outgoing request only. The status text tells the model to call the tool again when it needs them later.
- A failure to list or read is logged as a warning and the request goes ahead without the content.
Against the other reads
Codex and Kilo Code are recorded in this registry with three host tools named list_mcp_resources, list_mcp_resource_templates and read_mcp_resource; opencode now has two, without the templates tool. [[model-initiated-resource-read]] describes the proposal those tools anticipate, which is a way for the model to read a resource by URI. ADK has one tool, under a different name, and it takes names. Its own result carries a status stub, and the contents arrive as separate user turns on the next request.
Sources
- src/google/adk/tools/load_mcp_resource_tool.py, LoadMcpResourceTool, commit
03725e8c,src/google/adk/tools/load_mcp_resource_tool.py:LoadMcpResourceTool, 2026-11-27 - src/google/adk/tools/mcp_tool/mcp_toolset.py, use_mcp_resources and the three resource methods, commit
03725e8c,src/google/adk/tools/mcp_tool/mcp_toolset.py:McpToolset.__init__,McpToolset, 2026-11-27