Skip to main content
Glama

Read the chat

chat_messages
Read-onlyIdempotent

Reads one page of flat chat messages in chronological order, newest first, with reactions and mentions. Use beforeId to page back or find a message id to edit, react, delete, or mark read.

Instructions

Reads one page of the flat chat, newest messages by default, in chronological order. Use it to catch up or to find a message id for chat_edit, chat_react, chat_delete or chat_mark_read; it does not change the read marker (use chat_mark_read) and does not count unread messages (use chat_unread). To page back, send beforeId of the oldest message you have; a malformed id gives before_id_invalid. The result holds messages, their reactions and mentions, and each member's read position; deleted messages show no text.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "chat_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of messages in the page. Omit for the default page size.
wgCodeNoShare code of the flat (code from wg_list). Leave it out when the account belongs to one flat.
beforeIdNoCursor: id of the oldest message you already have, from a previous chat_messages result; the page then holds the messages sent before it. Omit for the newest page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.3.0
    • removedInput schema / properties / before
      Removed value: -{
      -  "description": "Cursor time: createdAt (ISO 8601 with offset) of the oldest message you already have. Send together with beforeId; omit both for the newest page.",
      -  "format": "date-time",
      -  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
      -  "type": "string"
      -}
    • changedInput schema / properties / beforeId / description
      Previous value: -"Cursor id: id of the oldest message you already have, from a previous chat_messages result. Send together with before."New value: +"Cursor: id of the oldest message you already have, from a previous chat_messages result; the page then holds the messages sent before it. Omit for the newest page."
  2. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / before / description
      Added value: +"Cursor time: createdAt (ISO 8601 with offset) of the oldest message you already have. Send together with beforeId; omit both for the newest page."
    • addedInput schema / properties / beforeId / description
      Added value: +"Cursor id: id of the oldest message you already have, from a previous chat_messages result. Send together with before."
    • addedInput schema / properties / limit / description
      Added value: +"Maximum number of messages in the page. Omit for the default page size."
  3. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare read-only/idempotent/non-destructive; the description goes much further, disclosing that it does not advance the read marker, does not count unread messages, that a malformed cursor yields before_id_invalid, and what the payload contains (messages, reactions, mentions, read positions) with deleted messages blanked.

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?

Three tight sentences with the core read behavior front-loaded, then routing guidance, then paging mechanics. No filler or redundancy despite covering a lot.

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?

No output schema exists, yet the description states what the result holds and how deleted messages appear. Combined with full parameter coverage and routing to siblings, an agent has everything needed to call this correctly.

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 the schema already explains limit, wgCode and beforeId in detail. The description adds the failure mode for a malformed beforeId (before_id_invalid) and reinforces the cursor semantics, but says nothing new about limit or wgCode, so it sits at the baseline.

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 ("Reads one page of the flat chat") plus default ordering (newest first) and page ordering (chronological). It explicitly separates itself from chat_mark_read and chat_unread, so an agent can pick it without opening the schema.

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?

Gives concrete when-to-use cases ("catch up" or "find a message id" for chat_edit, chat_react, chat_delete, chat_mark_read) and two explicit when-not-to-use cases with the sibling to use instead. Paging-back instructions are also included.

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