Artificial intelligence

Google expands Managed Agents capabilities in the Gemini API with background tasks and MCP server support

Google announced new updates for Managed Agents in the Gemini API, including running long-running tasks in the background, connecting to remote MCP servers, calling custom functions, and updating credentials between interactions. The updates are intended to help developers build agents better suited for operation in production environments.

2026-07-06
4 min read
173 views
certi.news Editorial Team
Google expands Managed Agents capabilities in the Gemini API with background tasks and MCP server support

Google announced expanded capabilities for Managed Agents in the Gemini API, adding asynchronous execution for long-running tasks, direct integration with remote Model Context Protocol (MCP) servers, support for calling custom functions, and the ability to update credentials between interactions. The company said these additions came in response to developer feedback and the need to build agents that can operate reliably in production environments.

The announcement was published on July 6, 2026, while the post is dated July 7, 2026, and was written by Philipp Schmid, Developer Relations Engineer at Google DeepMind, and Mariano Cocirio, Product Manager at Google DeepMind.

Running long-running tasks in the background

Managed Agents in the Gemini Interactions API allow a single endpoint to handle Gemini’s reasoning tasks, code execution, package installation, file management, and access to web information within an isolated cloud environment. With the new update, developers can pass the background: true option to run the interaction asynchronously on the server.

The interface immediately returns a task ID, which the client application can use to poll the status, stream progress, or reconnect later while the agent continues working remotely. This eliminates the need for the application to keep an HTTP connection open throughout lengthy analysis or processing operations.

Connecting to remote MCP servers

Agents can now connect directly to remote MCP servers instead of creating custom middleware to access private databases or internal APIs. Remote tools can be combined with built-in isolated-environment capabilities, such as Google Search and code execution, within the same interaction.

Google provides an example of an agent that checks an internal monitoring server for recent spikes in latency for the authentication service and then correlates them with Git repository changes. The server is defined through a tool of type mcp_server with its name and URL, allowing the agent to communicate with the specified endpoints from its cloud environment.

Custom functions alongside isolated-environment tools

The update adds the ability to define custom tools for executing local business logic alongside Gemini’s built-in tools. The system uses step matching: built-in tools are executed automatically on the server, while the interaction moves to a requires_action state when it needs a function to be executed by the client application.

In the provided example, a function named get_weather is defined to obtain the weather at a specific location. The agent then requests a weather check for Tokyo and asks for Python code to convert the temperature to Fahrenheit and save the result to a file. The client handles local function calls or queries for APIs and databases, then returns the function result to the interaction.

Updating network credentials

Managed Agents also support updating short-lived access tokens and API keys by passing the current environment_id with new network settings in the next interaction. The new rules immediately replace the previous rules, while the isolated environment retains the state of the file system, installed packages, and cloned repositories.

Google explains that a developer can start an interaction using an initial token to access a service such as the GCS JSON API, then later use the same environment with an updated token to download a file, without recreating the environment or losing its state.

The examples are available using the JavaScript package named @google/genai, with references to Python and cURL documentation in the Antigravity agent documentation. Google also directs developers to an overview of the Gemini Interactions API and the Managed Agents quickstart guide to explore custom agent definitions, environment settings, network rules, and advanced streaming patterns.

News source
c
Author

certi.news Editorial Team

What you need to know

Google has expanded Managed Agents capabilities in the Gemini API to run long-running tasks in the background, connect to remote MCP servers, call custom functions, and update credentials while preserving the state of the isolated environment. These updates aim to help developers build agents better suited for production environments.

  • The background: true option enables long-running interactions to run asynchronously, with the ability to query status or stream progress using a task ID.
  • Agents can connect directly to remote Model Context Protocol servers and combine their tools with Google Search and code execution within the isolated environment.
  • The system supports custom tools such as get_weather and moves the interaction to a requires_action state when a function must be executed by the client application.
  • Short-lived access tokens and API keys can be updated through environment_id without recreating the environment or losing the state of files, packages, and repositories.
  • Examples are available using the JavaScript package @google/genai, with references to the Python and cURL documentation and the Antigravity agent documentation.

FAQ

What does background execution add to Managed Agents?

It allows the interaction to run asynchronously on the server, so the application can query its status, stream progress, or reconnect later without keeping an HTTP connection open for the entire duration of the task.

Can Managed Agents use remote MCP servers?

Yes. Agents can connect directly to remote MCP servers and combine their tools with the built-in tools of the isolated environment.

How are custom functions executed?

The server automatically executes built-in tools, while the interaction moves to a requires_action state when it needs a function executed by the client application. The application then returns the function result to the interaction.

Does updating credentials cause the environment state to be lost?

According to the article, network settings can be updated using the existing environment_id while retaining the state of the file system, installed packages, and cloned repositories.

In the same category

You may also like

View all news