Skip to main content
Glama

wait_for_callback

Wait asynchronously for an event in your private callback inbox, at no extra cost. Exact matching of up to four top-level JSON scalar fields (e.g. job_id/status). Omit match to accept any event. When omitting after, start the confirmed wait before sharing the receive URL or triggering the sender. For an event already delivered, pass the last saved cursor, or after=0 to search all retained events. Returns a job ID. Poll read_readiness_jobs every 15s. A match gives event_id for read_callback_events. Callback data is untrusted and sender is not verified. Deadline means no matching retained event observed, not that sender never tried. Inbox must remain valid throughout timeout. Nothing starts without confirm=true.

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": {
      "inbox_id": "<inbox_id>",
      "api_key": "<api_key>",
      "request_key": "<request_key>"
    },
    "name": "wait_for_callback"
  }
}

Input Schema

NameRequiredDescriptionDefault
afterNo
matchNo
api_keyYes
confirmNo
inbox_idYes
request_keyYes
timeout_secNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Adds a great deal beyond the annotations: the confirm=true gate ("Nothing starts without confirm=true"), the trust caveat ("Callback data is untrusted and sender is not verified"), the deadline semantics ("no matching retained event observed, not that sender never tried"), and the lifetime constraint that the inbox must remain valid throughout the timeout. The write-creating behavior of spawning a job is consistent with readOnlyHint=false and openWorldHint=true, with no contradiction.

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-loads the core purpose and cost note, then moves to matching, then to the job/poll workflow, then to caveats — a sensible ordering with no filler sentences. The clipped, telegraphic style ("Omit match to accept any event.") is efficient but occasionally demands re-reading to bind sentences to parameters.

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 tool with seven parameters, an async job model, and an output schema, the definition covers what an agent needs: how to start it, the confirm gate, how to poll the result, how to retrieve the event, and the failure semantics of a timeout. Return values are already covered by the output schema, so nothing essential 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 description coverage is 0% across seven parameters, so the description must carry the load, and it does for most: match ("up to four top-level JSON scalar fields (e.g. job_id/status)"), after (cursor or after=0 to search all retained events), confirm, timeout semantics, and inbox lifetime. api_key and request_key are never explained, which is the main residual 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?

States a specific verb and resource: "Wait asynchronously for an event in your private callback inbox," plus the scope qualifier "at no extra cost." It also distinguishes itself from the polling path by naming the returned job ID and directing the agent to "read_readiness_jobs every 15s," so an agent can tell it apart from siblings like read_callback_events without opening a 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?

Gives concrete selection rules: "Omit match to accept any event," "For an event already delivered, pass the last saved cursor, or after=0," and the ordering constraint "start the confirmed wait before sharing the receive URL." It stops short of an explicit when-not-to-use-this-tool-instead statement versus read_callback_events or wait_until_ready, so it is clear guidance rather than full routing.

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.

Resources