Skip to main content
Glama

run_agent

Delegate coding tasks to a local LLM-powered agent that executes in your project and returns a job ID for tracking.

Instructions

Delegate a task to an agent on a local model. Returns a job id immediately.

The agent is a headless Claude Code session (Read/Edit/Write/Glob/Grep/Bash, project
CLAUDE.md, same working tree) whose API calls go to the local endpoint. Write the task like a
brief for a capable but junior engineer: what to do, where, how to verify, and what to report.

Args:
  task: The brief. Be explicit; local models follow less implicit context than Claude.
  model: Pool name (see list_models) or a served model id/glob. Default from models.yaml.
  endpoint: Force a specific endpoint; with no `model`, uses whatever it is serving.
  cwd: Working directory (default: this server's cwd, i.e. the current project).
  isolation: "none" (work in cwd, like a normal subagent) or "worktree" (fresh git worktree
    on branch local-agent/<job>; kept only if the agent changed something, reported in
    job.worktree with a diffstat). Use worktree for risky/large edits you want to review as a diff.
  wait_s: If > 0, block up to this many seconds and return the result when done (else job id).
  permission_mode: acceptEdits (default) | bypassPermissions | default | plan.
  max_turns: Cap on agent turns (default from models.yaml).
  allowed_tools: Override auto-approved tools.
  system_prompt_append: Extra instructions appended to the Claude Code system prompt.
  resume_job: Continue a previous job's session (same model) with `task` as the next message.
  timeout_s: Wall-clock cap for the job.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNo
taskYes
modelNo
wait_sNo
endpointNo
isolationNonone
max_turnsNo
timeout_sNo
resume_jobNo
allowed_toolsNo
permission_modeNo
system_prompt_appendNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description carries the full burden, and it delivers: it discloses the agent's toolset (Read/Edit/Write/Glob/Grep/Bash, project CLAUDE.md, same working tree), immediate-return behavior, isolation details including worktree retention and diffstat reporting, permission modes, resume semantics, and blocking behavior via wait_s. This goes well beyond what the name and schema reveal.

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

Conciseness5/5

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

The description is appropriately sized for a 12-parameter tool. Each sentence earns its place: the opening sentence states purpose and return behavior, the second gives task-writing guidance, and the arg list is dense but scannable. No redundancy.

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

Completeness5/5

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

Given 12 parameters, no annotations, and an output schema to cover return values, the description is complete. It covers all parameters, defaults, the immediate-return/blocking distinction, worktree behavior, permission modes, and resume capability. Nothing an agent needs to invoke this tool correctly is missing.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must fully compensate, and it does. Every one of the 12 parameters gets a meaningful explanation with defaults, allowed values, and behavioral effects (e.g., isolation explains 'none' vs 'worktree', permission_mode lists all options, resume_job explains continued sessions).

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 opens with 'Delegate a task to an agent on a local model,' which is a specific verb and resource, and immediately states the key behavioral distinction: 'Returns a job id immediately.' This clearly differentiates run_agent from the job-management siblings (job_log, cancel_job, job_status, wait_job).

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?

The description gives strong usage context: how to write the task brief, when to use isolation='worktree' ('Use worktree for risky/large edits you want to review as a diff'), when wait_s should be used, and points to a sibling tool via 'Pool name (see list_models)'. It doesn't explicitly name alternatives for follow-up status checks (e.g., job_status/wait_job), but the immediate-return semantics make that implication clear.

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/ccebelenski/localagents'

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