-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Prerequisites
- I've searched the current open issues
- I've updated to the latest version of Toolbox
- I've updated to the latest version of the SDK
Toolbox version
toolbox version 0.28.0+binary.linux.amd64.81253a0
Environment
- Package:
google-adk[toolbox](latest) - Python: 3.11
- OS: Linux (WSL)
- Toolbox Server: Running locally on
http://127.0.0.1:5000and on Cloud Run - Tools: 7 BigQuery SQL tools defined in
tools.yaml
Client
- Client: .
- Version: (
pip show <package-name>)? e.g.
- toolbox-core version 0.1.0
- Example: If possible, please include your code of configuration:
# Code goes here! Expected Behavior
When a user asks "Show DNS records for example.com", the agent should:
- Recognize the query requires the
get_dns_records_by_zone_nametool - Call the tool with appropriate parameters
- Return the results to the user
Current Behavior
The agent:
- Responds to the user query
- Does NOT call any tools
- Sometimes attempts to execute Python code instead:
print(get_dns_records_by_zone_name(zone_name='example.com')) - Returns "Unexpected tool call" errors
Steps to reproduce?
Agent Definition (agent.py):
from google.adk import Agent
from toolbox_adk import ToolboxToolset, CredentialStrategy
TOOLBOX_URL = "http://127.0.0.1:5000"
# Create toolset
toolset = ToolboxToolset(server_url=TOOLBOX_URL)
# Create agent
root_agent = Agent(
model="gemini-2.5-flash",
name='dns_agent',
description="Agent that queries DNS records",
instruction="Use the available tools to query DNS records when users ask.",
tools=[toolset],
)Tools load successfully
✓ Connected to toolbox
✓ Loaded 7 tools from toolset 'my_bq_toolset'
Tools work when called directly with ToolboxSyncClient
from toolbox_core import ToolboxSyncClient
client = ToolboxSyncClient("http://127.0.0.1:5000")
tools = client.load_toolset('my_bq_toolset')
result = tools[0](zone_name='example.com', limit=5)
Returns: '[{"id":"...", "name":"141234._domainkey.example.com", ...}]'
✓ Tools execute correctly and return JSON data
But ADK agent doesn't call them
[user]: Show DNS records for example.com
[agent]: Hello! I can help you query DNS records.
No tool call happens, no results shown
### Investigation
1. **ToolboxToolset has no `tools` attribute**:
```python
toolset = ToolboxToolset(server_url=TOOLBOX_URL)
print(hasattr(toolset, 'tools')) # False
-
Tools work with ToolboxSyncClient:
- Tools load correctly
- Tools execute and return proper JSON
- This confirms the toolbox server and tools are working
-
ADK doesn't recognize the tools:
- Agent loads without errors
- Agent responds to queries
- Agent never calls the tools
- Sometimes tries to execute Python code instead
Questions
- Does
ToolboxToolsetproperly implement the ADKBaseToolsetinterface? - Are there additional configuration steps needed for ADK to recognize the tools?
- Is there a specific tool schema format required by ADK?
- Should tools be exposed differently (e.g., as individual
BaseToolobjects)?
Workaround Needed
Is there a recommended way to manually wrap toolbox tools as ADK-compatible tools? For example:
from google.adk.tools import BaseTool
# Manually wrap each toolbox tool?
class ToolboxToolWrapper(BaseTool):
def __init__(self, toolbox_tool):
self.toolbox_tool = toolbox_tool
# ... implement ADK interfaceAdditional Context
- Following official documentation: https://google.github.io/adk-docs/integrations/mcp-toolbox-for-databases/
- Following toolbox-adk README: https://github.com/googleapis/mcp-toolbox-sdk-python/tree/main/packages/toolbox-adk
- Tools are defined in
tools.yamlwith proper BigQuery SQL configuration - Toolbox server is running and accessible
- Authentication works (tested with Workload Identity for Cloud Run)
Logs
No errors in logs. Agent loads successfully but simply doesn't call tools:
INFO:root:Connecting to toolbox: http://127.0.0.1:5000
INFO:root:Successfully initialized Toolbox Toolset
Request
Please provide guidance on:
- How to properly integrate
ToolboxToolsetwith ADK agents - Whether this is a known issue
- If there's a workaround or alternative integration method
- Whether additional configuration is needed
Additional Details
No response