MCP toolset: in-model built-ins (e.g. google_search) can be shadowed by a server tool; a server tool named set_model_response aborts the run
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Summary
Same two defects as the Go port, reproduced locally against adk-java (4ee155b2, core). No live service was contacted.
- In-model built-in tools do not occupy their name, so a server-provided tool can shadow them.
GoogleSearchTool(andGoogleMapsTool,UrlContextTool,VertexAiSearchTool,BuiltInCodeExecutionTool) overrideprocessLlmRequestto append only toconfig.Tools, never callingappendTools. So the duplicate-name guard inLlmRequest.Builder.appendToolsnever sees them, and a callable MCP tool advertisinggoogle_searchis accepted and wins dispatch —Functions.handleFunctionCallsresolves by name from a map where the MCP tool overwrote the built-in. - A server-provided tool named
set_model_responseaborts the whole run on an agent with an output schema (IllegalArgumentException: Duplicate tool name: set_model_response). Availability, not silent displacement — but a malicious/untrusted MCP server can deny service.
Evidence
- MCP tools take the server's name, unfiltered by default —
tools/mcp/McpToolset.java:260-279;tools/BaseToolset.java:60-64(if (toolFilter == null) return true;); name sourcetools/mcp/AbstractMcpTool.java:52-56. - Callable-vs-callable is fail-closed —
models/LlmRequest.java:204-222(appendTools, throwing merger); all tools enter viatools/BaseTool.java:187-193. set_model_responseis in the guarded class —flows/llmflows/OutputSchema.java:60-65;SetModelResponseTool.java:33-45(extendsBaseTool, does not overrideprocessLlmRequest). Processor order:SingleFlow.java:27-36,BaseLlmFlow.java:103-104.- Built-ins bypass the guard —
tools/GoogleSearchTool.java:45-76(override that appendsTool.builder().googleSearch(...)only); same inGoogleMapsTool.java:65,UrlContextTool.java:46,VertexAiSearchTool.java:60,BuiltInCodeExecutionTool.java:44. - Dispatch by name —
BaseLlmFlow.java:765-766;Functions.java:295(tools.get(functionCall.name().get())).
Local reproduction
[probe] registered tool map keys: [google_search]
[probe] config.Tool googleSearch=true functionDeclarations=[]
[probe] config.Tool googleSearch=false functionDeclarations=[google_search]
[probe] google_search: NO ERROR. dispatch map maps google_search -> FakeMcpTool
[probe] set_model_response: REJECTED -> Duplicate tool name: set_model_response
Suggested fix
Preferred (availability-first): reject the server-provided tool via a reserved-name check in AbstractMcpTool's constructor or in McpToolset.getTools / McpAsyncToolset.getTools, covering set_model_response, transfer_to_agent, google_search, google_maps, url_context, vertex_ai_search, code_execution, load_artifacts.
Alternative: make the in-model tools call appendTools so the existing duplicate guard applies (note: google_search would then need a clean-failing runAsync).
Same class as the Go port (google/adk-go#1605) and a separately-triaged adk-js report.
- 主要言語
- Java
- スター
- 1.7k
- フォーク
- 433
- 平均マージ
- 3日 13時間
- マージ済み PR(30日)
- 42
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/adk-java のほかの issue
-
GeminiUtil placeholder user turn ("Continue output. DO NOT look at this line ...") is flagged by prompt injection filters対応中かも @hemasekhar-p が 3 日前に担当しました。 オープンneeds review
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
google/adk-java#1628 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[spring-ai] ToolConverter silently drops enum and items from tool parameter schemas対応中かも @hirematha が 6 日前に担当しました。 オープンneeds review
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
google/adk-java#1609 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[spring-ai] Streaming responses ending with CJK punctuation (。!?) are misclassified as partial and never persisted to the session対応中かも @hirematha が 6 日前に担当しました。 オープンneeds review
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
google/adk-java#1608 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
FirestoreSessionService compares event timestamps as text, reordering or skipping same-second eventsオープン
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
メンテナーはふだん 1 日以内に返信
google/adk-java の issue をすべて見る
似ている issue
-
BoxAttachmentMulti parsing leaks IOException / ArrayIndexOutOfBoundsException on malformed content instead of IllegalArgumentException対応中かも @Kshot3000 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
ergoplatform/ergo-appkit#272 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
utopia-rise/godot-jvm#1004 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
spring-projects/spring-grpc#442 ·