Skip to main content
Glama

list_chat_messages

Retrieve messages from a Microsoft Teams chat, newest first, with pagination and optional time range filters. Use list_chats to get chat_id.

Instructions

List messages in a chat, newest first, a page at a time.

Use list_chats to get the chat_id. Returns {"messages": [...], "next_before": ...} with up to limit (1-200) messages created after after and before before: ISO 8601 timestamps, both exclusive and optional; one without an offset is read as UTC. For the next older page call again with before=next_before and the same after; next_before is null when no older messages are left in that range. Pages come newest first, so after alone returns the newest messages of the chat, not the ones right after that time. Each message has id, sender, createdDateTime and plain-text content, plus attachments, hostedContents (inline image ids for download_attachment) and mention entities when present. System messages are left out, so a page can hold fewer than limit messages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterNo
limitNo
beforeNo
chat_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and delivers: pagination semantics, the newest-first pitfall (after alone returns newest, not messages after that time), system-message exclusion impacting page size, and timezone handling for offsetless timestamps. This is unusually rich behavioral disclosure.

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?

Front-loaded with the core action and ordering, then pagination and edge cases. Every sentence carries actionable information; none is filler despite the density.

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 paged list tool with a 4-param schema, no annotations, and an output schema, the description covers invocation, pagination, edge cases, and timezone semantics. Nothing an agent needs to call it correctly is missing.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate, and it does: limit range (1-200), after/before are ISO 8601, optional, exclusive, and offsetless values read as UTC, and chat_id's source. Every parameter gains meaning beyond the bare 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 ('List'), resource ('messages in a chat'), and ordering ('newest first, a page at a time'). An agent can immediately distinguish it from list_channel_messages by the chat scope and from get_message by the list/paging nature.

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?

Explicitly routes the agent to list_chats to obtain the chat_id, and clearly explains the pagination loop (call again with before=next_before). It does not explicitly contrast against siblings like search_messages or list_channel_messages, so it stops short of full alternative discrimination.

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