Skip to main content
Glama

Get Chat Messages

discourse_get_chat_messages
Read-onlyIdempotent

Retrieve chat messages from Discourse channels with pagination, date filtering, and options to fetch from last read positions or specific messages.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
channel_idYesThe chat channel ID
page_sizeNoNumber of messages to return (default: 50, max: 500)
target_message_idNoMessage ID to query around or paginate from
directionNoPagination direction: 'past' for older messages (DESC), 'future' for newer messages (ASC)
target_dateNoISO 8601 date string (e.g., '2024-01-15' or '2024-01-15T10:30:00Z') to query messages around that date
fetch_from_last_readNoIf true, start from the user's last read message
include_target_message_idNoWhether to include the target message in results (default: true)
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already provide readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=true, covering safety and idempotency. The description adds valuable behavioral context by detailing the four query modes (pagination, date-based, message-based, last-read) and mentioning 'flexible pagination,' which helps the agent understand operational nuances beyond the basic annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, followed by a bullet-like list of four supported scenarios in a single, efficient sentence. Every phrase adds value without redundancy, making it easy to parse while covering multiple use cases succinctly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (7 parameters, multiple query modes) and rich annotations, the description is mostly complete. It explains the key behavioral modes but lacks details on output format (e.g., structure of returned messages) since there's no output schema. However, it compensates well with clear usage scenarios and parameter context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all parameters are documented in the schema. The description adds some context by grouping parameters into usage scenarios (e.g., target_message_id with direction for pagination, target_date for date-based queries), but it doesn't provide additional syntax or format details beyond what the schema already specifies. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Get messages from a chat channel') and resource ('chat channel'), distinguishing it from sibling tools like discourse_list_chat_channels (which lists channels) or discourse_search (which searches content). It specifies the domain of chat messages rather than other Discourse entities.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly outlines four distinct usage scenarios: (1) paginating with direction, (2) querying around a target_date, (3) getting messages around a target_message_id, and (4) fetching from last read position. This provides clear guidance on when to use this tool versus alternatives like discourse_search or discourse_list_user_posts for different data retrieval needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/king-of-the-grackles/discourse-mcp'

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