Skip to main content
Glama

run_command

Execute a configured command by exact path with optional arguments and working directory; returns exit code, stdout, and stderr. Use for short finite tasks, not long-running processes.

Instructions

Run a finite configured command to completion. Pass the exact path from search_commands, the same cwd used for discovery, and optional args as separate unchanged tokens. cwd defaults to the server's directory. Returns its exit code and separate stdout/stderr, capped at 64 KiB each. Commands have a fixed 60-second timeout. Long-running commands are refused with a hint to use start_session; commands marked agents: false are also 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": {
      "path": "<path>"
    },
    "name": "run_command"
  }
}

Input Schema

NameRequiredDescriptionDefault
cwdNoProject directory to resolve and run the command from. Defaults to the server's cwd.
argsNoArguments appended as separate, unchanged tokens.
pathYesExact command path returned by `search_commands`, including the leading `fire`.

Output Schema

NameRequiredDescriptionDefault
stderrYes
stdoutYes
exit_codeNoProcess exit code, or null if the command was refused, could not start, or timed out.
timed_outYes
stderr_truncatedYes
stdout_truncatedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full behavioral burden and does so: a fixed 60-second timeout, 64 KiB caps per stream, exit code plus separate stdout/stderr, and explicit refusal behaviors. It also discloses the `cwd` default, so the agent knows what happens when the parameter is omitted. The only modest gap is that execution privilege/side-effect scope is not spelled out, which is minor relative to everything disclosed.

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?

Four sentences, front-loaded with the core action, then preconditions, then return behavior, then refusal rules. Every clause carries operational information; nothing is redundant with the tool name or title.

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?

An output schema exists, so return values need little explanation, and the description still summarizes them. Timeout, size caps, refusals, defaults, and the discovery-to-execution linkage are all covered. Only the absence of any statement about execution privileges or side effects keeps it from fully complete for an arbitrary-command tool.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds cross-tool meaning the schema cannot: `path` must be the exact value returned by `search_commands`, and `cwd` must match the directory used for discovery. It also clarifies that `args` are appended as separate, unchanged tokens (no shell re-parsing).

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?

"Run a finite configured command to completion" names a specific verb (run) plus a scoped resource (finite configured command), and the final sentence explicitly contrasts it with the long-running path via start_session. An agent can tell this apart from its siblings without opening any schema.

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?

It gives concrete preconditions (pass the exact `path` from `search_commands`, reuse the same `cwd` used for discovery) and names the alternative for the case this tool rejects: long-running commands are refused with a hint to use `start_session`. It even states an exclusion rule (commands marked `agents: false` are refused), leaving little to inference.

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