Skip to main content
Managed agents store their configuration in a project and run in MeshAgent’s managed runtime. Their configuration selects models, instructions, tools, and optional service-account credentials. You do not need to host a separate tool server for an embedded Python tool.

Start with a working tool

Save this configuration as agent.yaml. Select a model enabled in your project; the example uses gpt-4.1.
Test the function directly before saving the agent:
The result contains {"total_cents":3000}, captured logs, and an empty list of HTTP requests. This runs the embedded source; it does not ask a model to choose a tool or create an agent. See Python tools for local runner installation and the complete execution contract.

Save the agent and talk to it

In Studio, open your project’s Agents list and select New Agent. Paste the configuration into the YAML editor and select Create. The Edit Agent dialog lets you update an existing agent’s configuration. The CLI’s create and update commands accept JSON, while tools test accepts a YAML file. To use the same file with the CLI, convert it to JSON with a Python environment containing PyYAML:
For an existing agent, use:
Start a conversation with the saved agent:
Use credentials and an API URL for the same environment as your Powerboards or Studio project. A successful local function test does not create the agent or confirm that the deployed service account can access a secret.

What tool calls support

The detailed Python tool reference documents every HTTP argument, response field, schema rule, secret permission, and execution limit. Room-hosted SDK tools are a separate surface described in Tools and Toolkits.

Configure built-in tools and MCP

tools holds embedded Python functions. toolkits enables built-in and provider-hosted capabilities. For example, add this to your agent configuration:
Grok web search accepts at most five domains in either allowed_domains or blocked_domains; it cannot combine both filters in one search toolkit. Use an OpenAI model for this image-generation example. Grok’s native image tool accepts only type: image_generation; it chooses its image model, size, and format. Configuring image settings with Grok returns an explicit error. Secret-backed MCP requests use the agent’s run_as service account and the existing secret proxy permissions. For every provider, set require_approval: never. Managed agents do not yet route interactive MCP approvals. Omitting this setting, selecting always, or adding nonempty always_require_approval returns an explicit error rather than automatically approving calls. Use allowed_tools to limit which tools can run. For OpenAI, MCP preserves custom headers, allowed_tools, never_require_approval, and optional openai_connector_id. A connector ID cannot be combined with use_proxy_secret; proxy secrets require a server URL. Grok MCP supports server URLs, custom headers, allowed_tools, and proxy secrets. It does not support OpenAI connector IDs or per-tool approval settings; these configurations return explicit errors. The managed require_approval: never setting selects calls without interactive approvals and is omitted from the provider request because Grok does not accept that field. An empty allowed_tools list disables the server rather than forwarding Grok’s native empty list, which would enable every tool. Anthropic MCP supports server URLs, allowed_tools, and authentication through use_proxy_secret. An empty allowed_tools list disables all tools on that server. Its native connector does not support custom headers, OpenAI connector IDs; these configurations return explicit errors. Configured toolkits are rebuilt for the selected provider on each turn, including provider changes.

How a tool call runs

  1. The model chooses an advertised tool and supplies arguments matching its schema.
  2. MeshAgent validates those arguments and starts a fresh Python invocation.
  3. The function may transform JSON data or await HTTP requests through the host.
  4. Its JSON result returns to the model, which continues the conversation.
Python exceptions, invalid arguments, HTTP transport errors, resource limits, and timeouts fail the tool call. HTTP error responses are available to the function; call response.raise_for_status() to raise for a status of 400 or greater. Worker loss does not automatically replay a call, because an HTTP request may already have changed data. For API-based creation, connection, and access management, see the managed-agent endpoints.