Skip to main content
Glama
marlonluo2018

Microsoft Graph MCP Server

search_emails

Search email messages by keywords, sender, subject, or body. Returns matching emails with summary information, and supports filtering by folder, time range, and Focused Inbox.

Instructions

SEARCH EMAIL MESSAGES ONLY. Search or list email messages by keywords, sender, subject, or body. Returns matching email messages with summary information. DO NOT use this to find people/contacts - use search_contacts for that. If no search_type and query are provided, lists emails within the specified time range. All time parameters use your local timezone. PARAMETER PRECEDENCE (highest to lowest): 1) time_range (overrides all other time parameters), 2) start_date/end_date (overrides days), 3) days (used only if no other time parameters provided). IMPORTANT FOR OLD EMAILS: The 'days' parameter has a maximum limit (default 90 days). To search emails older than this limit, use start_date/end_date parameters instead - they have NO date range restriction and can search any historical emails. Example: start_date='2023-01-01', end_date='2023-12-31'. FOCUSED INBOX: By default, searches only 'focused' emails (Outlook's Focused Inbox). Use inference_classification='other' to search 'other' emails, or inference_classification='all' to search both. Returns: {success: boolean, emails: array, count: integer, date_range: string, filter_date_range: string, timezone: string}. Note: Rate limit errors (HTTP 429) return retry_after field with seconds to wait. Invalid folder paths return appropriate error messages.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days to look back. Default: 7, maximum: 90. LOWEST PRIORITY: Used only when no time_range, start_date, or end_date are provided. **TIP**: For searching emails older than 90 days, use start_date and end_date parameters instead.
queryNoSearch query for email messages. For 'sender': email address only. For 'subject': subject text. For 'body': body text content. Required when search_type is provided. Optional - if not provided with search_type, lists emails within the time range
folderNoOptional folder path to search (e.g., 'Inbox', 'Inbox/Projects', 'Archive/2024'). Default: InboxInbox
end_dateNoEnd date in your local timezone (e.g., '2024-12-31' or '2024-12-31T23:59'). Overridden by time_range if both are provided. **NO DATE RANGE LIMIT**: Unlike 'days' parameter, end_date has no restriction - use this to search old emails beyond the default 90-day limit. **SPECIAL VALUE**: Use 'now' to search from start_date until current time (e.g., start_date='2024-01-01', end_date='now' searches from Jan 1 to now).
start_dateNoStart date in your local timezone (e.g., '2024-01-01' or '2024-01-01T14:30'). Overridden by time_range if both are provided. **NO DATE RANGE LIMIT**: Unlike 'days' parameter, start_date has no restriction - use this to search old emails beyond the default 90-day limit.
time_rangeNoTime range type (case-insensitive). Optional, in your local timezone. Accepted values: 'today', 'tomorrow', 'this_week', 'next_week', 'this_month', 'next_month' (any case). HIGHEST PRIORITY: If provided, overrides start_date, end_date, and days. Returns a user-friendly display string in the response. Examples: 'today', 'Today', 'THIS_WEEK', 'Next_Month'
search_typeNoType of search to perform (optional). Options: 'sender' (search by sender email address only), 'subject' (search by subject text with exact substring matching), 'body' (search by body content with exact substring matching). If not provided, lists emails within the time range without filtering
inference_classificationNoFilter by Outlook Focused Inbox classification. 'focused' (default): important emails shown in Focused tab. 'other': less important emails shown in Other tab. 'all': search both focused and other emails. Default: focusedfocused
Behavior5/5

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

With no annotations, the description fully covers behavioral aspects: default focused inbox, rate limit error handling, folder path errors, timezone handling, and parameter precedence. No contradictions.

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?

Well-structured with sections, bold emphasis, and clear warnings. Slightly long but each sentence is necessary; no fluff.

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?

Given 8 parameters, no output schema, and no annotations, the description covers return format, error handling, edge cases (old emails, focused inbox), and usage constraints. Fully adequate.

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%, but description adds extra context like the 90-day limit tip, focused inbox default, and parameter precedence. This goes beyond what schema provides, justifying above baseline.

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?

Clear verb ('search'), specific resource ('email messages'), and explicit differentiation from sibling tool 'search_contacts'. The description states purpose upfront and in bold.

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?

Explicitly warns against using for contacts, gives parameter precedence, explains when to use start_date/end_date vs days for old emails, and provides examples. Covers when to use and when not to use.

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/marlonluo2018/microsoft_graph_mcp_server'

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