Skip to main content
Glama

gmail search messages

gmail_search_messages
Read-onlyIdempotent

Search Gmail messages using Gmail search syntax and return matching message IDs with headers and snippets, so you can locate emails and retrieve full bodies separately.

Instructions

Search Gmail with Gmail search syntax (for example 'from:alice newer_than:7d').

Returns message ids with From, To, Subject, Date, and snippet when include_headers is true. Use gmail_get_message for the body.

Input Schema

NameRequiredDescriptionDefault
queryNo
page_tokenNo
max_resultsNo
include_headersNo
include_spam_trashNo

Output Schema

NameRequiredDescriptionDefault

No arguments

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 readOnly, idempotent, openWorld and non-destructive, so the safety profile is covered. The description adds genuinely new behavioral context: results are id-only with a fixed header set, header/snippet inclusion is controlled by include_headers, and bodies are out of scope. It omits pagination behavior implied by page_token, which keeps it below a 5.

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?

Two short sentences with no filler; the search-syntax hint and the sibling pointer are front-loaded and each sentence carries distinct information.

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

Completeness3/5

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

Output schema exists, so return values need not be explained, and the core search/read behavior is clear. However, with five undocumented parameters, the missing note on pagination and excluding or including spam/trash leaves an agent likely to misuse max_results and page_token.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must carry parameter meaning and it only partly does: it illustrates the query syntax and explains include_headers. page_token, max_results, and include_spam_trash are never mentioned, leaving half the surface undocumented.

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 and resource ('Search Gmail') plus the exact query dialect and an example. It also distinguishes itself from gmail_get_message by noting that only ids and headers come back and that bodies require the other tool.

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?

Explicitly routes the agent to gmail_get_message when message bodies are needed, which is the main fork in this workflow. It doesn't address gmail_get_thread or say when a broad listing versus a targeted query is preferred, so it stops short of exhaustive when/when-not guidance.

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