Skip to main content
Glama

Search Email Bodies

mail_search_body
Read-onlyIdempotent

Search full-text content inside email bodies, not just subjects or senders, to find messages mentioning specific topics. Build the FTS index first, then paginate results.

Instructions

Search email body content using full-text search. Searches inside the actual email text, not just subject/sender. Requires the FTS index to be built first (use mail_fts_index). Returns pagination metadata. Use when: searching for specific content within emails, finding messages mentioning a topic

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_body"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMax results to return
queryYesSearch term(s) to find in email bodies
offsetNoNumber of results to skip for pagination
accountNo
mailboxNoINBOX
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

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered. The description adds value beyond them by disclosing the hard prerequisite of a built FTS index and that pagination metadata is returned. It omits whether account/mailbox scoping is applied implicitly and gives no indication of search cost or latency on large mailboxes.

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 purpose and scope before prerequisites and usage triggers, and no sentence is pure filler. The trailing 'Use when:' fragment reads as clipped notes rather than polished prose, a minor blemish.

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?

Return values need not be explained because an output schema exists, and the FTS prerequisite is disclosed. However, for a 6-parameter search tool with a default mailbox of INBOX and an unqualified account parameter, the absence of any statement about search scope leaves a real gap an agent must guess at.

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 description coverage is 67%; query, limit, offset and response_format are already documented in the schema, and the description adds nothing further about them. The two undocumented parameters, account and mailbox, are not explained in the description either, so the scoping behavior of the tool (does it search one mailbox or all accounts?) stays ambiguous.

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?

States a specific verb and resource (full-text search of email body content) and explicitly delimits scope with 'Searches inside the actual email text, not just subject/sender', which is exactly what separates it from the metadata-oriented mail_search sibling. An agent can pick this tool without opening a schema.

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 explicit when-to-use triggers ('searching for specific content within emails, finding messages mentioning a topic') and names the prerequisite alternative ('Requires the FTS index to be built first (use mail_fts_index)'). It stops short of stating when NOT to use it, e.g. that subject/sender lookups should go to mail_search instead.

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