Summary
Since v1.19, list_metrics fails when used via Google ADK with a Vertex AI backend:
list_metrics functionDeclaration parameters.search schema didn't specify the schema type field
Root cause
PR #768 widened the search parameter from str | None to str | list[str] | None. This 3-way union generates a JSON Schema with anyOf and no top-level type field:
{
"anyOf": [
{"type": "string"},
{"type": "array", "items": {"type": "string"}},
{"type": "null"}
]
}
The Vertex AI backend of google-genai (Schema.from_json_schema()) requires a top-level type field and rejects this. The Gemini API backend handles it correctly.
Affected versions
v1.19+ (introduced in #768)
Upstream bug
This is tracked as a P2 bug in the google-genai library: googleapis/python-genai#1807. The ADK issue google/adk-python#3424 was closed pointing there.
Workaround (client-side)
Pin to ADK v1.17.0 and google-genai==1.44.0 until the upstream fix lands.
Potential fix (dbt-mcp side)
Change search to list[str] | None (drop the str shorthand) — a 2-way union that google-genai handles correctly. LLMs pass a single-element list for single searches. This is a breaking change for callers passing a plain string, so pending feedback.
Summary
Since v1.19,
list_metricsfails when used via Google ADK with a Vertex AI backend:Root cause
PR #768 widened the
searchparameter fromstr | Nonetostr | list[str] | None. This 3-way union generates a JSON Schema withanyOfand no top-leveltypefield:{ "anyOf": [ {"type": "string"}, {"type": "array", "items": {"type": "string"}}, {"type": "null"} ] }The Vertex AI backend of
google-genai(Schema.from_json_schema()) requires a top-leveltypefield and rejects this. The Gemini API backend handles it correctly.Affected versions
v1.19+ (introduced in #768)
Upstream bug
This is tracked as a P2 bug in the
google-genailibrary: googleapis/python-genai#1807. The ADK issue google/adk-python#3424 was closed pointing there.Workaround (client-side)
Pin to ADK v1.17.0 and
google-genai==1.44.0until the upstream fix lands.Potential fix (dbt-mcp side)
Change
searchtolist[str] | None(drop thestrshorthand) — a 2-way union that google-genai handles correctly. LLMs pass a single-element list for single searches. This is a breaking change for callers passing a plain string, so pending feedback.