Skip to main content
Glama
code-bridge

code-bridge

by ITSWProj

Esegui prompt in Claude Code

claude_run

Executes a prompt in Claude Code headlessly for a project, waits, and returns the result plus session_id for follow-up. Use for short tasks; use claude_start for long ones.

Instructions

Invia un prompt a Claude Code in modalità headless sul progetto indicato e attende la risposta. Restituisce il risultato e il session_id per continuare la conversazione. Adatto a richieste brevi; per compiti lunghi usare claude_start. Anche questo strumento occupa un posto nel limite di istanze contemporanee. Se la risposta contiene RIFIUTATO, non ritentare: riferire all'utente.

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

Input Schema

NameRequiredDescriptionDefault
cwdYesDirectory del progetto
freshNoSe true ignora la sessione precedente del progetto e ne apre una nuova. Default: riprende.
promptYesIl prompt da eseguire
session_idNoID sessione da riprendere, se si continua un lavoro precedente
timeout_msNoTimeout in millisecondi prima di terminare il processo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it discloses headless execution, that the call blocks until a response arrives, that it consumes a concurrency slot, and the refusal-handling policy. It stops short of explaining timeout behavior or what happens to the process when timeout_ms elapses.

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?

Front-loaded with purpose and return value, then the sibling routing rule, then the resource-limit and refusal caveats. Every sentence adds distinct operational information with no repetition.

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?

No output schema exists, and the description compensates by stating what is returned (result plus session_id). It is nearly complete for a blocking execution tool, with the main omission being timeout/failure semantics.

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 the schema already documents all five parameters including cwd, fresh, session_id and timeout_ms. The description only adds that the returned session_id is meant for continuing the conversation, which is marginal value beyond the schema. Baseline 3 applies.

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?

States a specific verb and resource ('invia un prompt a Claude Code in modalità headless'), the target ('sul progetto indicato') and the blocking behavior ('attende la risposta'). It also explicitly distinguishes itself from the sibling claude_start by naming the short-request use case.

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?

Gives an explicit selection rule ('Adatto a richieste brevi; per compiti lunghi usare claude_start') plus an error-handling directive ('Se la risposta contiene RIFIUTATO, non ritentare: riferire all'utente'). Both when-to-use and when-not-to-retry are covered with a named alternative.

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