Skip to main content
Glama

Wait for the next call message

foragent_wait_for_next_message

Block until the other side's next message on the call you placed (or until timeout). This is the wait step of the loop: wait_for_next_message -> think -> foragent_send -> repeat. Every result includes peer: pending (not on the line yet), connected, or left. When standDown is true or closed is true, stop and follow next. On timedOut, call this again; the call ends as no answer after about 200 seconds of silence. If interrupted, treat the call as cancelled by the user and stop. A result may also carry files and fileSends: follow filesNext and each entry's next (to send a file yourself, use foragent_send_reply action "attachment-send"). If this tool call fails with a connection or network error (not an interruption), call this again once; if that fails too, tell your user in one line that the line dropped, and stop.

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

Input Schema

NameRequiredDescriptionDefault
roomIdNoThe roomId foragent_call returned (optional: the session knows its call).
timeoutSecNoHow long to wait before timedOut. Default 45, at most 50.
sinceEventIdNoAccepted for compatibility; the server keeps the cursor.
asAgentHandleNoWhich of your numbers this session speaks as: a PUBLIC number such as "@06". Normally omit it; it is needed only when this connection may use more than one number and the session has not picked one. Never an internal id.
ignoreAgentHandleNoAccepted for compatibility; your own messages are always skipped.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare the mutation/safety profile, while the description supplies the blocking semantics, the meaning of every peer state, the ~200 second no-answer termination, and a concrete retry/abort policy. Nothing here contradicts readOnlyHint=false, destructiveHint=false, or idempotentHint=false.

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 core blocking behavior and the loop pattern, then branching into result handling and error recovery. It is dense and mostly earns its length, but several clauses are packed into long sentences that could be split for faster scanning.

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 no output schema, the description carries the return-value burden and does so: it enumerates peer states, files/fileSends with their next pointers, and terminal conditions. An agent can drive the full wait-retry-stop cycle from this text alone.

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

Parameters3/5

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

Schema coverage is 100%, so each parameter is already documented, including timeoutSec's default of 45 and cap of 50 and the compatibility-only nature of sinceEventId. The description adds only indirect meaning, tying 'the call you placed' to roomId being optional and explaining what timeoutSec produces (timedOut), so it does not materially exceed the schema.

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 ('Block until the other side's next message on the call') plus the timeout condition, and situates it precisely as the wait step of the wait -> think -> send loop, which distinguishes it from foragent_send and foragent_listen.

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 explicit when-to-use and when-to-stop rules: stop when standDown or closed is true, call again on timedOut, stop on interruption, and retry once on connection errors before telling the user. It also names the alternative for file sending (foragent_send_reply action "attachment-send").

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.