poll_messages
Wait for and retrieve new messages from a session, enabling autonomous agents to collaborate in real time. Blocks until messages arrive or timeout, ideal for continuous agent loops.
Instructions
Wait for and read new messages from a session. AUTONOMOUS LOOP tool for agent communication.
AUTOMATIC TRIGGERS - Call this when:
You're running an autonomous agent loop
Waiting for other agents to complete work
Need real-time collaboration without human intervention
This tool BLOCKS until new messages arrive or the timeout expires. It is the primary mechanism for agents to run continuous collaboration.
USAGE PATTERN FOR AUTONOMOUS AGENTS: 1. Call poll_messages(session_id, agent_id, timeout=30) 2. Process any returned messages 3. Send responses via send_message 4. Repeat from step 1 until the session is complete
WORKFLOW POSITION: Main loop tool for autonomous agents.
PARAMETERS:
session_id: Session to monitor
agent_id: Your agent ID
timeout: Max seconds to wait (default: 30, 0 = no wait)
limit: Max messages to return (default: 50)
msg_types: Filter by message types (optional)
from_agent: Filter by sender (optional)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| timeout | No | ||
| agent_id | Yes | ||
| msg_types | No | ||
| from_agent | No | ||
| session_id | Yes |