Skip to main content
Glama
Claude Code MCP

Claude Code MCP

by sarthchawla

claude_run

Run a Claude Code task from an MCP-compatible agent, optionally as a managed background job with status, result, and cancellation controls.

Instructions

Run a Claude Code task. Set background to true to return a job ID immediately; use claude_status, claude_result, and claude_cancel to manage it.

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 the server working directory.
modelNoOptional per-invocation model override.
effortNoOptional Claude CLI reasoning effort for this invocation.
promptYesTask for Claude Code.
backgroundNoRun as a managed background job.
timeout_msNo
review_modelNoOptional model override for the review only.
allowed_toolsNo
max_budget_usdNo
permission_modeNoDefaults to manual.
review_after_runNoOverride the configured review hook for this invocation.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

B3.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full disclosure burden for what is effectively an arbitrary code-execution tool. It reveals the background job-handling behavior, but says nothing about side effects on the working directory, permission_mode implications, budget limits, or timeout behavior — all material for an agent deciding whether to invoke this.

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?

Two compact sentences, with the core action stated first and the background/job-management pattern second. Nothing is padded, though the wording is terse enough that it omits context that would be more valuable than brevity here.

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?

With 11 parameters, no annotations, and no output schema, the description should do more than two sentences. It covers the background lifecycle well but leaves the review flow (review_after_run, review_model, claude_review), permission and budget controls, and the non-background return behavior undocumented.

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 coverage is 73%, so the baseline is 3. The description adds genuine meaning for one parameter — that background=true returns a job ID immediately rather than the task result — which the schema's brief "Run as a managed background job" does not convey. The remaining nine parameters, including review_after_run and max_budget_usd, get no elaboration in the description.

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 uses a specific verb+resource ("Run a Claude Code task") and explicitly names the sibling tools (claude_status, claude_result, claude_cancel) that manage the resulting job, so an agent can place it in the workflow without opening the schema. It does not distinguish itself from claude_review, which is the nearest conceptual sibling, leaving one ambiguity.

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?

It gives clear conditional guidance: set background to true when you want an immediate job ID, then use the status/result/cancel tools to manage it. It offers no exclusions (e.g. when to use claude_review instead, or when to leave background false and wait), so it is clear context rather than full when/when-not guidance.

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