diff --git a/google/genai/_mcp_utils.py b/google/genai/_mcp_utils.py index 3d4ae2a17..b2c70fa14 100644 --- a/google/genai/_mcp_utils.py +++ b/google/genai/_mcp_utils.py @@ -143,7 +143,7 @@ def _filter_to_supported_schema( filtered_schema: dict[str, Any] = {} for field_name, field_value in schema.items(): - if field_name in schema_field_names: + if field_name in schema_field_names and isinstance(field_value, dict): filtered_schema[field_name] = _filter_to_supported_schema(field_value) elif field_name in list_schema_field_names: filtered_schema[field_name] = [