Skip to main content
Glama

Search Gmail Messages

search_gmail_messages
Read-onlyIdempotent

Search a Gmail account using standard query operators. Returns matching message and thread IDs with Gmail links, and supports pagination for large result sets.

Instructions

Searches messages in a user's Gmail account based on a query. Returns both Message IDs and Thread IDs for each found message, along with Gmail web interface links for manual verification. Supports pagination via page_token parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query. Supports standard Gmail search operators.
page_sizeNoThe maximum number of messages to return. Defaults to 10.
page_tokenNoToken for retrieving the next page of results. Use the next_page_token from a previous response.
include_headersNoIf True, also fetch each message's metadata and include Subject, From, and Date per result. Costs one metadata get per result, grouped into HTTP batches of up to 10, plus retries for transient failures. Defaults to False (output unchanged from prior versions).
user_google_emailYesThe user's Google email address. Required.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Install Server

TDQS

A4.3/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, openWorldHint, idempotentHint, and non-destructive behavior, so the description only needs to add value beyond that. It does so by explaining the return payload (IDs, thread IDs, web links) and pagination via page_token, which are useful behavioral details not carried by 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?

Three sentences cover the core behavior, return values, and pagination with no filler or repetition. The most important information is front-loaded, and every sentence contributes to an agent's ability to select and invoke the tool.

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?

For a read-only search tool with a fully described schema and an output schema, the description is complete: it states what is searched, what is returned, and that pagination is supported. Parameter details and return structure are already covered by the schema and annotations, so nothing essential is missing.

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 100%, so the baseline is 3; the schema already documents query, page_size, page_token, include_headers, and user_google_email. The description only restates pagination support and does not materially add parameter meaning beyond the schema.

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 uses a specific verb ('Searches') and resource ('messages in a user's Gmail account') and clearly states what is returned: Message IDs, Thread IDs, and Gmail web links. This distinguishes it from content-retrieval siblings like get_gmail_message_content and get_gmail_thread_content, since the focus is on search results and identifiers, not message bodies.

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 makes the tool's context clear: use it to find Gmail messages by query and get identifiers and verification links, with pagination support. It does not explicitly name alternatives or state when not to use it, but the search-versus-content-retrieval distinction is strongly implied by the result contents.

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

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/WorldCentralKitchen/google_workspace_mcp'

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