Skip to content

fix(cli): show individual MCP tools in Dev UI graphs - #7680

Open
its-amann wants to merge 1 commit into
google:mainfrom
its-amann:fix/mcp-toolset-graph-7600
Open

its-amann wants to merge 1 commit into
google:mainfrom
its-amann:fix/mcp-toolset-graph-7600

Conversation

@its-amann

Copy link
Copy Markdown

Link to Issue or Description of Change

Closes: #7600

Problem

The Dev UI serializes an MCP toolset as a single node named after its class. Its individual tools never reach the graph, and multiple instances collapse into the same node. Tool call events therefore have no matching leaf to highlight.

Solution

  • Resolve toolsets asynchronously in the Dev UI graph endpoints, using the existing tool filtering, prefixing and listing cache.
  • Give each toolset a stable, agent scoped ID while keeping its class name as the display label.
  • Render agent → toolset → tool edges. Keep a placeholder when discovery fails or returns no tools, without hiding healthy toolsets or local functions.
  • Keep the existing synchronous serialization API compatible and propagate resolved tools through nested agents and workflows.

Thanks @surajksharma07 for reproducing this and suggesting the endpoint-side resolution approach. I checked the complete rendering flow: the existing frontend highlights the intermediate toolset and both edges once the backend supplies the hierarchy, so no adk-web production change is needed.

Testing Plan

Unit tests

Ran the repository's full configured tox matrix on Linux, with four isolated environments in parallel:

tox run-parallel -p 4 --parallel-live --parallel-no-spinner --result-json tox-results.json
Python Passed Skipped Exit code
3.11.10 20,853 93 0
3.12.13 20,808 130 0
3.13.17 20,844 94 0
3.14.9 20,845 93 0

All four environments and the overall tox invocation returned 0. Each environment also reports 18 xfailed and 2 non strict xpassed tests. No test-selection exclusions were used.

Coverage includes list/predicate filters, prefixes, separate toolsets with different confirmation settings, partial discovery failure, empty listings, nested workflows, node-level graph requests, cached discovery and cancellation propagation. The original missing node regression cases fail before this fix.

Also checked the relevant modules against MCP 1.24.0 on Python 3.11: 169 passed, 1 skipped and 1 deselected on Windows. The deselected case requires Windows symlink privileges; it is included in the full Linux runs above.

Ruff, isort, pyink, compliance, documentation-link and spelling checks passed; the new-file convention check ran through Git Bash. Fresh Linux wheel and source builds also passed. Changed-module mypy results match the base branch's existing EvalSet return type error, with no new errors.

Manual end to end tests

Ran ADK Web with a real local stdio MCP server exposing add and greet, two filtered/prefixed toolsets (one requiring confirmation), and a local function tool. A deterministic test model called math_add(2, 3) and received 5.

To reproduce, start adk web for that agent, open the structure view, and run the tool call. Both toolsets should remain separate. Selecting either the tool-call or tool-response event should highlight the correct agent → toolset → tool path, leaving the unused toolset and local function unhighlighted. Verified both event selections in ADK Web; frontend full-flow tests also cover call/response highlighting in light and dark themes.

Tool Call :

image

Tool Response :

image

Checklist

  • Contribution guide read.
  • Regression tests added in the existing test modules.
  • Relevant formatting and compliance checks passed.
  • Manually verified the Dev UI with a local MCP server.
  • Full configured Python 3.11–3.14 tox matrix passed.
  • No downstream changes are required.
  • Final author review before submitting.

Resolve toolsets before serializing Dev UI graphs and preserve their hierarchy with stable parent IDs. Keep graph endpoints usable when discovery fails, without changing synchronous callers.

Fixes google#7600
@its-amann

Copy link
Copy Markdown
Author

@surajksharma07, this is ready for review following your guidance on #7600. The tests cover filters/prefixes, separate toolsets and failed discovery, and the full Python 3.11-3.14 tox matrix passed.

I also checked tool-call and tool-response highlighting in the existing UI (screenshots above); no adk-web change was needed. Could you take a look when you have a chance? Happy to adjust anything that doesn't fit the graph design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev UI graph: McpToolset renders as one opaque node; tools inside it are not shown and never highlight when called

2 participants