Skip to content

Failed MCP tool results are sent to the Interactions API with is_error=False #7824

Closed

Description

@adityasingh2400

🔴 Required Information

Describe the Bug:
With Gemini(use_interactions_api=True), a failed MCP tool call is sent to the Interactions API as a successful result. _convert_part_to_interaction_content in models/interactions_utils.py sets is_error on a function_result step only when the function response has an error key. A failed MCP CallToolResult reports the failure with isError: true (is_error in MCP SDK 2.x dumps) and has no error key, so the step goes out with is_error=False.

AnthropicLlm had the same gap and now reads isError/is_error (#7664, #7665).

Steps to Reproduce:

  1. Run an MCP server with a tool that fails (a raised exception becomes an isError: true result).
  2. Give an LlmAgent with Gemini(..., use_interactions_api=True) an McpToolset for that server.
  3. Have the model call the tool, then inspect the function_result step in the next interactions.create input.

Expected Behavior:
The function_result step has is_error=True.

Observed Behavior:

function_result sent to Gemini: name=read_file is_error=False result='Error executing tool read_file'

Environment Details:

  • ADK Library Version (pip show google-adk): 2.13.0 (also on main at 75fb788)
  • Desktop OS: macOS
  • Python Version (python -V): 3.11.16

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-2.5-flash with use_interactions_api=True

🟡 Optional Information

Additional Context:

func_resp: object = part.function_response.response
is_error = False
if isinstance(func_resp, dict) and 'error' in func_resp:
  is_error = True

How often has this issue occurred?:

  • Always (100%)

Activity

  1. adk-bot commented on Oct 30, 2026

    @adk-bot
    Collaborator

    Resolved by #7825 (imported and merged in commit 72205cd). Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions