GEMINI LABJP
NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20NANOLITE — Nano Banana 2 Lite is here: Google's fastest and most cost-efficient Gemini Image model, made for running lightweight image generation cheaplyOMNIFLASH — Gemini Omni Flash is in public preview, a natively multimodal model that lets enterprises and developers build custom, dynamic video workflowsAGENTS — Managed Agents expand with background: true for async server-side runs and polling, remote MCP server integration, and refreshing credentials across interactionsMEMORY — The Memory Bank IngestEvents API is generally available, decoupling event ingestion from memory generation so you can stream content continuouslyTHROUGHPUT — Provisioned Throughput now lets you submit up to seven pending orders for the same model and regionDEPRECATE — Image generation models shut down on August 17, and the Grok 4.1 family on the Gemini Enterprise Agent Platform on August 20
Articles/Advanced
Advanced/2026-07-04Advanced

Gemini 3 Multi-Tool Agents: Function Calling + Built-in Tools + Context Circulation in Production

A hands-on look at Gemini 3 multi-tool agents: combining Built-in Tools with Function Calling, Context Circulation, and parallel tool IDs, with measured latency numbers and the pitfalls I hit in production.

Gemini 35Function Calling16Built-in ToolsContext CirculationAgents7Gemini API192Production32

Premium Article

Gemini 3 Multi-Tool Agents: Function Calling + Built-in Tools + Context Circulation in Production

When One Agent Calls the Same Search Three Times

Gemini 3 changed the shape of agent code. Built-in Tools (Google Search, Google Maps) and custom Function Calling can now live in one request, and Context Circulation carries context straight from one tool call into the next — architectures that were awkward to express before become ordinary.

This guide is written for developers who already understand basic Function Calling and want to build production-grade multi-tool agents. We'll go from core concepts to fully working implementations, covering parallel tool execution, Context Circulation loops, cost management, and common production pitfalls.

What you'll learn:

  • Combining Built-in Tools and custom functions in a single API call
  • Context Circulation for multi-step agent workflows
  • Parallel tool execution with Tool Call Identifiers
  • Gemini 3 Thinking mode's impact on tool selection accuracy
  • Production patterns: error handling, cost optimization, and observability

Prerequisites & Environment Setup

Requirements

  • Gemini API key (get one at aistudio.google.com)
  • Python 3.10+ or Node.js 18+
  • Latest google-genai SDK

Installation

pip install google-genai --upgrade
import os
from google import genai
from google.genai import types
 
# Initialize client
client = genai.Client(api_key=os.environ["GEMINI_API_KEY"])

Model Selection

The code examples in this guide are tested against gemini-3-pro and gemini-3-flash. Use Pro for quality-critical tasks, Flash when throughput and cost matter more.


Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
Measured sequential vs parallel tool execution (about 57% faster at 3 tools) with a reproducible benchmark harness
How I kept Context Circulation token growth flat with mid-loop summarization, plus where thinking_budget stops paying off
Real production pitfalls: mismatched Tool Call IDs and Built-in Tools crowding out custom functions, and how to fix them
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Advanced2026-06-13
A Minimal Autonomous Agent with Gemini — Tool-Loop Design Lessons
Building an autonomous agent from a minimal setup with the google-genai SDK's automatic function calling — plus the step limits, tool allowlists, and retry decisions learned from automating real blog operations.
Advanced2026-07-03
Your Tool Results Are Quietly Eating the Conversation — Handle Passing to Keep Gemini Function Calling Contexts Lean
Tool results linger in Function Calling history and compound your input tokens every turn. Two implementations — a token-budgeted compactor and handle passing — cut my measured input by roughly 8x, with the pitfalls I hit along the way.
Advanced2026-07-01
Getting Artifacts Out of a Managed Agents Sandbox Safely — Scoped Credentials and Egress Design
Gemini API Managed Agents run in a Google-hosted isolated sandbox. Here is the short-lived, least-privilege credential and egress-boundary design I use to return generated artifacts to my own repository safely.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →