Skip to main content
Glama

Search Emails

mail_search
Read-onlyIdempotent

Search emails by subject, sender, or keyword across selected or all accounts and mailboxes; results include account, mailbox, body preview, and pagination.

Instructions

Search emails by subject and/or sender. Each result includes the account, mailbox, and a body preview (~200 chars). Omit mailbox to search across all mailboxes and accounts. Use the preview field to understand results — never guess content from the subject line alone. Returns pagination metadata. Use when: finding emails by subject, sender, or keyword

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": "mail_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax results to return
queryYesSearch term
scopeNoWhere to searchall
offsetNoNumber of results to skip for pagination
accountNoAccount name. Omit to search all accounts.
mailboxNoMailbox name. Omit to search all mailboxes across all accounts.
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable textjson

Output Schema

NameRequiredDescriptionDefault
countYes
itemsYes
totalYes
offsetYes
has_moreYes
next_offsetNo
truncation_messageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description adds real value by stating each result carries account, mailbox, and a ~200-char body preview, and that pagination metadata is returned. It stops short of describing result ordering, relevance, or how matching is performed.

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?

Front-loaded with the purpose, then result shape, then scoping rule, then when-to-use — a sensible order with no filler sentences. Slight redundancy with the schema on the mailbox-omission rule keeps it from a 5.

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

Completeness4/5

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

With an output schema, annotations, and full schema coverage, the description supplies what the structured fields cannot: the preview-based reading guidance ('never guess content from the subject line alone') and the cross-mailbox default. Only minor gaps remain, such as not clarifying the all/subject/sender scope behavior relative to the stated purpose.

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?

Schema coverage is 100%, so every parameter is already documented, including the all/subject/sender scope enum and limit/offset. The description's note about omitting mailbox to widen scope restates the schema rather than extending it, and it says nothing about scope or response_format beyond what the schema states. Baseline 3 applies.

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 by subject and/or sender', and the trailing 'Use when' clause reinforces the retrieval intent. It does not distinguish itself from the sibling mail_search_body, which searches message bodies, so an agent must infer that split itself.

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?

Provides explicit context: 'Use when: finding emails by subject, sender, or keyword', plus the operational rule that omitting mailbox searches across all mailboxes and accounts. It gives no when-not guidance and never routes the agent to mail_search_body for body-text searching.

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