Skip to main content
Glama
kojott

mailmcp

Search messages

search_messages
Read-onlyIdempotent

Find emails across accounts using filters for sender, subject, date, folder, unread/flagged status, and attachments. Returns newest-first results with UID and folder for follow-up actions.

Instructions

Searches one account (or all accounts with account="all"). On Gmail, query accepts full Gmail search syntax (from:, newer_than:7d, has:attachment, label:, "exact phrase"). Elsewhere query is full-text and the structured filters do the rest. Returns newest first with uid + folder needed by other tools.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNo
fromNo
limitNoDefault 20, max 50
queryNoGmail search syntax on Gmail; plain text elsewhere
sinceNoISO date, e.g. 2026-09-01
beforeNoISO date
folderNoFolder/label path. Defaults to All Mail on Gmail, INBOX elsewhere.
offsetNo
unseenNoOnly unread
accountYesAccount id, or "all" to search every readable account
flaggedNoOnly starred/flagged
subjectNo
has_attachmentNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false. The description adds valuable behavioral context: it states results are returned newest first and that the response includes uid and folder needed by other tools. It also explains the Gmail vs non-Gmail query behavior. These details go beyond the annotation-only information, so the description earns a 4.

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?

The description is three concise sentences with no filler. It leads with the primary purpose, then adds the critical Gmail syntax nuance, and ends with return ordering and required fields. Every sentence earns its place and is front-loaded for quick comprehension.

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?

For a search tool with 13 parameters but only one required, the description covers the essential behavioral aspects: account scope, query syntax, return ordering, and the uid+folder requirement. It does not explain pagination details (offset/limit) or when to use this over sibling 'search', but the schema covers pagination constraints and the overall usage is clear. Given the tool's complexity, the description is reasonably complete.

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 62%, and the description clarifies the key parameters 'account' (with the special 'all' value) and 'query' (Gmail syntax vs full-text). It also refers to 'structured filters' implying the other fields act as filters. However, it does not add meaning to parameters like offset, limit, since, before, etc., which rely on the schema descriptions. The description adds moderate value beyond the schema but does not fully compensate for the 38% uncovered.

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?

The description opens with a specific verb and resource: 'Searches one account (or all accounts with account="all")'. It clearly distinguishes itself from generic search by specifying account scope, and differentiates Gmail query syntax from elsewhere. This makes the tool's purpose unambiguous and distinct from siblings like 'search'.

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

Usage Guidelines3/5

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

The description explains when to use account="all" and contrasts Gmail query syntax with plain-text elsewhere, giving context on usage. However, it does not explicitly mention when to prefer this tool over sibling tools like 'search', 'fetch', or 'get_message', nor does it state any exclusions. Usage guidance is present but not comprehensive.

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