Gemini with Google Maps grounding and widget enable does not return grounding chunks or widget token

hi there!

we’re developing an app using Gemini API with Google Maps grounding but are having a lot of issues with displaying results to the user due to missing grounding information.

Here’s our request verbatim:

{
    "contents": [
        {
            "role": "user",
            "parts": [
                {
                    "text": "Find \"Art Deco Masterpieces\" in London\n\n\nINCLUDE\nPlaces must be buildings in London constructed primarily during the Art Deco period (roughly 1920s-1930s) that are exceptional examples of the style, featuring distinctive geometric designs, luxurious materials, and a sense of modernity. Both public and private buildings with notable exteriors or accessible interiors are eligible.\n\nEXCLUDE\nBuildings with only minor Art Deco elements. Buildings that are primarily residential and not publicly viewable or accessible. Buildings from other architectural periods.\n\n\n\nSCOPE SPEC\nFACET: Art Deco Buildings:\nallowed_primary_categories: Office Building, Historic Site, University, Hotel, Cinema, Broadcasting Company, Factory, Tourist Attraction\nrequired_anchor_phrases: Art Deco, geometric patterns, streamlined design, ziggurat, modernist, 1920s, 1930s, terracotta, bronze\nhard_exclude_name_tokens: gothic, victorian, baroque, georgian, brutalist\nhard_exclude_categories: Church, Residential Building, Shopping Mall (unless historic Art Deco)\n\n"
                }
            ]
        }
    ],
    "generationConfig": {
        "temperature": 1,
        "maxOutputTokens": 36000,
        "candidateCount": 1
    },
    "systemInstruction": {
        "role": "system",
        "parts": [
            {
                "text": "You are helping a user to find an exhaustive and comprehensive list (up to 100 results) of places matching the user request.\n\nFirst, build a list of candidates by using the Google Maps tool. Generate at least 3-5 queries for each FACET to build a solid list of candidates to classify.\n\nIf you did not get any output from google maps tool - stop, respond with \"##empty##\", and give failure details in the output. Do not continue if there are no results.\n\nThen, go through the list and classify each item:\n\nmark (RELEVANT) if:\n- The place\u2019s PRIMARY category must be semantically relevant to the SCOPE SPEC FACET allowed_primary_categories.\n- Allow for minor variations in category names (e.g., \"Basilica\" is acceptable for \"Church\/Place of Worship\").\n- The place must match the *concept* of the requested Topic and Facet.\n- The place must be publicly accessible OR visiting the place has value from the outside. For example, if the outside of the place has architectural value or for similar reasons.\n- Do NOT perform strict string matching. Instead, analyze the description and website snippets to determine if the place fits the meaning of the required_anchor_phrases.\n- *Example:* If the snippet describes \"A wrought-iron tower on the Champ de Mars,\" and the anchor phrase is \"landmark,\" include it because the description implies it is a landmark, even if the exact word \"landmark\" is missing.\n- *Example:* For non-English destinations, accept descriptions in the local language if they convey the correct meaning.\n- Look for strong signals in the Google Maps details: Description confirms the nature of the place matches the Facet, Photo tags or attributes align with the Topic\n- Append citation to back your choice\n- Append links to google maps\n- Append \"google place id\" (starts with \"place\/\") exactly as returned by google maps tool. do not invent values. leave empty if unavailable.\nOtherwise mark (IRRELEVANT).\n\nFORMAT\n- One per line, wrap titles of places with \"@@\" and append google place id capped with ## (@@title@@google place id##) if a place is RELEVANT and \"--\" (--title--) if a place is IRRELEVANT. Append relevancy classifier. If IRRELEVANT, explain why.\n\nIf a list is empty, explain why."
            }
        ]
    },
    "toolConfig": {
        "retrievalConfig": {
            "latLng": {
                "latitude": 51.5072,
                "longitude": -0.127586
            }
        }
    },
    "tools": [
        {
            "googleMaps": {
                "enableWidget": true
            }
        }
    ]
}

This prompt is a result of weeks of iteration on our prompt to force Gemini to consistently call the Google Maps tool. You can see we explicitly request citations, place ids, and google maps link because of a variety of recommendations we have found. Up until today requesting widget token ensured that groundingChunks were available providing us with enough information to display results on a map. Today we are, again, seeing a lot of issues:

  • groundingMetadata is present, but groundingChunks are missing
  • no groundingMetadata present at all

Example responses are (all responses are with the SAME request):

1 - No results at all.

{
    "candidates": [
        {
            "content": {
                "parts": [
                    {
                        "text": "##empty##\nAll Google Maps queries for \"Art Deco buildings London\", \"1920s 1930s architecture London\", \"Streamlined modernist buildings London\", \"Art Deco hotels London\", and \"Art Deco cinemas London\" returned no results. Therefore, no candidates could be generated for classification."
                    }
                ],
                "role": "model"
            },
            "finishReason": "STOP",
            "index": 0,
            "groundingMetadata": {
                "webSearchQueries": [
                    "Art Deco buildings in London",
                    "architecture in london 1920s",
                    "architecture in london 1930s",
                    "modernist buildings london",
                    "Art Deco hotels in London",
                    "Art Deco cinemas in London"
                ]
            }
        }
    ],
    "usageMetadata": {
        "promptTokenCount": 739,
        "candidatesTokenCount": 143,
        "totalTokenCount": 3436,
        "cachedContentTokenCount": 394,
        "promptTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 739
            }
        ],
        "cacheTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 394
            }
        ],
        "toolUsePromptTokenCount": 1279,
        "toolUsePromptTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 1279
            }
        ],
        "thoughtsTokenCount": 1275
    },
    "modelVersion": "gemini-2.5-flash",
    "responseId": "pUN5aZaCA5GL_uMP9afRqAY"
}

2 - groundingSupports are there, but they are referencing groundingChunks which do not exist. You can see that place id were returned, but an attempt to resolve them fails as they do not exist and were hallucinated.

{
    "candidates": [
        {
            "content": {
                "parts": [
                    {
                        "text": "@@Daily Express Building@@place/ChIJWbVnFfQcdkgR4q_R65kL8_4## (RELEVANT) The Daily Express Building is a well-known example of Art Deco architecture in London, featuring a distinctive black glass facade and chrome details. It was constructed between 1931 and 1932. https://maps.google.com/maps/contrib/114995536553531093153/photos https://maps.google.com/maps/place/Daily+Express+Building/data=!4m7!3m6!1s0x487604add027a051:0x5109405d5225ae0!8m2!3d51.5147575!4d-0.1065985!16s%2Fg%2F11b65vhp1q!3m1!1s0x487604add027a051:0x5109405d5225ae0... (cut for size)"
                    }
                ],
                "role": "model"
            },
            "finishReason": "STOP",
            "index": 0,
            "groundingMetadata": {
                "groundingSupports": [
                    {
                        "segment": {
                            "endIndex": 222,
                            "text": "@@Daily Express Building@@place/ChIJWbVnFfQcdkgR4q_R65kL8_4## (RELEVANT) The Daily Express Building is a well-known example of Art Deco architecture in London, featuring a distinctive black glass facade and chrome details."
                        },
                        "groundingChunkIndices": [
                            0,
                            1
                        ]
                    },
                    {
                        "segment": {
                            "startIndex": 223,
                            "endIndex": 264,
                            "text": "It was constructed between 1931 and 1932."
                        },
                        "groundingChunkIndices": [
                            0
                        ]
                    }
                    // Additional segments cut for size
                ],
                "webSearchQueries": [
                    "Art Deco buildings in London",
                    "Art Deco architecture in London",
                    "architecture in london 1920s",
                    "architecture in london 1930s",
                    "modernist architecture London 1920s",
                    "modernist architecture London 1930s",
                    "historic Art Deco office buildings London",
                    "Art Deco hotels in London",
                    "Art Deco cinemas in London",
                    "Art Deco factories in London",
                    "Art Deco tourist attractions in London"
                ]
            }
        }
    ],
    "usageMetadata": {
        "promptTokenCount": 722,
        "candidatesTokenCount": 6142,
        "totalTokenCount": 15608,
        "cachedContentTokenCount": 387,
        "promptTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 722
            }
        ],
        "cacheTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 387
            }
        ],
        "toolUsePromptTokenCount": 1270,
        "toolUsePromptTokensDetails": [
            {
                "modality": "TEXT",
                "tokenCount": 1270
            }
        ],
        "thoughtsTokenCount": 7474
    },
    "modelVersion": "gemini-2.5-flash",
    "responseId": "8jt5abuKL-_VjMcPwZ6qqAM"
}

1 Like

I’ve experienced similiar with the maps grounding tool - it just randomly goes through periods of 0 grounding chunks returning, even with the same prompt, then a few hours later everything will work fine again. Seems quite unreliable right now. Sometimes these “blackouts” can be for 24hrs and reach 100% of queries, other times it’s like 15 minutes and only 10% of queries.

I have the same problem Google Maps grounding down?

1 Like