Skip to main content
Glama

search_mail

Find Outlook emails by query using local SQLite FTS5 offline or Microsoft Graph KQL remote search; use offline mode for synced mail to avoid Exchange rate limits.

Instructions

Search emails in local SQLite FTS5 (offline: true) or remotely via Microsoft Graph KQL $search. Remote search is 1 Graph request per page and is rate-limited by Exchange; prefer offline: true (local FTS, no request) for mail that is already synced.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "search_mail"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNo
queryYes
cursorNoOpaque next_cursor from a previous remote search response
folderNo
compactNoDefault true. Set false for full message fields in online results (no attachment bytes)
offlineNoRead the local cache only; no Graph request.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does disclose meaningful operational traits: remote search costs 1 Graph request per page and is rate-limited by Exchange, while offline search issues no request. It omits return shape, auth/permission requirements, and result-ordering behavior, so it is informative but not complete.

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

Conciseness5/5

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

Two tight sentences: the first establishes the dual-mode behavior, the second gives the cost/rate-limit tradeoff and the recommendation. No filler, and the decisive guidance (prefer offline) is front-loaded.

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

Completeness3/5

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

For a 6-parameter, no-annotation, no-output-schema tool, the description covers the mode-selection and cost dimension well but leaves folder scoping, result shape, and pagination semantics unaddressed. Adequate to call correctly, not adequate to predict what comes back.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

At 50% schema coverage, the description does add real meaning the schema lacks by stating that query is interpreted as Graph KQL $search remotely and as FTS5 locally. However, it says nothing about limit (1–200), folder scoping, or how cursor interacts with paging beyond the phrase "per page."

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

Purpose4/5

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

States a specific verb and resource ("Search emails") and immediately distinguishes two execution backends: local SQLite FTS5 with offline: true versus remote Microsoft Graph KQL $search. It doesn't explicitly contrast itself with list_messages or other siblings, which keeps it from a 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear conditional recommendation: "prefer offline: true ... for mail that is already synced," with the rationale (no request, avoids Exchange rate limits). It doesn't address when a caller should use a listing tool instead of searching, so it stops short of full when/when-not coverage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.