[Outlook Email Connector] Free-text search_messages fails for personal Microsoft accounts (MSA)

Open 💬 0 comments Opened Aug 15, 2026 by coolbotic

What issue are you seeing?

The Outlook Email plugin/connector's search_messages tool fails for free-text searches when connected to a personal Microsoft account (MSA).

Example:

search_messages({"query":"pizza","size":50})

returns:

HTTPError: 400: This API is not supported for MSA accounts (no addressUrl for Microsoft.MicrosoftSearch,False). (Response: {"error":
{"code":"BadRequest","message":"This API is not supported for MSA accounts (no addressUrl for Microsoft.MicrosoftSearch,False).","innerError":{"date":"...","request-id":"...","client-request-id":"..."}}})

The connector appears to route free-text searches through Microsoft Graph's POST /search/query, which does not support Outlook message search for MSA accounts.

Codex then falls back to list_messages with filters such as contains(subject,'pizza'). That is not a suitable replacement because it only searches the subject. An attempted contains(bodyPreview,'pizza') fallback also fails because bodyPreview does not support filtering.

What steps can reproduce the bug?

  1. Connect the Outlook Email plugin using a personal Microsoft account.
  2. Ask Codex to search Outlook mail for a keyword such as pizza.
  3. The connector calls:
codex_apps.microsoft_outlook_email.search_messages({
  "query": "pizza",
  "size": 50
})
  1. The call returns:
HTTP 400
This API is not supported for MSA accounts
(no addressUrl for Microsoft.MicrosoftSearch,False).
  1. Codex may then try:
list_messages({
  "filter": "contains(subject,'pizza') or contains(bodyPreview,'pizza')"
})

which fails because bodyPreview is not filterable.

A subject-only filter works, but does not provide full free-text email search.

What is the expected behavior?

For personal Microsoft accounts, search_messages should use the MSA-compatible Outlook message search endpoint:

GET /me/messages?$search="pizza"

instead of using POST /search/query.

This would allow proper server-side keyword search rather than falling back to incomplete subject-only filtering.

Additional information

The issue appears to be in the Outlook Email plugin/connector implementation rather than Microsoft Graph itself.

The current fallback is not suitable because:

  • subject filtering misses keywords that only appear in the message body;
  • bodyPreview cannot be used with $filter;
  • listing many messages and scanning them locally would only be a partial and inefficient workaround.

GET /me/messages?$search="..." works for the same personal Microsoft account in Microsoft Graph Explorer.

View original on GitHub ↗