Skip to main content
Glama

Wait for pending work

await_pending
Read-only

Wait until another session has queued work in this memory, then return it. Read only. Blocks (without holding up other requests) until a saved note whose outcome is "pending" appears, or timeout_s passes, whichever comes first. It returns as soon as something else on this memory writes a pending note, so an otherwise-idle session can act as a live worker. A note closed with record_outcome(expected_prior_result="pending") is closed only by the first caller, so two workers cannot both close the same item.

Limitation: candidates come from a semantic search over this memory's notes and are then filtered for the outcome "pending", so it reliably finds notes phrased like this server's own (see the default query) but is not guaranteed to find every pending note written in unrelated wording.

Args: device_id: the named memory to watch, if not the account's default one. timeout_s: the longest to wait in seconds (default 25; capped so a call always returns well before typical proxy timeouts). poll_interval_s: seconds between checks while waiting (default 3). query: the search used to surface candidate notes (the default is tuned to this server's own notes). k: how many candidates to consider per check (default 25).

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": "await_pending"
  }
}

Input Schema

NameRequiredDescriptionDefault
kNo
queryNopending outcome awaiting confirmation task
device_idNo
timeout_sNo
poll_interval_sNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations declare readOnlyHint=true and openWorldHint=false, and the description corroborates with 'Read only' rather than contradicting it. Beyond that it discloses behavior annotations cannot express: it blocks without holding up other requests, returns on the first pending write or at timeout_s, is capped to stay under proxy timeouts, and — critically — that a note is closed only by the first caller so two workers cannot double-close.

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 the verb and read-only status, then the blocking/timeout mechanics, then the race caveat, then a clearly labeled Limitation, then Args. Prose and args are tight, though the second paragraph restates the 'returns as soon as work appears' idea from the first and could be folded in without loss.

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 long-blocking, race-sensitive tool with an output schema (so return values need not be described), every behavioral hazard an agent must know is present: blocking-but-non-exclusive waiting, timeout bounding, first-caller-wins closing, and the recall limitation of the semantic-search candidate filter. Nothing needed 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.

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden, and it does: all five parameters are explained (device_id as 'the named memory ... if not the default', timeout_s default and cap rationale, poll_interval_s, query as 'the search used to surface candidate notes' with a note that the default is tuned to this server's own notes, k as candidates per check). This adds real meaning the bare titles/defaults in the schema do not.

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 until another session has queued work ... then return it') and immediately bounds it as read-only. It also names the sibling that produces the work it waits on (record_outcome with expected_prior_result="pending"), so an agent can tell it apart from recall/get_memory 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?

Gives an explicit usage pattern ('an otherwise-idle session can act as a live worker') and an explicit contraindication bound: candidates come from semantic search and are filtered for "pending", so it is not guaranteed to find unrelated-wording notes. It also salts the guidance with which sibling to use to close an item, and the timeout/poll knobs that shape the wait.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.