-
Notifications
You must be signed in to change notification settings - Fork 164
Let the MCP tool execution result be sent back to the model #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
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. |
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
a4c013f to
d54a532
Compare
|
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 |
|
@shukladivyansh for sure, but:
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. |
Yes, in this codebase that is. Users downstream might be reusing our tools/models and it would break them.
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.
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. |
Very naive way to handle #504