Skip to main content
Glama
zix-chen
by zix-chen

Execute command

exec_command
Destructive

Execute bounded shell commands with explicit working directories, a call wait time, and a total process timeout. Commands still running return a command_id so you can poll output later.

Instructions

Run a bounded command under runtime policy. Pass workdir explicitly for reconnect-safe paths. yield_time_ms is only how long this call waits (default 10s); timeout_ms is the total process lifetime (default 300s). A command still running when the call returns keeps running under its command_id; poll it with write_stdin or read_output. Example: {"cmd":"pytest -q","workdir":".","yield_time_ms":30000}. Retained output is bounded per stream; for very large output redirect to a file (cmd > out.log 2>&1) and page it with read_file or search_text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cmdYes
cwdNo
envNo
ttyNo
stdinNo
workdirNo.
verbosityNopreview
timeout_msNoTotal process lifetime in milliseconds. The command is killed when this elapses, whether or not the call has already returned.
preview_bytesNo
yield_time_msNoHow long this call waits before returning. A command still running at that point keeps running and returns a command_id; it is not killed.
max_output_bytesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo
signalNo
statusNo
stderrNo
stdoutNo
previewNo
summaryNo
warningsNo
exit_codeNo
timed_outNo
truncatedNo
command_idNo
elapsed_msNo
output_refNo
next_actionNo
output_refsNo
next_actionsNo
output_streamNo
output_truncatedNo
stderr_truncatedNo
stdout_truncatedNo
operation_outcomeNo
preview_truncatedNo
stderr_output_bytesNo
stderr_output_linesNo
stderr_truncated_byNo
stdout_output_bytesNo
stdout_output_linesNo
stdout_truncated_byNo
stderr_dropped_bytesNo
stderr_omitted_bytesNo
stdout_dropped_bytesNo
stdout_omitted_bytesNo
truncated_output_streamsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare destructive/openWorld/non-idempotent, and the description adds substantial context beyond them: the yield-vs-lifetime distinction, that a command keeps running under its command_id after the call returns (not killed), per-stream output bounding, and the reconnect-safe workdir convention. These are real operational traits an agent cannot infer from the annotations.

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, then the timing semantics, an inline example, and the output-handling caveat. Every sentence carries information and none repeat the schema or annotations.

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 not be explained, and annotations carry the safety profile. The description covers the critical async/timeout behavior well, but for an 11-parameter tool with 18% schema coverage the unresolved cwd vs workdir ambiguity and undocumented env/tty/verbosity params leave a gap.

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 only 18%, so the description must compensate for the rest. It admirably clarifies the two most confusing params (yield_time_ms vs timeout_ms), the workdir rationale, and gives a concrete example, but it stays silent on nine others (cwd, env, tty, stdin, verbosity, preview_bytes, max_output_bytes) and never addresses the overlapping cwd/workdir pair. Partial compensation warrants a 3.

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 ('Run a bounded command under runtime policy') and immediately scopes it as bounded with a runtime policy. It also routes to siblings, telling the agent that a still-running command is continued via write_stdin or read_output and large output is paged via read_file or search_text.

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?

Clearly explains the two timing knobs (yield_time_ms = how long this call waits; timeout_ms = total process lifetime) and when to use the async continuation path versus paging redirected output. It lacks an explicit 'when not to use' or a pointer to check_exec_environment for preflight, so it stops short of 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.