Skip to main content
Glama

ctx_run

Run allowlisted commands such as tests, builds, type checks, and read-only git without a shell, returning distilled errors, failures, and summaries while keeping full output for expansion.

Instructions

Run an allowlisted command (tests, builds, type checks, read-only git) without a shell and return distilled output: errors and failures with their context, a summary for known formats, repeated lines folded, head and tail. The full output is kept under a handle for ctx_expand. Commands not on the allowlist are refused.

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": {
      "command": "<command>"
    },
    "name": "ctx_run"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoWorking directory relative to the project root (default: the root).
argsNoArguments, one per element, e.g. ["test", "--", "auth"].
commandYesProgram name only, e.g. "npm", "git", "pytest". No shell syntax.
timeout_msNoKill the command after this long.
budget_tokensNoHard cap on the tokens returned (estimate; default 800).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare it is not read-only, not destructive, and closed-world, so the description's job is to add nuance. It does: no shell (so no pipes/redirects), allowlist refusal, and a detailed account of how output is distilled (errors with context, summaries for known formats, folded repeats, head/tail) with the full log retained under a handle for ctx_expand. It is silent on sandboxing, environment, and side effects of the invoked tool, which keeps it just below top marks.

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?

Roughly two sentences, front-loaded with the verb and scope, then the output behavior, then the escape hatch to ctx_expand, then the refusal rule. Every clause carries information an agent needs; nothing is padding.

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?

There is no output schema, but the description compensates by describing the returned shape in detail (error/failure extraction with context, format summaries, folded repeats, head and tail, plus a retained full-output handle). Combined with 100% schema coverage on five parameters and informative annotations, an agent has everything needed to call it correctly.

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 (command, args, cwd, timeout_ms, budget_tokens) is already documented in the schema, establishing a baseline of 3. The description reinforces that there is no shell syntax and that output is budget-capped, but adds no syntax or format detail beyond what the schema fields already say.

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 uses a specific verb (Run) plus a clearly scoped resource (an allowlisted command: tests, builds, type checks, read-only git) and states the output contract (distilled output). It also names ctx_expand as the route to the full output, so an agent can tell this tool apart from a raw-output sibling without opening the schema.

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 concrete contexts (tests, builds, type checks, read-only git) and a hard boundary: commands not on the allowlist are refused. It also routes the agent to ctx_expand when the full untruncated output is needed, though it never states when to prefer a different execution path or which kinds of commands are explicitly out of bounds beyond the allowlist phrasing.

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