Skip to main content
Glama

live_wait

Wait for the next live teaching event with a blocking call, returning events the moment they arrive. Replace polling loops to save tokens and simplify; re-call if timeout occurs.

Instructions

一次调用 ≈50 秒静默等待, 数据即到即返, 超时重挂即可 —— 这是等待, 不是轮询。阻塞等待下一个 Live Teaching / AdHoc 事件 (与 GET /bridge/wait 共用同一份等待逻辑, lib/live-wait.ts) —— MCP 原生的零空转值更: 比反复调用 live_pending 省 token, 不用自己算轮询间隔。timeout_s 上限 50 (留出 MCP 客户端自身超时的余量), 缺省即用上限. 超时未等到事件 → timeout=true, events=[], 直接再挂一次即可, 不必先调 live_pending 探路。每次调用顺手续一次 heartbeat (ttl 60), 等待期间在线灯不灭。可选 consumer_id: 传了就走服务端 持久化 delivery cursor (断点续传) —— 同一 consumer_id 下次调用不传 since 就自动从上次的断点继续, 传 since 则视为"上一批我已处理完"的确认并推进游标; 不传 consumer_id 时行为与旧版一致(每次都从此刻起等)。契约版本协议: 每个响应都带 contract_version, 把它作为 known_contract_version 传回, 命中现行版时超时/事件响应都不再重发 live_runtime_contract 全文 (只留 contract_version + may_end_turn), 缺省或版本过期则完整合约照发。值更契约 v3(方法自由): 本工具与后台看门脚本 scripts/live-watch.py 是平级合法路径, 你家 harness 有 自己的监听原语也行——考核只看红线加四条目标, 见 recipe://live-teaching。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sinceNo可选。带 consumer_id 时: 传 since 等于确认"上一批事件我已处理完", 服务端据此推进该 consumer_id 的持久化游标; 省略则读取上次持久化的游标续等。不带 consumer_id 时: since 仅对本次调用生效(从该游标起等), 不落库。
pair_idNo
timeout_sNo默认/上限 50, clamp [1, 50]
consumer_idNo可选。传了才启用服务端持久化游标 (断点续传); 省略则与旧版行为完全一致。
known_contract_versionNo可选。传上一次响应里的 contract_version: 命中现行版 ⇒ 响应省略 live_runtime_contract 全文, 只带 contract_version + may_end_turn; 缺省/过期 ⇒ 完整合约照发 (首次完整)。
Behavior5/5

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

With no annotations provided, the description bears the full burden of disclosure, and it delivers richly. It discloses the blocking wait duration (~50s), the silent wait and immediate return behavior, the timeout semantics (timeout=true, events=[]), heartbeat side-effects (ttl 60), persistent cursor semantics for consumer_id, and the contract version protocol. No behavioral surprise is left undocumented.

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?

The description is a continuous dense paragraph, which makes scanning harder, but nearly every sentence carries crucial information. It is front-loaded with the core wait semantics and then systematically covers timeout, heartbeat, cursor, and contract version. A bulleted list would improve structure, but given the high information density, it remains appropriately sized.

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?

Given the tool's complexity (5 optional parameters, no annotations, no output schema), the description is remarkably complete: it explains blocking behavior, timeout handling, heartbeat, cursor persistence, contract version negotiation, and the relationship to alternative tooling. The main omissions are the exact shape of returned events and the purpose of pair_id, but the description covers the core usage contract thoroughly.

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?

The schema already documents 4 of 5 parameters (80% coverage), but the description adds significant behavioral meaning beyond those schema notes. For example, it explains the 'since' parameter as a confirmation to advance the cursor, and describes the auto-resume behavior for consumer_id. However, pair_id remains completely undocumented in both schema and description, which is a notable 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?

The description clearly states a specific verb and resource: '阻塞等待下一个 Live Teaching / AdHoc 事件' (block waiting for the next Live Teaching/AdHoc event). It explicitly differentiates itself from live_pending by framing this as waiting rather than polling, and it names the sibling tool ('比反复调用 live_pending 省 token'), which removes any ambiguity about its role.

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 description provides explicit guidance on when to use this tool versus alternatives, stating that it is more token-efficient than repeatedly calling live_pending and that it shares logic with GET /bridge/wait. It also tells the user not to call live_pending on timeout ('直接再挂一次即可, 不必先调 live_pending 探路'), which is a clear exclusion. This is exemplary usage guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sf-shenfeng/learn-shell'

If you have feedback or need assistance with the MCP directory API, please join our Discord server