Combining Google Search and Google Maps in a Single Gemini API Call

Source
Combining Google Search and Google Maps in a Single Gemini API Call

This tutorial explores the latest Gemini API tooling updates announced by Google in March 2026, specifically the ability to combine built-in tools like Google Search and Google Maps with custom function calls in a single API request. We walk through five hands-on demos that progressively build on each other, starting with the core tool combination feature and ending with a full multi-tool agentic chain.

Throughout the demos, we demonstrate how context circulation preserves every tool call and response across turns, enabling the model to reason over prior outputs; how unique tool response IDs allow us to map parallel function calls to their exact results; and how Grounding with Google Maps brings real-time location data into our applications. We use gemini-3-flash-preview for tool combination features and gemini-2.5-flash for Maps grounding, ensuring everything we build runs without any billing setup.

The first demo showcases the flagship new feature: passing both a built-in tool (Google Search) and a custom function declaration in a single API call. Gemini will search the web for real-time info and then request our custom function to get weather data. We provide the function response, and Gemini synthesizes everything.

During the process, we install the Google GenAI SDK, securely capture our API key, and define the helper functions that power the rest of the tutorial. We complete the two-turn flow by returning our simulated weather response with the matching function call ID and observing the final synthesized response.

Related articles