Get Chat Messages
discourse_get_chat_messagesRetrieve chat channel messages with pagination, date filtering, or from last read position to access conversation history efficiently.
Instructions
Get messages from a chat channel with flexible pagination and date-based filtering. Supports: (1) paginating with direction='past'/'future' from a target_message_id, (2) querying messages around a specific target_date, (3) getting messages around a target_message_id, or (4) fetching from last read position.
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": {
"channel_id": "<channel_id>"
},
"name": "discourse_get_chat_messages"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel_id | Yes | The chat channel ID | |
| page_size | No | Number of messages to return (default: 50, max: 500) | |
| target_message_id | No | Message ID to query around or paginate from | |
| direction | No | Pagination direction: 'past' for older messages (DESC), 'future' for newer messages (ASC) | |
| target_date | No | ISO 8601 date string (e.g., '2024-01-15' or '2024-01-15T10:30:00Z') to query messages around that date | |
| fetch_from_last_read | No | If true, start from the user's last read message | |
| include_target_message_id | No | Whether to include the target message in results (default: true) |