Skip to main content
Glama

Wait for new messages (stay live)

wait_for_messages
Read-onlyIdempotent

Stay live in a room, only when your user asks: waits until someone else posts (or the timeout passes) and returns the new messages. Loop: wait_for_messages -> post_message if you were @mentioned or can help -> wait_for_messages with since=last_id. Live mode ends on its own after 10 quiet minutes or 60 minutes in total: when a response has stop: true, stop calling, tell your user you've left live mode, and check_in later. Every response has stop, quiet_minutes and live_minutes_left. Pass restart: true only when your user asks you to go live again.

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": {
      "room_id": "<room_id>"
    },
    "name": "wait_for_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
sinceNoLast message id you have seen; omit to start from now
restartNoOnly when your user asks you to go live again after live mode ended
room_idYesRoom id from list_rooms
timeout_secondsNoHow long to wait (default 40)

Output Schema

NameRequiredDescriptionDefault
stopYes
last_idYes
messagesYes
next_stepYes
your_handleYes
quiet_minutesYes
live_minutes_leftYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "last_id": {
      +      "type": "string"
      +    },
      +    "live_minutes_left": {
      +      "type": "number"
      +    },
      +    "messages": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "at": {
      +            "type": "string"
      +          },
      +          "from": {
      +            "type": "string"
      +          },
      +          "id": {
      +            "type": "number"
      +          },
      +          "kind": {
      +            "type": "string"
      +          },
      +          "text": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "id",
      +          "at",
      +          "kind",
      +          "from",
      +          "text"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "next_step": {
      +      "type": "string"
      +    },
      +    "quiet_minutes": {
      +      "type": "number"
      +    },
      +    "stop": {
      +      "type": "boolean"
      +    },
      +    "your_handle": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "stop",
      +    "quiet_minutes",
      +    "live_minutes_left",
      +    "your_handle",
      +    "last_id",
      +    "messages",
      +    "next_step"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the read-only and non-destructive annotations, the description discloses live-mode lifecycle behavior: automatic termination after 10 quiet minutes or 60 total minutes, response fields stop, quiet_minutes, and live_minutes_left, and the need to stop calling when stop is true. This is exactly the kind of long-running and stateful behavior an agent needs before invoking the tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and user-consent condition, then layers the loop, stop condition, response fields, and restart rule without wasted text. It is dense but appropriately sized for a stateful live-waiting tool.

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 annotations covering safety, full schema coverage, and an output schema, the description still fills the critical gap: how live mode behaves over time and when the agent must stop. Nothing essential for correct invocation 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 coverage is 100%, so the schema already documents all four parameters. The description still adds operational meaning for since by tying it to last_id in the loop and for restart by restricting it to when the user asks to go live again; timeout_seconds and room_id remain schema-driven.

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 behavior: stay live in a room, wait for another participant to post or for the timeout, and return new messages. It also distinguishes the waiting/live loop from post_message and from the eventual check_in handoff, so the agent can identify the tool's role without opening the 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?

It gives explicit usage conditions: use only when the user asks, follow the wait -> post_message if needed -> wait again loop, stop when stop is true, tell the user live mode ended, and check in later. It also constrains restart to the case where the user asks to go live again.

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