Skip to main content
Glama

agent_run

Starts a background autonomous agent in a Google-hosted Linux sandbox to write and run code, edit files, and browse while enforcing a required token budget.

Instructions

Start the Antigravity managed agent: an autonomous agent in a Google-hosted Linux sandbox that can write and run code, edit files and browse. Runs in the background; BILLED per token, and the agent may itself call other Gemini APIs with your key - always confirm the budget with the user first.

task: what to do and what to deliver (e.g. "analyze sales.csv, write report.txt and chart.png"). max_total_tokens: REQUIRED hard budget for the run (capped by GEMINI_AGENT_MAX_TOKENS, default 300000). If the budget runs out the status is "incomplete"; resume with previous_interaction_id + environment_id. model: reasoning model for the agent (e.g. gemini-3.8-flash, gemini-4-hydrogen); default is the agent's. files: local files uploaded into the sandbox (<=10 MB total). repository: a repository source to mount, e.g. "github.com/owner/repo". sources: raw source objects ({"type": "gcs"|"inline"|"repository", "source", "target", ...}). network: "disabled" to cut off internet access. environment_id / previous_interaction_id: continue in an existing sandbox / conversation. Then: agent_status(interaction_id) for progress, agent_files(environment_id) for outputs.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "task": "<task>",
      "max_total_tokens": "<max_total_tokens>"
    },
    "name": "agent_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
taskYes
agentNo
filesNo
modelNo
networkNo
sourcesNo
repositoryNo
environment_idNo
max_total_tokensYes
previous_interaction_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv6.0.0

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so well: background execution, per-token billing, the agent possibly calling other Gemini APIs with the user's key, the 'incomplete' terminal status on budget exhaustion, and how to resume. It omits permission/authorization requirements and never mentions cancellation (agent_cancel exists), leaving those behaviors undisclosed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose and billing warning are front-loaded, then parameters are listed in a scannable label-then-meaning format with no filler. It is long, but the length is justified by ten parameters at zero schema coverage; only the final 'Then:' line feels slightly compressed relative to the rest.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 10-parameter, no-annotation, no-output-schema tool, this covers the expensive parts an agent needs: hard budget, cost warning, resume identifiers, sandbox constraints, and which sibling to poll for results. The missing 'agent' parameter and the absence of any cancellation guidance are the remaining holes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it documents 9 of 10 parameters with real added meaning: the cap env var and 300000 default for max_total_tokens, the 10 MB limit on files, the repository example format, the sources object shape, and the 'disabled' value for network. The 'agent' parameter is entirely undocumented, which is the one clear gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Start the Antigravity managed agent') and immediately characterizes what it is: an autonomous agent in a Google-hosted Linux sandbox that can write and run code, edit files, and browse. The closing line distinguishes it from the follow-up siblings agent_status and agent_files, so an agent can tell which tool starts work versus which inspects it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear prerequisite ('always confirm the budget with the user first') and an explicit next-step routing ('agent_status(interaction_id) for progress, agent_files(environment_id) for outputs'), plus the resume path when the budget runs out. It does not say when to prefer this over siblings like deep_research_start or gemini_chat, so the boundary against non-agent alternatives is left implicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.