Skip to main content
Glama

list-mail-folder-messages

Read-only

Retrieve and search email messages from a specified Microsoft 365 mailbox folder using filters, sorting, and KQL search queries for targeted email management.

Instructions

Get all the messages in the specified user's mailbox, or those messages in a specified folder in the mailbox.

šŸ’” TIP: CRITICAL: When searching emails, the $search parameter value MUST be wrapped in double quotes. Format: $search="your search query here". Use KQL (Keyword Query Language) syntax to search specific properties: 'from:', 'subject:', 'body:', 'to:', 'cc:', 'bcc:', 'attachment:', 'hasAttachments:', 'importance:', 'received:', 'sent:'. Examples: $search="from:john@example.com" | $search="subject:meeting AND hasAttachments:true" | $search="body:urgent AND received>=2024-01-01" | $search="from:alice AND importance:high". Remember: ALWAYS wrap the entire search expression in double quotes! Reference: https://learn.microsoft.com/en-us/graph/search-query-parameter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNoShow only the first n items
skipNoSkip the first n items
searchNoSearch items by search phrases
filterNoFilter items by property values
countNoInclude count of items
orderbyNoOrder items by property values
selectNoSelect properties to be returned
expandNoExpand related entities
mailFolderIdYesPath parameter: mailFolderId
fetchAllPagesNoAutomatically fetch all pages of results
includeHeadersNoInclude response headers (including ETag) in the response metadata
excludeResponseNoExclude the full response body and only return success or failure indication
Behavior4/5

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

The description adds significant behavioral detail not present in annotations, specifically that the `$search` parameter MUST be wrapped in double quotes and accepts KQL operators (from:, subject:, etc.). This critical usage constraint prevents invocation errors. However, it omits other behavioral traits like pagination defaults or rate limiting despite the `readOnlyHint` and `openWorldHint` annotations being present.

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

Conciseness3/5

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

The description is front-loaded with the purpose statement, followed by the detailed search syntax guide. While the search tip is lengthy (containing examples and a URL), the formatting uses visual cues (šŸ’” TIP: CRITICAL) effectively. However, the verbosity of the examples could be condensed without losing the critical 'double quotes' requirement.

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?

Given the tool has 12 parameters and no output schema, the description adequately covers the complex input requirements (particularly the search DSL) which compensates partially for missing return value documentation. It does not address the `fetchAllPages` behavior or what the tool returns, but the schema coverage is complete for inputs.

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?

With 100% schema description coverage, the baseline is 3, but the description substantially enriches the `search` parameter semantics beyond the schema's generic 'Search items by search phrases'. It details the mandatory double-quote wrapping, valid KQL operators, and concrete examples, providing essential syntax guidance that raw JSON schema cannot express.

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?

The description states the core purpose (getting messages) and mentions the folder context, distinguishing it from the sibling `list-mail-messages`. However, the phrasing 'Get all the messages in the specified user's mailbox, or those messages in a specified folder' ambiguously suggests the folder parameter is optional when the schema requires `mailFolderId`, creating potential confusion about the tool's primary scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides extensive guidance on how to format the `$search` parameter (KQL syntax, double quote requirements), but offers no guidance on when to select this tool versus sibling alternatives like `list-mail-messages` or `get-mail-message`. It does not state prerequisites or when-not-to-use conditions.

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/alfredo-ia/ms-365-mcp-server'

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