Skip to main content
Glama
mail-mcp-server

mail-mcp-server

search

search
Read-onlyIdempotent

Find locally synced messages by text, sender, folder, and date, then list message cards and open selected mail for review.

Instructions

Search locally synced messages in one connection. Choose query and field for text search; optionally restrict by folder and dates. Text results are most relevant first. To list a period's mail across all folders, omit query and supply since or until; results are cards without bodies, newest first, without snippets. To combine a sender with words in another field, use from with query and field; from alone lists that sender's cards the same way.

To review many messages, list the cards first and choose from sender, subject, date, read status and the attachment flag. Then search text for what cards cannot show, such as the user's name, and open only the chosen messages with getMessage. Automated mail can hold assignments, questions or errors, so a routine subject does not prove a message is unimportant. When reporting, say which messages you did not open.

Subject, body and attachment text support Russian and English word forms; irregular forms and synonyms may be missed. If results are sparse, try fewer words, other forms, synonyms or the other language in separate calls. An empty result does not prove the mail is absent: only synced, indexed content is searched.

Read a hit with getMessage using the same connection and the hit's key. Snippets mark matches as word, but may show only part of a match or body context. If a hit has snippetAttachmentFile, read that attachment with getAttachment using the same connection, the hit's key and file=snippetAttachmentFile. Recognized copies are returned once; copies lists other matching keys and folders. total and paging count these groups.

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": {
      "connection": "<connection>"
    },
    "name": "search"
  }
}

Input Schema

NameRequiredDescriptionDefault
fromNoOnly messages from this one complete sender address, ignoring case. Combines with query and field, for example from=user@example.com, query=receipt, field=subject
fieldNoChoose one: any (default; all fields below), subject, body, from, to (includes Cc), attachmentName (whole name or parts), attachmentText (extracted contents), label (mailbox label words, such as Gmail's Inbox, Sent or user labels; connections without labels match nothing). from/to search addresses and names. For an exact address match, use an unquoted full address: field=from, query=user@example.com. This ignores case and display names. any also searches content, so an address there need not be a participant. Without query, field has no effect
limitNoResults per page: 1 to 100, default 20; larger values are capped at 100
queryNoSearch terms, a quoted phrase or a full email address; at most 1000 characters. Words combine with AND (common stop words may be ignored); double quotes make a phrase. No OR/NOT, wildcards, fuzzy matching or field-prefix syntax such as from:. Search alternatives in separate calls. Omit only when since, until or from is given
sinceNoInclude messages at or after this date/time, using the message Date header, not receipt or download time. Format: YYYY-MM-DD (UTC midnight), or ISO-8601 with Z or an offset, e.g. 2026-10-01T09:00:00+03:00; at most 3 fractional second digits. Messages without a date are excluded
untilNoInclude messages strictly before this date/time; same header and format as since. To include a whole day, use the following day's midnight. Must be later than since when both are given. Messages without a date are excluded
folderNoOne folder key from listFolders, not its display name. Omit to search all folders in the connection
offsetNoDefault 0. For the next page, repeat the same search arguments and use the previous nextOffset. Stop when there is no nextOffset
connectionYesConnection name from listConnections

Output Schema

NameRequiredDescriptionDefault
fromNoApplied sender address filter.
hitsYesHits, most relevant first; newest first for date-only search.
fieldYesField searched.
queryNoText query; absent for date-only search.
sinceNoApplied since bound, in UTC.
totalYesMatching messages; copies of one message count once.
untilNoApplied until bound, in UTC.
folderNoFolder key searched; absent for all folders.
offsetYesPosition of this page.
connectionYesConnection name.
nextOffsetNoPass as offset to get the next page; absent at the end.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.1.1
    • addedInput schema / properties / from
      Added value: +{
      +  "description": "Only messages from this one complete sender address, ignoring case. Combines with query and field, for example from=user@example.com, query=receipt, field=subject",
      +  "type": "string"
      +}
    • changedInput schema / properties / query / description
      Previous value: -"Search terms, a quoted phrase or a full email address; at most 1000 characters. Words combine with AND (common stop words may be ignored); double quotes make a phrase. No OR/NOT, wildcards, fuzzy matching or field-prefix syntax such as from:. Search alternatives in separate calls. Omit only when since or until is given"New value: +"Search terms, a quoted phrase or a full email address; at most 1000 characters. Words combine with AND (common stop words may be ignored); double quotes make a phrase. No OR/NOT, wildcards, fuzzy matching or field-prefix syntax such as from:. Search alternatives in separate calls. Omit only when since, until or from is given"
    • addedOutput schema / properties / from
      Added value: +{
      +  "description": "Applied sender address filter.",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Beyond readOnly/idempotent annotations it discloses result ordering (relevance vs. newest-first), that card listings carry no bodies or snippets, that recognized copies are deduplicated with other keys listed in copies, and that total/paging count groups. It also discloses meaningful limits: only synced/indexed content is searched, so an empty result is not proof of absence, and irregular word forms or synonyms may be missed.

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

Conciseness3/5

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

It is front-loaded with purpose and search-mode guidance, but it runs to five paragraphs and includes agent-workflow advice ("list the cards first...", "say which messages you did not open", the note about automated mail) that does not describe how to invoke this tool. The snippet and attachment-follow-up details are relevant but could be tightened.

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

Completeness5/5

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

For a nine-parameter search tool with an output schema, the description covers what the schema cannot: ranking, deduplication, snippet markup, the snippetAttachmentFile-to-getAttachment handoff, and the indexing limitation. Nothing an agent needs to call it correctly or interpret an empty result is missing.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real cross-parameter meaning: from combines with query and field, omitting query requires since/until/from, and paging is done by repeating the same arguments with the prior nextOffset. It stops short of restating the per-field format rules, which the schema already covers.

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

Purpose5/5

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

"Search locally synced messages in one connection" gives a specific verb, resource, and scope, and the following sentences distinguish the two modes (text search vs. date-range card listing) from the sibling list/get tools. An agent can tell what this does without opening the schema.

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

Usage Guidelines5/5

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

Explicitly states when to omit query and use since/until, when to combine from with query and field, and when to prefer listing cards first. It names the downstream siblings (getMessage, getAttachment) and the prerequisite sources (listFolders, listConnections) and gives a fallback strategy when results are sparse.

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