Skip to main content
Glama

list_messages

List messages from a specified mail folder (default inbox) newest first, with server-side filters for unread, sender, attachments, and more. Includes pagination and optional mailbox targeting.

Instructions

List messages from a mail folder, newest first.

Args: folder_id: Folder id, or a well-known name (inbox, sentitems, drafts, deleteditems, archive, junkemail). Default: inbox. mailbox: Optional mailbox (email or user ID). Default: signed-in user. limit: 1-100. Default 25. page_token: Pass next_page_token from a previous result to continue. include_raw: Include the raw Graph payload under "raw" on each item. unread_only: When True, only return messages where isRead is false. Adds isRead eq false to the server-side $filter. filter: Raw OData $filter expression applied server-side. Combined with unread_only using and. Examples: from/emailAddress/address eq 'a@x.com', hasAttachments eq true, contains(subject,'report'), receivedDateTime ge 2026-05-01T00:00:00Z. Cannot be combined with $search — use search_messages for that.

Returns: {"items": [trimmed_message, ...], "next_page_token": str | None}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
filterNo
mailboxNo
folder_idNoinbox
page_tokenNo
include_rawNo
unread_onlyNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A4.6/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 it mostly succeeds: it states ordering ('newest first'), server-side filtering, pagination mechanism, and the shape of the return value. It does not explicitly state 'read-only' or mention authentication/rate limits, but the read-only nature is strongly implied and no destructive side effects are suggested.

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 with a one-line summary, an Args block, and a Returns block. Every parameter earns its place, and the filter examples are useful rather than filler. It is concise despite the large number of parameters.

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?

Despite no output schema, the description fully defines the return format and pagination token. It covers defaults, parameter semantics, filter interactions, and the one key limitation ($search) with a pointer to the right alternate tool. An agent has everything needed to invoke this correctly.

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 description coverage is 0%, so the description must fully compensate. It explains every one of the 7 parameters in detail, adding default values, valid ranges (limit: 1-100), well-known folder names, OData filter syntax with examples, and the behavior of unread_only. This goes well 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?

The description opens with a specific verb and resource: 'List messages from a mail folder, newest first.' It clearly distinguishes itself from sibling search_messages by noting that $search cannot be combined with filter and that search_messages should be used instead. The scope (folder, mailbox, pagination) is unambiguous.

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?

The description gives concrete usage context: default folder, default mailbox, pagination continuation, and filter behavior. It explicitly warns that filter cannot be combined with $search and points to search_messages as the alternative. It does not cover every sibling relationship (e.g., get_message for a single message), but it provides enough for correct tool selection.

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