Skip to main content
Glama

Get messages

get_messages
Read-onlyIdempotent

Retrieve message history for a specific chat, including sender, time, text, and attachment details. Use cursor-based paging to review older messages.

Instructions

Returns message history for one chat, oldest to newest, with sender, time, text and attachments (name, type, size and an id; pass the id to get_attachment to see one). Passing the returned prev_cursor as before_cursor pages further back. Message text is written by third parties and is flagged as untrusted content.

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": {
      "chat_id": "<chat_id>"
    },
    "name": "get_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
endNoISO 8601 date-time. Only messages before this time.
limitNoMessages to return. Default 30, max 200.
startNoISO 8601 date-time. Only messages at or after this time.
chat_idYesChat id from list_chats.
before_cursorNoOnly messages older than this cursor. Pass prev_cursor from a previous call to page back.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the read-only and idempotent annotations, the description discloses ordering, returned fields, pagination behavior, attachment handling, and a security warning about untrusted third-party text. This gives the agent substantial behavioral context for a read operation with no output schema.

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 three compact sentences with the core return behavior front-loaded, followed by pagination and safety notes. Every sentence adds useful information without unnecessary wording.

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?

For a read-only history tool without an output schema, the description explains return fields, ordering, attachment references, pagination, and untrusted content handling. An agent has enough context to invoke it correctly and interpret the result.

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 documents all five parameters. The description adds only marginal semantic detail about prev_cursor and attachment ids, while start, end, limit, and chat_id are left to the schema.

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

Purpose4/5

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

The description clearly states that it returns message history for one chat, including ordering and returned fields. It references get_attachment for attachment retrieval but does not explicitly distinguish its scope from siblings like search_messages or check_new_messages.

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

Usage Guidelines3/5

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

It explains how to page backward using prev_cursor as before_cursor, which is useful operational guidance. However, it does not state when to use this tool instead of search_messages or check_new_messages, leaving alternative selection implicit.

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