Skip to main content
It’s Monday morning in week 2 and Claire’s question is still pinned to the corner of your screen:
Which five accounts have the sharpest usage drops?
The MCP Toolbox lives in your project folder and publishes nine tools. Your agent must now choose the right ones to complete the churn analysis. The good news: most of your architecture stays the same.
A slide titled "What Doesn't Change" showing three teal rounded squares labeled "Model" (brain icon), "Churn Agent" (robot icon), and "Runner" (circular arrows). Arrows show flow from Model to Churn Agent and from Runner back to the Churn Agent.
What doesn’t change: the model (LiteLLM, pointing to Claude via API), and the runner (an in-memory runner with the same session and async loop). The only difference is that the agent now receives an MCP toolset (the Toolbox) instead of plain Python functions. The model still drives the logic; the Toolbox supplies scoped capabilities (SQL execution, schema inspection, forecasting, etc.).

High-level setup

At a glance you wire the toolset into the agent just like any other tool:
MCPToolset is ADK’s bridge to the MCP server (the Toolbox). In this example the toolset is configured to start the Toolbox as a subprocess using a stdio connection:

What each connection parameter means

Pass os.environ into the subprocess environment so the Toolbox can inherit your credentials and authenticate to BigQuery.
The tool_filter is important: every tool you hand to the model is a potential distraction. For churn analysis the agent needs to read the schema and run queries — so that’s what you expose.

Instruction: the agent’s working context

Give the model the table and the columns it should consider. The instruction string becomes the agent’s working context:
If you prefer automatic discovery, omit the Columns: stanza and keep get_table_info in the toolset so the agent can inspect the table before querying (example below).

Running the agent — an example session

When you run the script you’ll see the Toolbox start and the ADK filter the tools the agent receives:
Ask the agent about a specific customer and it will decide whether to call execute_sql. For example: You: Is customer cust-0003115 at risk?
agent → execute_sql
The agent composes and issues the SQL itself:
The row comes back via the Toolbox. The agent reads the signals and reports a verdict:

Answering Claire: Which five accounts have the sharpest drops?

Ask the agent directly and it will construct the ORDER BY / LIMIT query on usage_delta_30d: You: Which five accounts have the sharpest usage drops right now?
agent → execute_sql
Example agent output (truncated for brevity):
Because the agent can query the table directly, follow-up questions such as “Clarify churn next week” are handled by changing the query or adding a WHERE clause — the model composes the SQL for you.

Letting the agent discover schema automatically

If you want the agent to inspect the table itself, remove the explicit column list and keep get_table_info in the toolset. The agent will call get_table_info first, learn the schema, and then run queries:

Expanding agent capabilities with additional Toolbox tools

The Toolbox exposes more than SQL. Add analytics tools like forecast or ask_data_insights and the agent can perform time-series forecasting or automated insight generation without you hand-coding those analyses:
Or point the agent at a different table by changing the Table: line in INSTRUCTION. The MCP Toolbox plus tool filtering gives you a compact way to surface only the capabilities the model needs while letting the model drive SQL and analyses.
Carefully scope the tool_filter and subprocess environment. Exposing unnecessary tools or leaking credentials into the subprocess can increase security risk. Use least privilege for production deployments.

Watch Video

Practice Lab