Skip to main content
Glama

list-mail-messages

Read-only

Retrieve and search email messages from Microsoft 365 accounts using KQL syntax to filter by sender, subject, date, attachments, and other properties.

Instructions

Get an open extension (openTypeExtension object) identified by name or fully qualified name. The table in the Permissions section lists the resources that support open extensions. The following table lists the three scenarios where you can get an open extension from a supported resource instance.

šŸ’” 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:john 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
includeHiddenMessagesNoInclude Hidden Messages
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
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
Behavior2/5

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

Annotations correctly mark this as readOnlyHint: true, but the description opens with entirely false behavioral context about retrieving open extensions. It does not disclose pagination behavior, rate limits, or return value structure for the mail listing operation. The disclosure is limited to search syntax requirements.

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

Conciseness2/5

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

The description is poorly structured with the first paragraph being completely irrelevant waste text. The critical search tip is useful but verbose and should be front-loaded. The structure suggests concatenation of unrelated documentation without editing for this specific tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 12 parameters and no output schema, the description should explain what mail message properties are returned. Instead, it discusses open extension permissions tables that don't exist in the context. It fails to describe the actual return payload or distinguish this from folder-specific listing tools.

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?

Despite the wrong opening text, the description adds substantial value for the 'search' parameter by specifying the double-quote wrapping requirement, KQL syntax operators (from:, subject:, body:, etc.), and concrete examples. With 100% schema coverage, this elevates above the baseline 3 by providing critical formatting constraints not present in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description incorrectly begins with 'Get an open extension (openTypeExtension object)...' which describes a completely different tool, likely copy-pasted from Microsoft Graph API documentation. It fails to mention 'mail messages' or 'list' anywhere in the primary description, making it misleading rather than merely vague.

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?

While the description provides detailed KQL syntax guidance for the $search parameter (valuable usage guidance), it offers no context on when to use this tool versus siblings like list-mail-folder-messages, get-mail-message, or search-query. The critical tips are buried after irrelevant text.

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