Skip to content

Conversation

@anubhav756
Copy link

@anubhav756 anubhav756 commented Dec 10, 2025

Link to Issue or Description of Change

2. Or, if no issue exists, describe the change:

Problem:
The ToolboxToolset was implemented directly within adk-python, leading to code duplication and potential drift from the core toolbox-adk implementation.

Solution:
Refactored ToolboxToolset to act as a rigorous wrapper around the toolbox-adk package, which delegates all functionality to toolbox_adk.ToolboxToolset.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Summary:

  • Verified initialization flows through to toolbox-adk.
  • Verified auth_token_getters are correctly propagated.
  • Verified type hints are static-analysis friendly.

Manual End-to-End (E2E) Tests:

Manually verified standard toolbox loading and execution with the new wrapper:

from google.adk.tools import ToolboxToolset
from toolbox_adk import CredentialStrategy

# Loading with toolset_name
ts = ToolboxToolset(
    server_url='http://localhost:8080',
    toolset_name='calculator',
    credentials=CredentialStrategy.toolbox_identity()
)
tools = await ts.get_tools()
print(f'Loaded {len(tools)} tools')

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @anubhav756, 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 refactors the ToolboxToolset class to integrate with the toolbox-adk package, moving away from a direct dependency on toolbox_core. The change introduces a delegation pattern, where ToolboxToolset now wraps and utilizes toolbox_adk.ToolboxToolset for its core functionalities, streamlining tool management and enhancing configuration options for authentication and headers.

Highlights

  • Dependency Shift: The ToolboxToolset class has been refactored to remove direct dependencies on toolbox_core and FunctionTool, now relying on the toolbox-adk package for its core functionality.
  • Delegation Pattern: The ToolboxToolset now acts as a wrapper, delegating all tool loading and management operations to an internal instance of toolbox_adk.ToolboxToolset.
  • Enhanced Configuration: The __init__ method has been updated to accept new parameters such as credentials, additional_headers, and **kwargs, aligning with the configuration options provided by toolbox-adk.
  • Dependency Enforcement: An ImportError is now explicitly raised if the toolbox-adk package is not installed, guiding users to install the necessary dependency.
  • Documentation Update: The class docstring and example usage have been revised to reflect the new toolbox-adk integration, including an example demonstrating CredentialStrategy.
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.

@adk-bot adk-bot added the mcp [Component] Issues about MCP support label Dec 10, 2025
@adk-bot
Copy link
Collaborator

adk-bot commented Dec 10, 2025

Response from ADK Triaging Agent

Hello @anubhav756, thank you for creating this PR!

To help reviewers evaluate your contribution, could you please provide the following information as outlined in our contribution guidelines?

  • Link to Issue or Description of Change: Please link to an existing issue or provide a detailed description of the changes in the PR body.
  • Testing Plan: Please add a section describing the unit tests and manual end-to-end tests you performed to verify your changes.

This information will help reviewers to review your PR more efficiently. Thanks!

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 refactors the ToolboxToolset to act as a wrapper around the new toolbox-adk package. This is a good architectural change to delegate functionality to a specialized library. My review focuses on ensuring the wrapper is implemented cleanly and maintains its previous contract where appropriate. I've identified a few areas for improvement: removing verbose development comments, improving type hints for better static analysis, and re-introducing a validation check that was removed during the refactoring.

@anubhav756 anubhav756 force-pushed the feature/modify_adk_toolset branch from 58fdb71 to ca073ee Compare December 12, 2025 16:27
@anubhav756 anubhav756 marked this pull request as ready for review December 18, 2025 14:54
@anubhav756 anubhav756 force-pushed the feature/modify_adk_toolset branch from e864dff to cddc1b0 Compare December 18, 2025 14:54
@anubhav756 anubhav756 marked this pull request as draft December 18, 2025 15:05
@anubhav756 anubhav756 force-pushed the feature/modify_adk_toolset branch from cddc1b0 to b77934b Compare December 18, 2025 17:20
@anubhav756 anubhav756 marked this pull request as ready for review December 18, 2025 17:30
@anubhav756 anubhav756 changed the title feat: Modify the ADK ToolboxToolset refactor(tools): Update ToolboxToolset to wrap toolbox-adk Dec 18, 2025
@anubhav756 anubhav756 changed the title refactor(tools): Update ToolboxToolset to wrap toolbox-adk refactor(tools): Update ToolboxToolset to wrap toolbox-adk Dec 19, 2025
Removes verbose comments, improves type hints (dict -> Mapping), and restores validation check for toolset/tool names.
Adds 'from __future__ import annotations' and fixes Pyink formatting validation errors (docstring Indentation, trailing comma, line wrapping).
Uses TYPE_CHECKING import to reference toolset_adk.CredentialConfig for the credentials parameter, improving static analysis without adding runtime dependencies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mcp [Component] Issues about MCP support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants