Skip to main content
Glama

Wait for next fmsg message

wait_for_message
Read-only

Await the next inbound message and retrieve it with its thread context to reply in ongoing chats or auto-reply loops.

Instructions

Block until the next inbound message arrives (pushed over the fmsg host's WebSocket) and return it with its thread context so you can answer with reply. Use this when the user asks you to chat, converse, keep replying, auto-reply, or respond to the next message. Loop: wait → reply → wait again passing the after_id from the previous result. On status "timeout" simply call again with the same arguments. Messages arriving on the same thread within settle_seconds are batched into ONE result; reply once, to the newest (reply_target_id). Your own messages, reactions and no-reply messages never qualify. Each call blocks at most timeout_seconds (max 230); stop looping when the user interrupts or the limits they set are reached.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fromNoonly accept messages from this address or short name
after_idNoonly messages with a greater id qualify; pass the after_id from the previous result. Omit on the first call to wait for messages arriving from now on
thread_ofNoonly accept messages in this message's thread
include_threadNoinclude the assembled thread context of the newest message
settle_secondsNoafter the first message, keep collecting same-thread messages for this long
timeout_secondsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteYes
statusYes
after_idYespass this as after_id on the next call
messagesYes
transportYes
thread_root_idYes
reply_target_idYesnewest message of the batch; reply to this one
pending_other_threadsYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.3

TDQS

A4.8/5.0
Behavior5/5

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

The description goes well beyond the annotations. It discloses blocking behavior, batching across settle_seconds, the exclusion of own messages/reactions/no-reply messages, timeout semantics, and the reply_target_id convention. It also explains the loop lifecycle. This rich behavioral context complements the readOnlyHint=true annotation without contradicting it.

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 single dense paragraph, but it front-loads the core purpose and then logically walks through triggers, looping, timeout, batching, and exclusions. Every sentence provides necessary operational detail. Slightly long, but no filler; the length is justified by the complexity of the blocking, looping behavior.

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?

Given the tool's complexity (blocking, WebSocket push, timeouts, batching, thread context, looping), the description covers all critical aspects an agent must understand to use it correctly: when to use, how to loop, how to handle status 'timeout', which messages qualify, and when to stop. An output schema exists, so return-value details are not required. The only omissions, such as specific from/thread_of usage, are adequately covered by the input schema.

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 coverage is 83%, so the baseline is 3. The description adds meaning beyond the schema by explaining the after_id loop pattern, the settle_seconds batching effect, and the timeout_seconds hard cap (230). It does not repeat trivial parameter meanings, and the few uncovered schema details are minor since they are adequately named.

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 states a specific action ('Block until the next inbound message arrives'), a clear resource (inbound fmsg message over WebSocket), and the return purpose ('return it with its thread context so you can answer with reply'). It distinguishes itself from sibling read tools like list_messages and get_message by emphasizing it waits for new messages rather than retrieving existing ones.

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?

Explicitly lists the user intents that should trigger this tool: 'chat, converse, keep replying, auto-reply, or respond to the next message.' It provides a concrete loop pattern ('wait → reply → wait again passing the after_id from the previous result'), timeout recovery behavior, and stopping conditions, leaving no ambiguity about how to use it in a multi-turn conversation.

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

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/markmnl/fmsg-mcp'

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