Skip to main content
Glama

gmail_search

Read-onlyIdempotent

Search Gmail with native operators like from:, is:unread, has:attachment. Returns headers and snippets; empty query lists recent mail. Use message or thread tools for full content.

Instructions

Search the mailbox using Gmail's own query syntax.

Takes the same operators as the Gmail search box: from:, to:, subject:, has:attachment, is:unread, label:, after:, before:, newer_than:7d. An empty query lists the most recent mail.

Returns headers and a snippet per message, not bodies. Follow with gmail_get_message for one, or gmail_get_thread for the conversation.

Args: query: Gmail search expression, e.g. "is:unread from:client.com". limit: Maximum messages to return, up to 100. include_spam: Include spam and trash, which are excluded by default.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
queryNo
include_spamNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Annotations already declare readOnly/openWorld/idempotent/non-destructive. The description adds meaningful behavioral details beyond those hints: return format (headers and snippet only), default spam/trash exclusion, max limit of 100, and empty-query behavior. No contradiction with annotations.

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?

Every sentence adds value: intro, operator list, return behavior, follow-up guidance, and a compact Args section. The most important scoping and return information is front-loaded, and no space is wasted on restating titles or obvious types.

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?

Given the output schema exists, the description does not need to explain return types in detail. It covers query syntax, defaults, scope exclusions, limits, and onward routing. An agent has everything needed to select and call this tool correctly.

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

Parameters5/5

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

Schema coverage is 0%, so the description must compensate, and it does thoroughly. Each parameter is explained with a concrete example for query, a maximum bound for limit, and the behavioral effect of include_spam. This far exceeds what the bare schema provides.

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 ('search') and resource ('mailbox') with Gmail's query syntax. Clearly differentiates itself by noting it returns headers/snippets, not bodies, and points to sibling tools for retrieval. An agent can tell this apart from gmail_get_message and gmail_get_thread immediately.

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?

Describes the query operators and the empty-query fallback, giving concrete context for when to call it. It names follow-up tools for message/thread retrieval, but does not explicitly list exclusions for sibling search/list alternatives. The usage context is clear, though not exhaustive.

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/rollecode/gmail-second-account-mcp'

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