get_messages
Fetch messages from Zulip chat with filters by stream, topic, sender, or search text. Control pagination with anchor, num_before, and num_after.
Instructions
Fetch messages from Zulip with flexible filtering.
This is the primary tool for reading chat history. Combine filters to narrow down results — e.g., stream + topic to get a specific conversation, or sender + search to find specific messages from a person.
Pagination: Results are anchored at a point and fetch messages before/after it. To paginate through history:
First call: anchor="newest", num_before=100
Next call: anchor=, num_before=100
Repeat until found_oldest is true.
Args: stream: Filter by stream/channel name (e.g., "eng-resharding"). topic: Filter by topic/thread name within a stream. sender: Filter by sender email (e.g., "shreyan@nearone.org"). search: Full-text search query across message content. anchor: Reference point — a message ID (as string) or "newest", "oldest", "first_unread". Defaults to "newest". num_before: Number of messages before the anchor. Max 5000. Defaults to 100. num_after: Number of messages after the anchor. Max 5000. Defaults to 0. include_html: If True, return HTML-rendered content. If False (default), return raw Markdown source — better for analysis.
Returns: JSON object with keys: - messages: list of message objects (id, sender, content, timestamp, etc.) - found_newest: whether there are no newer messages matching the filter - found_oldest: whether there are no older messages matching the filter - anchor: the anchor message ID used
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topic | No | ||
| anchor | No | newest | |
| search | No | ||
| sender | No | ||
| stream | No | ||
| num_after | No | ||
| num_before | No | ||
| include_html | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |