McpTool drops structuredContent and non-text content from CallToolResult
メンテナーはふだん 1 日以内に返信
@hemasekhar-p がすでに取り組んでいます。
2026年8月21日 から。
評価
この issue はまだ評価されていません。
説明
🔴 Required Information
Describe the Bug:
AbstractMcpTool.wrapCallResult(...) silently discards parts of a successful MCP CallToolResult.
When the result contains at least one TextContent, native McpTool.runAsync(...) returns only the legacy text_output map. It does not expose:
CallToolResult.isErroron successful resultsCallToolResult.structuredContent- non-text
contententries such as images or embedded resources - the original ordered content list
This loss is irreversible for callers. An outer BaseTool decorator sees only the already-reduced map and cannot recover the discarded fields without bypassing native McpTool and invoking McpSyncClient itself.
Steps to Reproduce:
- Use
com.google.adk:google-adk:1.7.1. - Construct a native
McpToolsetover a streamable-HTTP MCP server. - Have the server advertise a zero-argument tool.
- Return this successful
tools/callresult:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [
{"type": "text", "text": "first"},
{"type": "text", "text": "second"},
{
"type": "image",
"data": "aW1hZ2U=",
"mimeType": "image/png"
}
],
"structuredContent": {"count": 2},
"isError": false
}
}
- Call the discovered native tool through
BaseTool.runAsync(...).
Expected Behavior:
Native MCP tools should preserve the complete semantic CallToolResult, including structured content and non-text content, without breaking callers that consume the existing text_output field.
A compatible resolution could be either:
- An additive envelope that retains
text_outputunchanged while also exposingcontent,structuredContent,isError, and metadata. - A supported result-mapper/adapter hook on
McpToolsetorMcpToolthat receives the rawCallToolResultbefore reduction.
Observed Behavior:
The returned map contains only:
{text_output=[{text=first}, {text=second}]}
structuredContent, image data and MIME type, the original content parts, and explicit non-error state are absent.
The loss is silent. No exception or warning indicates that valid MCP response data was discarded.
Environment Details:
- ADK Library Version (see maven dependency):
1.7.1 - MCP Java SDK resolved by ADK:
1.1.2 - MCP transport: streamable HTTP
- Java: 21
🟡 Optional Information
Regression:
No
Additional Context:
PR #1078 changed wrapCallResult to serialize the complete CallToolResult, but PR #1090 reverted that change to preserve backward compatibility with text_output.
The requested fix is therefore not to remove text_output. It is to preserve compatibility without silently losing the remaining MCP result fields.
This blocks replacing a custom MCP bridge with native McpToolset: the custom implementation currently preserves text, structuredContent, non-text content parts, and error state, while native McpTool does not.
Minimal Reproduction Code:
N/A. The issue can be reproduced using the MCP response above and a native McpToolset over a streamable-HTTP MCP server.
How often has this issue occurred?:
- Always (100%)
- 主要言語
- Java
- スター
- 1.7k
- フォーク
- 431
- 平均マージ
- 3日 9時間
- マージ済み PR(30日)
- 29
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/adk-java のほかの issue
-
BaseLlmFlow nests each step inside the previous one and overflows the stack after a few hundred LLM calls対応中かも @hemasekhar-p が 3 日前に担当しました。 オープンneeds review
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
google/adk-java#1564 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
AgentTool runs the wrapped agent with the default RunConfig instead of the caller's対応中かも @hemasekhar-p が 3 日前に担当しました。 オープンneeds review
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
google/adk-java#1562 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Approved tool call re-runs on every later user turn if it never got a function response対応中かも @hemasekhar-p が 6 日前に担当しました。 オープンneeds review
google/adk-java#1556 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
LocalSkillSource.listResources returns backslash-separated paths on Windows対応中かも @hemasekhar-p が 7 日前に担当しました。 オープンneeds review
google/adk-java#1541 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Context caching (ContextCacheConfig) is a silent no-op: config is plumbed to InvocationContext but never read対応中かも @hemasekhar-p が 8 日前に担当しました。 オープンneeds review
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
google/adk-java#1530 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
google/adk-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
geonetwork/geonetwork#227 ·
メンテナーはふだん 3 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Netcracker/qubership-testing-platform-tdm3#138 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
synthetichealth/synthea#1726 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bisq-network/bisq#8097 ·
メンテナーはふだん 1 日以内に返信
-
area/frontend good first issue kind/cooldown
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信