Skip to main content
Glama

run

Start an AI CLI agent (Claude, Codex, Gemini, Forge, or OpenCode) in the background, returning a PID for async monitoring and result retrieval.

Instructions

AI Agent Runner: Starts a Claude, Codex, Gemini, Forge, or OpenCode CLI process in the background and returns a PID immediately. Use list_processes and get_result to monitor progress.

• File ops: Create, read, (fuzzy) edit, move, copy, delete, list files, analyze/ocr images, file content analysis • Code: Generate / analyse / refactor / fix • Git: Stage ▸ commit ▸ push ▸ tag (any workflow) • Terminal: Run any CLI cmd or open URLs • Web search + summarise content on-the-fly • Multi-step workflows & GitHub integration

IMPORTANT: This tool now returns immediately with a PID. Use other tools to check status and get results.

Supported models: "claude-ultra", "codex-ultra", "gemini-ultra", "sonnet", "sonnet[1m]", "opus", "opusplan", "fable", "haiku", "gpt-5.4", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4-mini", "gpt-5.3-codex", "gpt-5.3-codex-spark", "gpt-5.2", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-3.1-pro-preview", "gemini-3-pro-preview", "gemini-3-flash-preview", "forge", "opencode", "oc-<provider/model>"

Prompt input: You must provide EITHER prompt (string) OR prompt_file (file path), but not both.

Prompt tips

  1. Be concise, explicit & step-by-step for complex tasks.

  2. Check process status with list_processes

  3. Get results with get_result using the returned PID

  4. Kill long-running processes with kill_process if needed

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelNoThe model to use. Aliases: "claude-ultra" (Opus with auto max effort; does not select Fable), "codex-ultra" (auto ultra reasoning), "gemini-ultra". Standard: "sonnet", "sonnet[1m]", "opus", "opusplan", "fable", "haiku", "gpt-5.4", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5", "gpt-5.4-mini", "gpt-5.3-codex", "gpt-5.3-codex-spark", "gpt-5.2", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-3.1-pro-preview", "gemini-3-pro-preview", "gemini-3-flash-preview", "forge", "opencode". Fable is an explicit selection and may require usage credits. OpenCode also accepts explicit dynamic models using "oc-<provider/model>". "forge" is a provider key, not a Forge model family selector.
promptNoThe detailed natural language prompt for the agent to execute. Either this or prompt_file is required.
session_idNoOptional session ID to resume a previous session. Supported for Claude, Codex, Gemini, Forge, and OpenCode. OpenCode resumes in-place via --session and may also be combined with explicit oc-<provider/model> selection.
workFolderYesThe working directory for the agent execution. Must be an absolute path.
prompt_fileNoPath to a file containing the prompt. Either this or prompt is required. Must be an absolute path or relative to workFolder.
reasoning_effortNoReasoning control for Claude and Codex. Claude uses --effort with "low", "medium", "high", "xhigh", "max". Codex uses model_reasoning_effort with "low", "medium", "high", "xhigh"; GPT-5.6 Sol and Terra also support "max" and "ultra", while Luna supports "max". Gemini, Forge, and OpenCode do not support reasoning_effort in this integration.
Behavior5/5

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

No annotations are provided, so the description carries full burden. It discloses key behaviors: returns immediately with PID, runs in background, performs file/code/git/terminal operations, supports various models, and has mutual exclusivity of prompt and prompt_file. It also explains model aliases and specifics about Fable credits and 'forge' as a provider key.

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?

The description is well-structured with headings and bullet points, front-loading the core purpose. It is slightly verbose but every sentence adds value. Some redundancy in monitoring instructions could be trimmed, but overall it is efficient.

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 complex tool with many models and capabilities, the description is comprehensive. It covers the process lifecycle (start, check, get results, kill), parameter constraints, model list, and additional integrations. No output schema, but it mentions PID. Minor gaps (e.g., what happens on error) are acceptable given the scope.

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 100%, providing a baseline of 3. The description adds significant meaning: explains mutual exclusivity of prompt/prompt_file, gives model selection details and reasoning_effort variants, and includes prompt tips. This goes beyond the schema descriptions.

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?

The description clearly states the tool's purpose: 'AI Agent Runner: Starts a Claude, Codex, Gemini, Forge, or OpenCode CLI process in the background and returns a PID immediately.' It uses a specific verb (starts/runs) and resource (AI agent process), and distinguishes from siblings by noting immediate return with PID and directing to list_processes, get_result, kill_process for monitoring.

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

Usage Guidelines5/5

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

The description provides explicit guidance: when to use (starting a process), when not (monitoring uses other tools), and alternatives (list_processes, get_result, kill_process). It also instructs on parameter constraints ('must provide EITHER prompt OR prompt_file'), and includes prompt tips for effective usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mkXultra/ai-cli-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server