Interactions: stateless replay of an `mcp_server_tool_result` whose `structured_content` holds a `$ref` returns 400
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 57/100
Hướng nghiên cứu
Start by tracing how the SDK models and serializes mcp_server_tool_result steps for stateless Interactions API requests; the issue does not name specific files or tests. Compare the returned structured_content reference with the replayed function response, then add a regression test using the reproduction shape. Done means replaying the emitted steps succeeds when structured_content contains a $ref.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This issue was posted by Claude Code using claude-opus-5-5 on behalf of David.
Interactions API rejects its own mcp_server_tool_result step on stateless replay when structured_content contains a $ref.
With store: false, sending back the steps a previous interaction returned fails with HTTP 400 when an MCP image result came from a server that also sets structuredContent:
400 {"error":{"message":"The referenced name `structured_content.result[0]` in function_response.response does not match to a display_name in the function_response.parts.","code":"invalid_request"}}
The step is exactly what the API emitted. Image results without structured_content, and audio and embedded-resource results, replay fine (200).
Reproduce (raw HTTP, no SDK)
-
Run a public MCP server with a tool returning an
ImageContentblock and matchingstructuredContent. FastMCP does this for a tool annotated-> list[ImageContent]:from mcp.server.fastmcp import FastMCP from mcp.types import ImageContent PNG = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR4nGNg+M/A8B8ABf4C/gzLSmsAAAAASUVORK5CYII=' mcp = FastMCP('probe', stateless_http=True) @mcp.tool() def get_image() -> list[ImageContent]: return [ImageContent(type='image', data=PNG, mimeType='image/png')] mcp.run(transport='streamable-http') -
POST /v1beta/interactionswithmodel: gemini-3.8-flash,store: false,tools: [{"type": "mcp_server", "name": "probe", "url": "<server>/mcp"}], and auser_inputasking it to callget_image. The response contains:{"type": "mcp_server_tool_result", "call_id": "...", "signature": "...", "name": "probe:get_image", "server_name": "probe", "result": {"call_tool_result_json": "{\"content\":[{\"type\":\"image\",...}],\"structuredContent\":{...}}", "structured_content": {"result": [{"$ref": "structured_content.result[0]"}]}}} -
Send a second request whose
inputis the firstuser_input, every returned step unchanged, and a newuser_input. It returns the 400 above. Dropping only that tool's call and result steps returns 200.
Related: the live result shape differs from the reference and SDK types
- The API reference documents
mcp_server_tool_result.resultas(ImageContent or TextContent) array,objectorstring. Live results for text, image, audio and embedded-resource tools all arrive as an undocumented object:call_tool_result_json(the MCPCallToolResultas a JSON string), optionalstructured_content, a plain-textresult, and for blob resources a key named after the MIME type ("application/pdf": "<base64>"). MCPServerToolResultStepResultin this SDK is an empty model, so none of those fields are typed. The list branch types only text and image items; audio, video and document items parse asUnknownFunctionResultSubcontent.
Observed with google-genai 2.30.0 on the Gemini API (gemini-3.8-flash), November 2026.
- Ngôn ngữ chính
- Python
- Star
- 4.1k
- Fork
- 1.1k
- Merge trung bình
- 1 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 103
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của googleapis/python-genai
-
Test import module that doesn't existCó thể đã có người làm @Venkaiahbabuneelam đã nhận 24 ngày trước. Đang mởpriority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
googleapis/python-genai#3122 · 6 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Curated history keeps half a user turn when the model turn is invalidCó thể đã có người làm @Venkaiahbabuneelam đã nhận 33 ngày trước. Đang mởpriority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
googleapis/python-genai#3051 · 3 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: Unsubscripted typing.List and typing.Dict crash convert_if_exist_pydantic_model in AFCCó thể đã có người làm @Venkaiahbabuneelam đã nhận 33 ngày trước. Đang mởpriority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/python-genai#3044 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
googleapis/python-genai#3314 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
SyntaxWarning on import in 3.0.0 (invalid escape sequence in types.py)Có thể đã có người làm @VISHNU0906 đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 35/100
googleapis/python-genai#3308 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của googleapis/python-genai
Issue tương tự
-
integration: logger
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
home-assistant/core#191147 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation p4
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
MillenniumDawn/focus-tree-creation-tool#417 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CharlesP44/Beem_Energy#96 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
rheeloaded/paperpull#153 ·
Maintainer thường phản hồi trong vòng 1 ngày