Skip to main content
Glama
rosquillas

Element MCP Server

by rosquillas

Get Matrix Messages

matrix_get_messages
Read-onlyIdempotent

Retrieve message history from a specific Matrix room to view conversation content, with pagination support for accessing older or newer messages.

Instructions

Retrieve messages from a specific Matrix room.

Use matrix_list_rooms first to get available room IDs.

Args:

  • room_id: The room ID to fetch messages from

  • limit: Maximum messages to return (1-100, default 50)

  • from: Pagination token for fetching more messages

  • direction: 'b' for older messages, 'f' for newer

Returns:

  • List of messages with sender, timestamp, and content

  • Pagination tokens for fetching more messages

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
room_idYesThe Matrix room ID (e.g., !abc123:matrix.org)
limitNoMaximum number of messages to return
fromNoPagination token from a previous request (use 'end' value)
directionNoDirection to paginate: 'b' for backwards (older), 'f' for forwards (newer)b
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=true, and idempotentHint=true, covering safety and idempotency. The description adds valuable behavioral context: pagination behavior (tokens, direction options), return format details (list with sender/timestamp/content), and default values (limit default 50), which aren't covered by 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 well-structured and front-loaded: the first sentence states the core purpose, followed by usage guidance, then parameter explanations, and return details. Every sentence earns its place with no wasted words, making it efficient and scannable.

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?

Given the tool's moderate complexity (4 parameters, pagination), rich annotations (covering safety/idempotency), and 100% schema coverage, the description is complete. It adds necessary context like prerequisite usage, behavioral details (pagination, returns), and distinguishes from siblings, compensating for the lack of output schema by describing return values.

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 fully documents all parameters. The description adds minimal extra semantics: it clarifies 'from' as a pagination token from previous requests and mentions default values, but doesn't provide significant additional meaning beyond the schema's thorough descriptions.

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 verb 'retrieve' and resource 'messages from a specific Matrix room', distinguishing it from siblings like matrix_get_room_info (room metadata), matrix_list_rooms (room listing), and matrix_search_messages (filtered search). It specifies the exact scope of retrieval.

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 provides when-to-use guidance: 'Use matrix_list_rooms first to get available room IDs.' This directs users to a prerequisite tool and distinguishes it from matrix_search_messages by implying this is for bulk retrieval rather than filtered search.

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/rosquillas/element-mcp-server'

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