McpTool drops structuredContent and non-text content from CallToolResult
Los mantenedores suelen responder en 1 día
@hemasekhar-p ya está trabajando en esto.
Desde el 21/8/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
🔴 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%)
- Lenguaje dominante
- Java
- Estrellas
- 1.7k
- Forks
- 431
- Merge medio
- 2 d 20 h
- PR fusionados (30 d)
- 42
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de google/adk-java
-
[spring-ai] ToolConverter silently drops enum and items from tool parameter schemasPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
google/adk-java#1609 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[spring-ai] Streaming responses ending with CJK punctuation (。!?) are misclassified as partial and never persisted to the sessionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
google/adk-java#1608 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[spring-ai] Bridge drops reasoning_content (thinking) — surface it as partial events and/or persist itPosiblemente ocupada @hemasekhar-p la tomó hace 1 día. Abiertoneeds review
google/adk-java#1616 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
needs review
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
google/adk-java#1598 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
BaseLlmFlow nests each step inside the previous one and overflows the stack after a few hundred LLM callsPosiblemente ocupada @hemasekhar-p la tomó hace 8 días. Abiertoneeds review
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
google/adk-java#1564 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de google/adk-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
-
Make branch and label autocomplete matching locale-independentPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
jenkinsci/gitlab-plugin#1950 ·
-
Place type search does not workAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
commons-app/apps-android-commons#6984 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
It's not necessary to copy the memory block in the readWrite() of org.h2.store.fs.mem.FileMemDataAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
h2database/h2database#4435 ·
Los mantenedores suelen responder en 1 día