Skip to content

Conversation

@nikoncode
Copy link

@nikoncode nikoncode commented Oct 15, 2025

Very naive way to handle #504

@google-cla
Copy link

google-cla bot commented Oct 15, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @nikoncode, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a minor but significant change to how the MCP tool's execution results are structured. The primary purpose is to standardize the key used for identifying the output, ensuring that the results are consistently and accurately communicated back to the model. This change improves clarity and maintainability of the data contract.

Highlights

  • Output Key Renaming: The key used to wrap the call result in the wrapCallResult method has been changed from "text_output" to "result".
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@nikoncode nikoncode changed the title Let the MCP tool execution result be sent back to the model Let the MCP tool execution result be sent back to the model (#504) Oct 15, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the key for the MCP tool execution result from text_output to result. This change appears to be to align with the data structure expected by the model. The change is correct, but I have provided a suggestion to improve maintainability by replacing magic strings with constants.

}
}
return ImmutableMap.of("text_output", resultMaps);
return ImmutableMap.of("result", resultMaps);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and avoid magic strings, consider defining "result" as a private static final String constant. This practice could be extended to other string literals used as map keys within this method (e.g., "error", "text", "content_details") to make the code more robust against typos and easier to refactor.

@nikoncode nikoncode changed the title Let the MCP tool execution result be sent back to the model (#504) Let the MCP tool execution result be sent back to the model Oct 15, 2025
@shukladivyansh
Copy link
Collaborator

Hi Mikita!

Thanks for looking into this. Can you do the fix in Claude.java instead (adk-java/core/src/main/java/com/google/adk/models/Claude.java) since others models may be depending on the current implementation of core/src/main/java/com/google/adk/tools/mcp/AbstractMcpTool.java

@nikoncode
Copy link
Author

nikoncode commented Oct 21, 2025

@shukladivyansh for sure, but:

  • I was not able to find any usage
  • I checked python adk and they have same logic relying on result field in Claude implementation

That's why I decided to proceed with fix in McpTool. Also I don't have keys to other models to verify that they work fine.

@shukladivyansh
Copy link
Collaborator

I was not able to find any usage

Yes, in this codebase that is. Users downstream might be reusing our tools/models and it would break them.

I checked python adk and they have same logic relying on result field in Claude implementation

I agree that we plan to follow adk python as closely as possible. But breaking users doesn't feel worth it in this case. Feel free to add a comment there that this logic deviates from adk python.

That's why I decided to proceed with fix in McpTool. Also I don't have keys to other models to verify that they work fine.

Totally understandable.

I would insist in this case to proceed with a minimal fix in Claude llm implementation. This wouldn't break users and also allow you to verify things on your end.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants