Start with a working tool
Save this configuration asagent.yaml. Select a model enabled in your project;
the example uses gpt-4.1.
{"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’screate 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:
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:
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
- The model chooses an advertised tool and supplies arguments matching its schema.
- MeshAgent validates those arguments and starts a fresh Python invocation.
- The function may transform JSON data or await HTTP requests through the host.
- Its JSON result returns to the model, which continues the conversation.
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.