Skip to main content
Glama
bill-kopp-ai-dev

Claude Code CLI MCP Server

claude_run_task

Executes a single Claude task synchronously with a 600-second limit, returning the result, exit code, cost, and optional git diff. Supports configurable model, permission mode, and timeout.

Instructions

Run a single Claude task synchronously (bounded by FastMCP's 600s wrapper cap).

Required: workspace_path, prompt. Common options: model (alias from Settings.claude_model_aliases), fallback_model, permission_mode, options.timeout_s (default 300, max 600), capture_changes.

Estimated cost depends on model and prompt size — check total_cost_usd in the response. Typical ranges: haiku ~$0.02, sonnet ~$0.50, opus ~$1.50.

For tasks that may exceed 600s (architecture, migration, large refactors), use claude_start_task (async) instead. For timeout routing, call the claude_timeout_help prompt first.

Returns: ClaudeRunTaskResponse with result, stdout/stderr, exit_code, timed_out, total_cost_usd, model_usage, and (if capture_changes=true) a unified git diff of workspace changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reqNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
notesNo
resultYes
run_idYes
statusYes
changesNo
exit_codeYes
num_turnsNo
final_textYes
session_idNo
duration_msNo
model_usageNo
total_cost_usdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses synchronous execution, the 600s cap, cost expectations, and the full response shape including timed_out and optional git diff, which implies workspace mutation. It does not explicitly warn about side effects or permission risks beyond mentioning permission_mode, but the disclosure is substantial.

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 front-loaded with purpose, then structured into required/common, cost, routing, and return sections. Every sentence adds information, and the line breaks make it scannable for an agent.

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

Completeness2/5

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

Despite the rich detail, the description omits the required `req` object wrapper, which is a critical invocation detail. It also contains a factual contradiction with the schema on default and maximum timeout values. Given the tool's complexity, the undocumented advanced parameters further reduce completeness.

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

Parameters2/5

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

The description names required and common options, but it does not mention the top-level `req` wrapper that the schema actually requires, so an agent may pass workspace_path/prompt incorrectly. Its timeout_s claim (default 300, max 600) directly contradicts the schema (default 600, max 3600), and with 0% schema coverage, many parameters (effort, max_turns, change_scope, max_budget_usd, etc.) are left unexplained.

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 opening sentence states a specific verb and resource: 'Run a single Claude task synchronously' and explicitly notes the 600s wrapper cap. It clearly differentiates from the async sibling claude_start_task, so an agent can immediately tell this is the sync execution tool.

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?

Explicitly lists required and common options and gives concrete routing rules: use claude_start_task for tasks exceeding 600s, and call claude_timeout_help for timeout routing. This is exactly the when-to-use-vs-alternatives guidance an agent needs.

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