Skip to main content
Glama

cmd_wait

Read-onlyIdempotent

Waits for a command run to finish or be approved or denied, then returns its status, exit code, duration, and last output lines; call again if the wait times out.

Instructions

Waits for one command run to finish, or for the owner to approve or deny it, then returns the same report as the call that started it: status, exit code, duration and the last output lines. It returns as soon as the run ends; when waitSeconds runs out first it reports the current state (waiting for approval, queued or running) and you call it again. Waiting changes nothing. WHEN TO USE: cmd_project, cmd_git, cmd_proc or cmd_shell gave you a run id instead of a result, because the run waits for approval or takes longer than its waitSeconds. Not for reading more output now (cmd_output), ending a run (cmd_stop) or finding a lost run id (cmd_list). An unknown run id is an error.

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": {
      "runId": "<runId>"
    },
    "name": "cmd_wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
guideNotrue: put the commands guide first in the result. Use on your first commands call, or when told it changed.
runIdYesThe run number the starting call returned, for example 12.
waitSecondsNoSeconds to wait before reporting the current state (default 30, at most about 45, which keeps the call inside the client's time limit).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.2.2
    • changedInput schema / properties / runId / description
      Previous value: -"The run number, for example 12."New value: +"The run number the starting call returned, for example 12."
    • changedInput schema / properties / waitSeconds / description
      Previous value: -"Seconds to wait (default 30, at most about 45)."New value: +"Seconds to wait before reporting the current state (default 30, at most about 45, which keeps the call inside the client's time limit)."
  2. First observedv0.2.0

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint, and the description reinforces rather than contradicts them ("Waiting changes nothing"). Beyond that it discloses the polling contract — returns as soon as the run ends, otherwise reports current state (waiting for approval, queued or running) and must be called again — plus the error behavior for an unknown run id and the exact contents of the report.

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?

Two tight sections: a front-loaded statement of purpose and return, then a WHEN TO USE block with positive and negative cases. No filler sentences, and the polling behavior is explained without repetition.

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?

For a three-parameter polling tool with no output schema, the description covers what triggers a run id, what the call returns, what happens on timeout, the need to re-call, and the unknown-id error. Nothing an agent needs in order to invoke it correctly is missing.

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 baseline is 3; the description still adds meaning by framing runId as the value a prior call returned and by describing waitSeconds as a polling boundary after which the agent re-calls. The guide parameter is not mentioned in prose, which is the one small gap.

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?

Names a specific verb and resource ("Waits for one command run to finish, or for the owner to approve or deny it") and states what it returns (status, exit code, duration, last output lines). It is unmistakable against siblings like cmd_output, cmd_stop and cmd_list.

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?

The WHEN TO USE block gives the triggering condition (a starting call returned a run id because of approval or a long run) and explicitly excludes three alternatives by name: cmd_output for more output now, cmd_stop for ending, cmd_list for a lost id. An agent needs nothing else to route correctly.

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