Skip to main content
Glama
MarcinWalendowski

AnyMail MCP

Search messages

search_messages
Read-only

Search Gmail accounts using native Gmail query syntax (e.g., from:alice, newer_than:7d, has:attachment) and return message summaries with IDs.

Instructions

Search a Gmail account with native Gmail query syntax (e.g. 'from:alice newer_than:7d has:attachment', 'in:anywhere subject:invoice'). Returns summaries with gmMsgId/gmThrId. Note: All Mail excludes Trash/Spam unless you add 'in:anywhere'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
labelNoRestrict to a specific label/mailbox path instead of All Mail.
limitNoMax results (default 25, newest first).
queryYesGmail search query (X-GM-RAW syntax).
accountNoGmail address to act on. Omit to use the default account.
Behavior4/5

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

Beyond the annotations (readOnlyHint: true), the description adds key behavioral details: use of native Gmail syntax, return of summaries with specific IDs, default ordering (newest first), and the fact that Trash/Spam are excluded unless 'in:anywhere' is added. This provides valuable context for an agent.

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 concise (3 sentences), front-loading the purpose, followed by examples and a critical note. Every sentence serves a clear purpose with no redundancy.

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?

Given the absence of an output schema, the description adequately explains the return format (summaries with gmMsgId/gmThrId) and critical behaviors like scope and ordering. It does not detail pagination or error cases, but those are secondary for this straightforward search tool.

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 description coverage is 100%, so baseline is 3. The tool description adds value with explicit query examples and contextual notes, enhancing understanding of the 'query' and 'limit' parameters beyond the schema definitions.

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 clearly states the tool's purpose: searching a Gmail account using native Gmail query syntax. It provides concrete examples and distinguishes from sibling tools like get_message or get_thread by emphasizing the search functionality.

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?

The description explains the query syntax and includes a useful note about the scope of 'All Mail' versus 'in:anywhere'. It implies when to use this tool (for searching) but does not explicitly contrast with alternatives like get_message or list_accounts.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/MarcinWalendowski/anymail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server