-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
planned[Status] This issue is planned to be work on by ADK eng team[Status] This issue is planned to be work on by ADK eng teamtools[Component] This issue is related to tools[Component] This issue is related to tools
Description
Thanks to @jnuvola for reporting this issue! Let's track it here.
@xuanyang15 Really appreciate you looking into this! Here's a minimal reproduction:
import asyncio import os import google.auth from google.auth.transport.requests import Request from google.adk.agents import Agent from google.adk.tools.mcp_tool.mcp_toolset import McpToolset from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams from google.adk.runners import Runner from google.adk.sessions import InMemorySessionService from google.genai import types # Enable the flag os.environ["ADK_ENABLE_JSON_SCHEMA_FOR_FUNC_DECL"] = "1" BIGQUERY_MCP_URL = "https://bigquery.googleapis.com/mcp" BIGQUERY_SCOPE = "https://www.googleapis.com/auth/bigquery" async def main(): # Get credentials credentials, project = google.auth.default(scopes=[BIGQUERY_SCOPE]) credentials.refresh(Request()) # Create BigQuery MCP toolset bq_toolset = McpToolset( connection_params=StreamableHTTPConnectionParams( url=BIGQUERY_MCP_URL, headers={"Authorization": f"Bearer {credentials.token}"}, timeout=30.0, ) ) # Create agent with BigQuery MCP tools agent = Agent( model="gemini-2.5-flash", name="bq_agent", instruction="You are a BigQuery assistant.", tools=[bq_toolset], ) runner = Runner( agent=agent, app_name="test", session_service=InMemorySessionService(), ) session = await runner.session_service.create_session( app_name="test", user_id="test" ) user_message = types.Content( role="user", parts=[types.Part(text="List datasets in my project")] ) # This will fail with 400 INVALID_ARGUMENT async for event in runner.run_async( user_id="test", session_id=session.id, new_message=user_message, ): print(event) if __name__ == "__main__": asyncio.run(main())
ADK_ENABLE_JSON_SCHEMA_FOR_FUNC_DECL=1->google.genai.errors.ClientError: 400 INVALID_ARGUMENT
ADK_ENABLE_JSON_SCHEMA_FOR_FUNC_DECL=0-> works correctly
jnuvola
Metadata
Metadata
Assignees
Labels
planned[Status] This issue is planned to be work on by ADK eng team[Status] This issue is planned to be work on by ADK eng teamtools[Component] This issue is related to tools[Component] This issue is related to tools