claude-code - 💡(How to fix) Fix [BUG] Microsoft 365 MCP connector: outlook_email_search rejects hyphenated domains in mailboxOwnerEmail [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52395Fetched 2026-04-24 06:08:20
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×2unlabeled ×1

Error Message

MCP error -32602: Input validation error: Invalid arguments for tool outlook_email_search: [ { "validation": "email", "code": "invalid_string", "message": "Invalid email", "path": ["mailboxOwnerEmail"] } ]

request_id: req_011CaKTf8kFygsmUCiDeMgqK

Second attempt (same error, different request ID): request_id: req_011CaKTfdVPZyGYWcooorK2b

Root Cause

This bug is filed in anthropics/claude-code because there is no dedicated public issue tracker for claude.ai built-in MCP connectors. Recent precedent: #51790 (Gmail connector), #44361 (Slack connector) filed in the same repo.

Code Example

MCP error -32602: Input validation error: Invalid arguments for tool 
outlook_email_search: [
  {
    "validation": "email",
    "code": "invalid_string",
    "message": "Invalid email",
    "path": ["mailboxOwnerEmail"]
  }
]

request_id: req_011CaKTf8kFygsmUCiDeMgqK

Second attempt (same error, different request ID):
request_id: req_011CaKTfdVPZyGYWcooorK2b
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The mailboxOwnerEmail parameter on the outlook_email_search tool rejects RFC-compliant email addresses that contain a hyphen in the domain label. Validation fails at input parsing, before the request reaches Microsoft Graph.

The same address format is accepted by the recipient parameter on the same tool, suggesting an over-strict format: email validator (likely Zod default) applied only to mailboxOwnerEmail and calendarOwnerEmail.

What Should Happen?

The mailboxOwnerEmail parameter should accept any RFC-compliant email address, including those with hyphens in the domain label. Hyphens are explicitly valid per RFC 5321 §4.1.2 and RFC 1035 §2.3.1 — domain labels may contain hyphens as long as they are not leading or trailing.

The validator should pass the request through to Microsoft Graph, where actual permission and mailbox-existence checks belong. Any of these addresses should validate successfully:

For consistency, this should match the looser validation already applied to recipient, sender, and organizer on the same tool, which accept these addresses without issue.

Error Messages/Logs

MCP error -32602: Input validation error: Invalid arguments for tool 
outlook_email_search: [
  {
    "validation": "email",
    "code": "invalid_string",
    "message": "Invalid email",
    "path": ["mailboxOwnerEmail"]
  }
]

request_id: req_011CaKTf8kFygsmUCiDeMgqK

Second attempt (same error, different request ID):
request_id: req_011CaKTfdVPZyGYWcooorK2b

Steps to Reproduce

  1. In claude.ai with the Microsoft 365 connector enabled, ask Claude to search a shared mailbox on a hyphenated domain. Example prompt:

    "Search the shared mailbox [email protected] for emails received this week"

  2. Claude invokes outlook_email_search with:

    • mailboxOwnerEmail: "[email protected]"
    • afterDateTime: "Monday April 20 2026"
    • limit: 50
  3. Observe immediate rejection at input validation with the error above. The request never reaches Microsoft Graph.

  4. For comparison, invoke the same tool with:

    • recipient: "[email protected]"

    This call passes validation and executes against Graph successfully, confirming the address format itself is valid and the bug is specifically in the mailboxOwnerEmail validator.

Expected behavior: search proceeds; Graph returns either results or a permissions/not-found error.

Actual behavior: rejected at input validation before reaching Graph.

Claude Model

Other

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

n/a

Platform

Other

Operating System

Other

Terminal/Shell

Other

Additional Information

This bug is filed in anthropics/claude-code because there is no dedicated public issue tracker for claude.ai built-in MCP connectors. Recent precedent: #51790 (Gmail connector), #44361 (Slack connector) filed in the same repo.

extent analysis

TL;DR

The mailboxOwnerEmail parameter in the outlook_email_search tool should be updated to accept RFC-compliant email addresses with hyphens in the domain label by relaxing the email validation.

Guidance

  • Review the Zod validation configuration for mailboxOwnerEmail and calendarOwnerEmail to identify the overly restrictive format validation.
  • Update the validation to match the looser validation applied to recipient, sender, and organizer parameters, which already accept hyphenated domain labels.
  • Test the updated validation with example email addresses, such as [email protected] and [email protected], to ensure they pass validation.
  • Verify that the request is successfully passed to Microsoft Graph for permission and mailbox-existence checks.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The issue is specific to the mailboxOwnerEmail parameter and does not affect other parameters like recipient. The fix should focus on relaxing the email validation for this specific parameter.

Recommendation

Apply a workaround by updating the Zod validation configuration to accept RFC-compliant email addresses with hyphens in the domain label, as this is the most likely cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Microsoft 365 MCP connector: outlook_email_search rejects hyphenated domains in mailboxOwnerEmail [1 participants]