Skip to main content
Glama

List mail messages

mail_list_messages
Read-onlyIdempotent

Lists Outlook messages newest-first with compact fields (id, subject, from, preview), paging, and filters for unread or folder-specific retrieval.

Instructions

Lists Outlook messages newest-first, 10 per call by default (50 max), as a compact projection: id, subject, from, toRecipients, receivedDateTime, isRead, hasAttachments and bodyPreview. The Outlook webLink is NOT included — it is the id again, URL-encoded, and costs more than everything else on the row; pass includeWebLink when you need a clickable link, and use the id for any further mail tool call. Bodies are never included — bodyPreview is Graph's first 255 characters, and mail_get_message returns the rest. Page with skip. Note that Exchange rejects some filter/orderby combinations with "The restriction or sort order is too complex"; when that happens, drop orderby or sort on the same property you filtered.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNoHow many messages to return. Defaults to 10; 50 is the ceiling.
skipNoMessages to skip before returning results. Use it to page: 0, then 10, then 20.
filterNoRaw OData $filter, e.g. "importance eq 'high'" or "receivedDateTime ge 2026-01-01T00:00:00Z". Combined with unreadOnly using and.
selectNoGraph message property names to return instead of the default projection, e.g. ["subject","importance","conversationId"]. id is always included. Do not ask for "body" here — use mail_get_message.
orderbyNoSort order. Defaults to "receivedDateTime desc" (newest first).receivedDateTime desc
folderIdNoRestrict to one mail folder. Accepts a folder id from mail_list_folders or a well-known name: inbox, drafts, sentitems, deleteditems, archive, junkemail, outbox, clutter, conversationhistory, scheduled. Omit to list the whole mailbox.
unreadOnlyNoReturn only unread messages (adds "isRead eq false" to the filter).
includeWebLinkNoInclude each row's Outlook webLink. Off by default: a webLink is the message id all over again, URL-encoded, and on a 50-row page it costs more than every subject and preview put together. Turn it on only when you need a link a person will click — to read or act on a message, pass its `id` to another mail tool instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.0
    • addedInput schema / properties / includeWebLink
      Added value: +{
      +  "default": false,
      +  "description": "Include each row's Outlook webLink. Off by default: a webLink is the message id all over again, URL-encoded, and on a 50-row page it costs more than every subject and preview put together. Turn it on only when you need a link a person will click — to read or act on a message, pass its `id` to another mail tool instead.",
      +  "type": "boolean"
      +}
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description then adds genuine behavioral context the annotations cannot: what the projection contains, that bodies are never returned (only Graph's 255-char preview), the cost rationale for omitting webLink, and the Exchange restriction-complexity error with a remediation. Slightly verbose rather than incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the operation, ordering, and sizing before covering edge cases, and every sentence carries information. It loses a point for repetition between the description and the includeWebLink parameter description, which restate the same webLink-cost rationale.

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?

No output schema exists, and the description compensates by enumerating the returned projection fields and the paging total. For an 8-parameter read tool with annotations covering safety, nothing an agent needs to invoke it correctly is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real semantic value beyond the schema: it explains why includeWebLink is off by default (payload cost), why `select` must not request body, and how `orderby` interacts with `filter` in Exchange. It does not restate the filter syntax, leaving that to the 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 and resource ('Lists Outlook messages'), plus the ordering, default page size, ceiling, and the exact default projection it returns. An agent immediately knows what it gets back and how this differs from a body-fetching tool like mail_get_message.

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?

Gives explicit routing rules: use `id` for further mail tool calls, pass includeWebLink only when a human needs a clickable link, use mail_get_message for bodies, and page with `skip`. It even covers the failure mode where Exchange rejects complex filter/orderby combinations and tells the agent what to change.

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