Skip to main content
Glama

matrix_get_recent_messages

Retrieve recent messages from a Matrix room, newest first, and page backward through older history using a cursor from the response.

Instructions

Most recent messages in a room, newest first. Pass the returned next_cursor as before_cursor to page backward through history. End-to-end-encrypted rooms surface ciphertext (see README).

Input Schema

NameRequiredDescriptionDefault
limitNo
tenantNo
room_idYes
before_cursorNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full behavioral burden and does well: it discloses result ordering, the cursor-based pagination protocol, and the important E2EE caveat that rooms surface ciphertext. It omits auth/permission requirements and rate limits, which is the main remaining gap.

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 short sentences, front-loaded with what the tool returns and immediately followed by the pagination mechanic and the E2EE caveat. Every sentence adds information; no padding.

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?

An output schema exists, so return values need not be explained, and the description covers ordering, paging, and the encryption caveat. The main omission is the meaning of the tenant and limit parameters for a tool with no annotations backing it up.

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 0%, so the description must compensate and it only partially does: before_cursor is explained well, including its link to the returned next_cursor value. limit, tenant, and room_id carry no semantic detail in either the schema or the description.

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?

States a specific verb and resource ('Most recent messages in a room') plus the ordering ('newest first'), so the agent knows exactly what it retrieves. It does not explicitly contrast itself with matrix_search_messages, but the 'recent' framing makes the distinction reasonably clear.

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?

The description explains how to page backward (feed next_cursor back as before_cursor), which is genuine operational guidance. It never says when to choose this over matrix_search_messages or other read tools, nor any prerequisites, so usage is only implied.

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