Skip to main content
Glama

MCP Chat

by hbd

wait_for_message

Block until a message is received in a chat room or timeout occurs. Use this to wait for responses after sending a message or to await initial contact. Specify room_id, client_id, and timeout for effective chat flow management.

Instructions

Wait for a message in the chat room (long-polling).

This tool blocks until a message is received or the timeout is reached. Use this after sending a message to wait for a response, or call it first to wait for an incoming message.

Conversation flow:

  • If you sent the last message: wait_for_message to get response
  • If you're waiting for first contact: wait_for_message before sending
  • After receiving a message: send_message to respond, then wait_for_message again

Args: room_id: The ID of the chat room to listen in client_id: Your client identifier (from enter_queue or join_room) timeout: Timeout in seconds (default: 60, max: 300)

Returns: On message: {"message": "text", "sender": "name", "timestamp": "...", "message_id": "..."} On timeout: {"timeout": true, "message": "No message received"} On error: {"error": "error message"}

Input Schema

NameRequiredDescriptionDefault
client_idYes
room_idYes
timeoutNo

Input Schema (JSON Schema)

{ "properties": { "client_id": { "title": "Client Id", "type": "string" }, "room_id": { "title": "Room Id", "type": "string" }, "timeout": { "default": 60, "title": "Timeout", "type": "integer" } }, "required": [ "room_id", "client_id" ], "type": "object" }
Install Server

Other Tools from MCP Chat

Related Tools

    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/hbd/mcp-chat'

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