Launch Gemini Agent
gemini_agentDelegate complex tasks to an autonomous agent that reads files, runs commands, and returns a final report. Ideal for coding, research, and automation.
Instructions
Delegate a task to an autonomous Gemini agent (via the agy CLI). Unlike gemini_chat (a single text response), the agent can read and edit files and run shell commands inside a working directory to actually carry out multi-step work, then returns its final report. Use it to offload self-contained coding/research/automation tasks. Returns a conversation_id you can pass back to continue iterating with the same agent. Pick a "Flash" model for speed, a "Pro" model for harder reasoning (see gemini_agent_models).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task | Yes | The instructions for the agent. Be explicit and self-contained: state the goal, relevant files/paths, constraints, and what a finished result looks like — the agent runs without further input. | |
| model | No | Agent model label exactly as listed by gemini_agent_models, e.g. "Gemini 3.1 Pro (High)" or "Gemini 3.5 Flash (Low)". Defaults to agy's configured model. | |
| directory | No | Absolute path of the primary working directory the agent runs in. Defaults to the MCP server working directory. | |
| add_directories | No | Additional absolute paths to grant the agent access to. | |
| conversation_id | No | Resume a previous agent run by its conversation_id to keep its context and continue iterating. | |
| continue_recent | No | Continue the most recent agy conversation. Ignored when conversation_id is provided. | |
| auto_approve | No | Auto-approve the agent's tool/permission requests so it can work unattended. Defaults to true (set GEMINI_AGY_AUTO_APPROVE=false to change the default). Without it the agent stalls on prompts. | |
| sandbox | No | Run the agent in agy's restricted sandbox. | |
| timeout_seconds | No | Hard time budget for the run. Agent runs can be slow, especially with Pro/High models. Defaults to the configured agy timeout. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | ||
| conversation_id | No | ||
| timed_out | Yes | ||
| success | Yes |