Skip to main content
Glama

wait

Pauses until a Python execution completes or a timeout/silence threshold is reached, returning running status and recent output so agents can poll progress without blocking indefinitely.

Instructions

等待一个 execution 结束,或两个计时器之一到点。

两个计时器

与 cell 头的 --wait / --silence 相同,对应 HTTP 客户端的总超时与 read timeout: timeout_seconds 是这次调用最多等多久;silence_seconds 是 execution 连续这么久 没有新输出就提前返回,从这次调用开始计。默认都是 10 秒。

到点只结束这次调用,cell 照常运行,结果写明 running 与原因,附最后几行输出; 之后可以再调用本工具,或用 read_output、interrupt。 结果第一行写着它从提交到现在跑了多久;对照预期估出剩下的整数秒,例如 wait(timeout_seconds=170, silence_seconds=35)。

选择

execution 的选择规则与 execution_status 相同。

完整输出交付

当所选 execution 的 cell 头含 --full-output 且已达到终态时,本工具 直接返回完整 combined 正文,可以突破 5,000-token 省略;仍在运行的 execution 继续返回 running。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "wait"
  }
}

Input Schema

NameRequiredDescriptionDefault
executionNo要等待的正整数执行编号。省略时使用当前记录,随后 使用最近记录。
silence_secondsNoexecution 连续这么久没有新输出就返回,正数;从这次调用开始计。
timeout_secondsNo这次调用最多等待的秒数,正数。

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.4.0
    • addedInput schema / properties / silence_seconds
      Added value: +{
      +  "default": 10,
      +  "description": "execution 连续这么久没有新输出就返回,正数;从这次调用开始计。",
      +  "type": "number"
      +}
    • changedInput schema / properties / timeout_seconds / default
      Previous value: -30New value: +10
    • changedInput schema / properties / timeout_seconds / description
      Previous value: -"本次调用最多等待的正数秒数;默认 30 秒。"New value: +"这次调用最多等待的秒数,正数。"
  2. Addedv0.1.13

TDQS

A4.7/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does so well: it discloses the partial-return semantics (result marked running plus reason and trailing output), the elapsed-time header, and the non-obvious rule that --full-output cells bypass the 5,000-token truncation only once terminal. These are exactly the behaviors an agent cannot infer from the name.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with a one-sentence summary followed by headed sections that each earn their place, and the '选择' section is an efficient one-line delegation. Minor redundancy: the two timers are introduced in the opening line and then re-explained in the first section.

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?

With three optional params, no annotations and no output schema, the description fills every gap an agent needs: it describes the response shape (elapsed-time first line, running plus reason, trailing output), the truncation override, and the retry path. Nothing essential for calling it correctly is missing.

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

Parameters5/5

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

Schema coverage is already 100%, yet the description adds real meaning beyond it by framing timeout_seconds as a total/HTTP-client timeout and silence_seconds as a read timeout measured from call start, both defaulting to 10. The worked example `wait(timeout_seconds=170, silence_seconds=35)` shows how to size values against the reported elapsed time, which the schema alone does not convey.

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 — wait for an execution to finish — and immediately names the two independent mechanisms (total timeout vs. silence) that bound the call. It also distinguishes itself from siblings by naming read_output and interrupt as follow-up options, so an agent can tell it apart 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 Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Clearly explains that a timer expiry only ends this call while the cell keeps running, and tells the agent what to do next (call again, read_output, interrupt). It defers the `execution` selection rule to execution_status explicitly, which is a useful pointer, but there is no guidance on error or not-found cases.

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