When combining structured output (response_json_schema) with the google_search tool, the response’s grounding_metadata contains web_search_queries (confirming searches occurred) but grounding_chunks and grounding_supports are empty. This prevents linking generated content to source URLs. I’m using the gemini-3-flash-preview model.
Based on the Gemini 3 documentation, structured output can be combined with grounding tools. I expected the grounding_metadata to include grounding_chunks (Source URL) and grounding_supports (the text-to-source mappings), which works fine if structured output isn’t needed; however, if you do try to enforce structure, you do get grounding_metadata and a list of web_search_queries, but no grounding_chunks or grounding_supports!
from google import genai
from google.genai import types
from pydantic import BaseModel, Field
from typing import List, Optional
class Event(BaseModel):
title: str
start_time: str
address: str
class EventList(BaseModel):
events: List[Event]
client = genai.Client(api_key=“…”)
response = client.models.generate_content(
model=“gemini-3-flash-preview”,
contents=“Find art exhibitions in Honolulu, Hawaii from December 15-21, 2025”,
config={
“tools”: [{“google_search”: {}}, {“url_context”: {}}],
“response_mime_type”: “application/json”,
“response_json_schema”: EventList.model_json_schema(),
},
)
gm = response.candidates[0].grounding_metadata
print(f"web_search_queries: {gm.web_search_queries}“) # Populated
print(f"grounding_chunks: {gm.grounding_chunks}”) # Empty
print(f"grounding_supports: {gm.grounding_supports}") # Empty
**Logs**
web_search_queries: ['', 'First Friday Honolulu December 2025 art events', 'Honolulu Museum of Art exhibitions December 2025', 'Hawaii State Art Museum exhibitions December 2025', 'art galleries Honolulu current exhibitions December 2025', 'art exhibitions Honolulu Hawaii December 15-21 2025', '', 'Arts at Marks Garage Honolulu exhibitions December 2025 dates', 'Cedar Street Galleries Honolulu exhibitions December 2025', 'East-West Center Gallery Honolulu exhibitions December 2025', 'The ARTS at Marks Garage Holiday Market V 2025 dates', 'Gallery 2100 Honolulu exhibitions December 2025']
grounding_chunks: None
grounding_supports: None
Is this expected behavior, or should grounding_chunks/grounding_supports be populated when using structured output with search grounding? My workaround has been making two separate queries, one to get citation data, and another to structure the response.