Tools · · 2 min read

Gemini API managed agents add background execution, remote MCP, and custom functions

Google expanded the Gemini API's managed agents on July 7, 2026 with four builder-facing additions: async background:true execution, direct remote MCP server connections, custom function calling alongside the sandbox, and in-place network credential refresh. Here's what each one changes if you're building long-running Gemini agents.


Google expanded the Gemini API’s managed agents on July 7, 2026, adding four capabilities aimed squarely at people running real, long-lived agent loops. (Source: Google Developers Blog, 2026-07-07) The post was written by Philipp Schmid and Mariano Cocirio of Google DeepMind. Managed agents let the Gemini API run a tool-calling loop server-side inside a sandbox; this update fixes the parts that broke once your agents outgrew a single request.

Key facts:

  • Background execution is now a flag: pass background: true and the interaction runs asynchronously server-side instead of holding an HTTP connection open. (Source: Google Developers Blog, 2026-07-07)
  • The API returns an ID you poll for status, stream progress from, or reconnect to later — the fix for long tasks dying on a dropped connection.
  • Remote MCP servers connect directly. You attach an mcp_server tool at interaction time instead of writing proxy middleware to reach private databases or internal APIs.
  • Custom function calling runs alongside the sandbox. Built-in tools execute on Google’s server; your custom functions trigger a requires_action step for client-side execution.
  • Network credentials refresh in place. Pass an existing environment_id with new network config to swap access tokens or API keys — filesystem state, installed packages, and cloned repos survive.

The Gemini API's managed agents run a tool-calling loop server-side inside a sandbox environment. Managed agents execute built-in tools server-side and hand custom functions back to your client. (Illustration; feature details from the official announcement, 2026-07-07)

What this means if you’re building with the Gemini API

The theme across all four additions is the same: they move managed agents from a demo-shaped, single-request feature toward something you can put behind a production job queue.

  • background: true is the headline for builders. If you were babysitting a persistent HTTP stream to keep a 10-minute research or coding agent alive, you can stop. Kick off the interaction, store the returned ID, and poll or reconnect. That maps cleanly onto a worker/queue architecture instead of a long-held request.
  • Remote MCP support deletes a whole proxy layer. Teams were standing up middleware just to expose an internal API to Gemini’s sandbox. Now the sandbox dials your MCP server directly, and you can mix remote tools with the built-in ones in the same loop.
  • Custom functions close the last gap. Anything that has to run in your environment — hitting a service only reachable from your VPC, or executing local business logic — now interleaves with server-side sandbox tools through the requires_action handshake.
  • Credential refresh matters for anything long-running. Access tokens expire mid-task; being able to rotate them against a live environment_id without losing sandbox state is the difference between resuming and restarting.

No pricing, model names, or benchmark numbers shipped with this announcement — it is purely an API-surface expansion. (Source: Google Developers Blog, 2026-07-07)

If you want to wire these up, our how to use Gemini managed agents guide walks through the Interactions API, background: true, remote MCP, and the custom-function requires_action flow with runnable @google/genai snippets. For choosing the model underneath, see our Gemini 3.5 Flash guide and the cheaper Gemini Omni Flash option for high-volume agent loops.

Sources

Source: Google Developers Blog