[BUG] Microsoft 365 MCP: outlook_email_search offset and beforeDateTime parameters are ignored — pagination broken
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Summary
The outlook_email_search tool's offset and beforeDateTime parameters are silently ignored. Every query returns the same set of most-recent results regardless of offset value, making it impossible to paginate through more than 50 emails. This effectively caps email retrieval at 50 messages per query with no workaround.
Reproduction
offset is ignored
# These three calls all return the EXACT same 50 messages (verified by message ID):
outlook_email_search(afterDateTime="2026-03-13T23:00:00Z", folderName="Deleted Items", limit=50, offset=0)
outlook_email_search(afterDateTime="2026-03-13T23:00:00Z", folderName="Deleted Items", limit=50, offset=50)
outlook_email_search(afterDateTime="2026-03-13T23:00:00Z", folderName="Deleted Items", limit=50, offset=25)
The only difference is the offset number in each response object is renumbered (0-49, 50-99, 25-74) — the actual message data and IDs are identical.
beforeDateTime is ignored
# This should return only emails from Friday evening to Sunday midnight:
outlook_email_search(afterDateTime="2026-03-13T23:00:00Z", beforeDateTime="2026-03-15T06:00:00Z", folderName="Deleted Items", limit=50)
# Instead returns emails from Monday afternoon (2026-03-16T14:58Z) — well outside the window
Test Matrix
| Parameter | Works? | Notes |
|-----------|--------|-------|
| offset | No | Completely ignored; same results at any offset value |
| beforeDateTime | No | Completely ignored; results outside the window are returned |
| afterDateTime | Yes | Correctly filters to emails after the given time |
| limit | Yes | Correctly limits result count (e.g., limit=10 returns 10) |
| folderName | Yes | Correctly scopes to the specified folder |
| query | Yes | Correctly filters by keyword |
| sender | Yes | Correctly filters by sender |
Tested offset values
All tested against Deleted Items folder with afterDateTime set and limit=50:
- offset=0, 5, 10, 25, 50, 100, 150, 200 — all return the same 50 messages
- Tested with and without
queryparameter — same behavior - Tested with
limit=5at offset=0 and offset=5 — same first 5 messages
Impact
- Cannot retrieve more than 50 emails from any single query
- Cannot paginate through large mailboxes (e.g., 11,000+ items in Deleted Items)
- Time-window slicing is impossible since
beforeDateTimeis also broken - Skills/agents that rely on pagination (e.g., daily email catchup) silently miss the majority of messages
Workaround
Using read_resource with mail:///folders/{folderName} returns the 50 most-recent messages per folder plus subfolder structure, which allows drilling into subfolders for additional coverage. However, read_resource also has no pagination support (query string parameters like $skip/$top are ignored).
Expected Behavior
offset=50withlimit=50should skip the first 50 results and return results 51-100beforeDateTimeshould filter out emails received after the specified time- These parameters should map to the underlying Microsoft Graph API's
$skipand$filter(receivedDateTime lt ...) respectively
Environment
- Claude Code with Microsoft 365 MCP integration (Team/Enterprise plan)
- Tool:
mcp__claude_ai_Microsoft_365__outlook_email_search - Windows 11, Claude Code CLI
What Should Happen?
offset=50withlimit=50should skip the first 50 results and return results 51-100beforeDateTimeshould filter out emails received after the specified time- These parameters should map to the underlying Microsoft Graph API's
$skipand$filter(receivedDateTime lt ...) respectively
Error Messages/Logs
Steps to Reproduce
offset is ignored
# These three calls all return the EXACT same 50 messages (verified by message ID):
outlook_email_search(afterDateTime="2026-03-13T23:00:00Z", folderName="Deleted Items", limit=50, offset=0)
outlook_email_search(afterDateTime="2026-03-13T23:00:00Z", folderName="Deleted Items", limit=50, offset=50)
outlook_email_search(afterDateTime="2026-03-13T23:00:00Z", folderName="Deleted Items", limit=50, offset=25)
The only difference is the offset number in each response object is renumbered (0-49, 50-99, 25-74) — the actual message data and IDs are identical.
beforeDateTime is ignored
# This should return only emails from Friday evening to Sunday midnight:
outlook_email_search(afterDateTime="2026-03-13T23:00:00Z", beforeDateTime="2026-03-15T06:00:00Z", folderName="Deleted Items", limit=50)
# Instead returns emails from Monday afternoon (2026-03-16T14:58Z) — well outside the window
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.76
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗