Skip to main content
Glama

Get chat messages

get_chat_messages
Read-only

A chat's messages, oldest first in the page, by cursor: the newest page by default; 'before' a message id reads further back, 'after' one reads forward (what came since). 'more' says the page stopped short — pass the first message's id as 'before' for the page before it. Each message: author (absent when an agent wrote it — then 'agent' names the role and whom it answered), Markdown body (absent once deleted, with 'deleted' true), 'replyTo', files by address, 'issues' made of it that you may open. Reading here does not mark the chat read — mark_chat_read does. 'working' lists the agents answering in it now. A secret chat ('secret' true) is end to end: its words open on its people's devices only, so here every message has an empty body — who wrote when, and nothing of what; it cannot be written to from here either.

Input Schema

NameRequiredDescriptionDefault
afterNoRead the messages after this id, going forward. Wins over 'before'.
limitNoHow many, 1–100. Default 50.
beforeNoRead the messages before this id, going back.
chatIdYesThe chat's id, as list_chats gives it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Goes well past the readOnly annotation to disclose non-obvious traits: reading does not mark the chat read, deleted messages have no body, agent-authored messages omit author, and secret chats return empty bodies and cannot be written to. These are exactly the surprises an agent must know.

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

Conciseness4/5

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

One dense paragraph with paging logic front-loaded, and every sentence carries new information. It is on the long side with stacked parentheticals, which costs a little readability but not substance.

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

Completeness5/5

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

With no output schema, the description carries the full burden and delivers: it enumerates the message fields (author/agent, body, deleted, replyTo, files, issues) and the 'working' list, so an agent knows what it will get back.

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

Parameters4/5

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

Schema coverage is already 100%, so the baseline is 3; the description adds operational meaning by explaining the before/after cursor idiom and the feedback loop via 'more', which goes beyond the terse schema strings. The 'limit' parameter is left to the schema.

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?

States a specific verb and resource ('A chat's messages') plus the ordering and cursor scope, so an agent immediately knows this is the message-reading tool for a single chat, distinct from list_chats or send_chat_message.

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

Usage Guidelines4/5

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

Explains how to page ('before' reads back, 'after' reads forward, 'more' means pass the first message's id) and names mark_chat_read as the tool that actually marks a chat read. It lacks explicit when-not-to-use conditions, but the operational context is clear.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources