Skip to content

fix: skip ADK toolsets in AgentConfig tool declaration extraction#6862

Closed
ks-hj wants to merge 1 commit into
googleapis:mainfrom
ks-hj:fix/agentconfig-skip-toolsets
Closed

fix: skip ADK toolsets in AgentConfig tool declaration extraction#6862
ks-hj wants to merge 1 commit into
googleapis:mainfrom
ks-hj:fix/agentconfig-skip-toolsets

Conversation

@ks-hj

@ks-hj ks-hj commented Jun 7, 2026

Copy link
Copy Markdown

Fixes #6861

AgentConfig._get_tool_declarations_from_agent raises TypeError for any ADK agent whose tools include a toolset (BaseToolset — e.g. McpToolset, OpenAPIToolset): toolsets have no _get_declaration() and are not plain callables, so they fall through to FunctionDeclaration.from_callable_with_api_optioninspect.signature()TypeError: <McpToolset object ...> is not a callable object. This breaks client-side eval inference (client.evals.run_inference) for every MCP-tooled ADK agent.

This change skips toolsets in the extraction loop (detected by their get_tools() interface), in both SDK copies — vertexai/_genai/types/evals.py and agentplatform/_genai/types/evals.py — mirroring the existing skip for declaration-less ADK tools. Toolset tool declarations cannot be resolved synchronously (async + context-dependent), and the declarations here are descriptive agent metadata.

Testing

  • New unit test TestAgentConfigToolDeclarations::test_skips_toolsets_without_declaration (regression: fake toolset no longer raises; declaration-bearing tool and plain callable still extracted).
  • pytest tests/unit/agentplatform/genai/test_evals.py -k "Transformers or DropEmptyColumns or AgentConfig" → 10 passed.
  • Verified end-to-end against a real ADK agent with McpToolset (previously failed with the exact traceback in the issue; with this patch, inference runs and tool calls execute normally).

ADK toolsets (e.g. McpToolset, OpenAPIToolset) expose their tools only
asynchronously via get_tools() and have no _get_declaration(); the
plain-callable fallback called inspect.signature() on the toolset
instance and raised TypeError, making any MCP-tooled ADK agent fail
client-side eval inference (AgentConfig.from_agent).

Skip toolsets in the extraction loop in both SDK copies; their tool
declarations cannot be resolved synchronously.

Fixes googleapis#6861
@ks-hj ks-hj requested a review from a team as a code owner June 7, 2026 15:57
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Jun 7, 2026
@google-cla

google-cla Bot commented Jun 7, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ks-hj

ks-hj commented Jun 7, 2026

Copy link
Copy Markdown
Author

Withdrawn.

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

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

evals: AgentConfig.from_agent raises TypeError for ADK agents using toolsets (e.g. McpToolset)

2 participants