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
Name | Required | Description | Default |
---|---|---|---|
client_id | Yes | ||
room_id | Yes | ||
timeout | No |