Skip to main content
Glama

claude_run

Runs a headless Claude Code session to write or edit code and execute project commands, blocking until completion and returning the result for review or follow-up.

Instructions

Run Claude Code (headless, DeepSeek-backed) to write/edit code and run commands in the project. Blocks until Claude Code finishes and returns its result.

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": {
      "prompt": "<prompt>"
    },
    "name": "claude_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory. Defaults to /app.
promptYesInstructions for Claude Code: the initial task, or specific feedback when continuing via resume_session_id.
max_turnsNoClaude Code --max-turns.
timeout_secNoHard timeout in seconds before the process is killed. Defaults to 1800.
allowed_toolsNoClaude Code --allowedTools, e.g. 'Read,Edit,Bash(npm test)'.
permission_modeNoClaude Code --permission-mode. Defaults to 'acceptEdits'.
resume_session_idNosession_id from a prior claude_run call, to continue that conversation with feedback.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It does disclose a critical trait: the call blocks until Claude Code finishes and then returns its result, which the schema's 1800s timeout corroborates. However, it omits that this mutates the project filesystem and can execute arbitrary commands, gives no sense of cost/duration beyond the schema default, and does not describe what 'result' contains or what happens on timeout/kill.

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?

Two sentences, zero waste, and the blocking/synchronous behavior is stated up front where it matters most. The parenthetical 'headless, DeepSeek-backed' earns its place by telling the agent which engine executes the task.

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

Completeness3/5

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

For a 7-parameter, mutation-capable, potentially long-running tool with no annotations and no output schema, the definition is thin on side effects, return shape, and failure behavior. The parameter documentation is fully covered by the schema, but the description should say more about what comes back and what the process does to the project.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter (cwd, max_turns, timeout_sec, allowed_tools, permission_mode, resume_session_id) is already documented in the schema. The description adds no parameter-level meaning such as defaults or interaction between resume_session_id and prompt, so the baseline of 3 applies.

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

Purpose4/5

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

The description gives a specific verb and resource: run Claude Code (headless, DeepSeek-backed) to write/edit code and run commands in the project. An agent immediately knows the operation and that it acts on the project. There are no siblings to differentiate from, so the lack of differentiation costs it little.

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

Usage Guidelines3/5

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

Usage is implied by 'to write/edit code and run commands in the project', which tells the agent the kind of work suited to this tool. But there is no explicit when-not guidance, no mention of alternatives, and no statement of prerequisites or when a plain edit tool would be preferable.

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

Deploy Server

Other Tools