Skip to main content
Glama

search_emails

Read-only

Search emails using a portable query syntax with filters for sender, recipient, subject, date, folder, read status, attachment presence, and more.

Instructions

Search one account with typed portable syntax. The query supports text, from:, to:, subject:, in:, read and starred states, attachments, and date filters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toNo
fromNo
readNo
afterNoYYYY-MM-DD received date, inclusive in UTC
queryYesTyped portable search syntax
beforeNoYYYY-MM-DD received date, exclusive in UTC
folderNoFolder role (inbox, sent, drafts, trash, spam, starred, archive, all) or a label/folder name. Use all or omit this field to search all mail except Spam and Trash. An IMAP server's \All mailbox may use different rules.
starredNo
subjectNo
pageSizeNoDefaults to 25
accountIdNoAccount to operate on. Optional when exactly one account is connected.
pageTokenNonextPageToken from a previous call
hasAttachmentNo
rawProviderQueryNoProvider-native Gmail syntax or Outlook KQL for one compatible account
Behavior2/5

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

Annotations already declare readOnlyHint=true, so no contradiction. However, the description adds no behavioral details beyond what annotations provide—e.g., no mention of rate limits, pagination handling, or side effects. With annotations present, the description offers minimal additional value.

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?

Two sentences with front-loaded purpose. It is concise but could be slightly more structured—e.g., bullet-listing filters would improve readability. Every sentence earns its place.

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

Completeness2/5

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

For a tool with 14 parameters, no output schema, and minimal annotations, the description lacks details on pagination (pageSize, pageToken), the exact format of the portable syntax, and folder role semantics. The AI agent would need more context to use this tool effectively.

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 57%, and the description adds context by listing supported filters (e.g., from:, to:, subject:) and introducing 'typed portable syntax.' However, it does not fully compensate for undocumented parameters like 'to' or 'read' fields. The added value is moderate, warranting a baseline score of 3.

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 searches emails within one account using a typed portable syntax, and lists specific filter capabilities (text, from:, to:, subject:, etc.). This distinguishes it from sibling tools like list_emails, which likely does simpler listing.

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 implies usage for complex searches but does not provide explicit guidance on when to use this tool versus alternatives like list_emails. No when-not scenarios are mentioned, though the presence of sibling list_emails suggests a simpler alternative.

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/churichard/fluxmail'

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