Skip to content

ToolboxToolset not exposing tools to ADK Agent - tools load but agent doesn't call them #585

@rahulracker7539

Description

@rahulracker7539

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:5000 and on Cloud Run
  • Tools: 7 BigQuery SQL tools defined in tools.yaml

Client

  1. Client: .
  2. Version: (pip show <package-name>)? e.g.
  • toolbox-core version 0.1.0
  1. 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:

  1. Recognize the query requires the get_dns_records_by_zone_name tool
  2. Call the tool with appropriate parameters
  3. Return the results to the user

Current Behavior

The agent:

  1. Responds to the user query
  2. Does NOT call any tools
  3. Sometimes attempts to execute Python code instead: print(get_dns_records_by_zone_name(zone_name='example.com'))
  4. 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
  1. Tools work with ToolboxSyncClient:

    • Tools load correctly
    • Tools execute and return proper JSON
    • This confirms the toolbox server and tools are working
  2. 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

  1. Does ToolboxToolset properly implement the ADK BaseToolset interface?
  2. Are there additional configuration steps needed for ADK to recognize the tools?
  3. Is there a specific tool schema format required by ADK?
  4. Should tools be exposed differently (e.g., as individual BaseTool objects)?

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 interface

Additional Context

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:

  1. How to properly integrate ToolboxToolset with ADK agents
  2. Whether this is a known issue
  3. If there's a workaround or alternative integration method
  4. Whether additional configuration is needed

Additional Details

No response

Metadata

Metadata

Assignees

Labels

type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions