Skip to main content
Glama

Search Gmail messages

search_gmail_messages
Read-only

Search a mailbox using Gmail's own query syntax and return message metadata (id, subject, sender, date, snippet, labels) — not full bodies. Use this to find messages, then get_gmail_message to read one, or apply_gmail_labels to file them. Query examples: 'from:acme.com', 'has:attachment newer_than:7d', 'subject:invoice is:unread'.

Input Schema

NameRequiredDescriptionDefault
limitNoMax results (default 20, cap 100)
queryNoGmail search query, same syntax as the Gmail search box
mailboxYesEmail address of the connected Gmail/Google Workspace mailbox to act on. Call list_authorized_mailboxes to see available options.
labelIdsNoRestrict to these label IDs

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so safety is covered. The description adds genuinely useful behavior beyond that: what is returned (id, subject, sender, date, snippet, labels) and explicitly that full bodies are excluded, which prevents the agent from expecting body content. It doesn't mention pagination or result ordering, so not a full 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?

Front-loaded with the core action and return shape, then routing, then examples. Every sentence earns its place and nothing is wasted.

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 4-param search tool with a fully described schema and annotations, the description covers purpose, return shape, exclusions, and next-step routing. No output schema exists, so the description's return-value summary is exactly what's needed.

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 coverage is 100%, so all four parameters are already documented in the schema, including the query syntax and the limit default/cap. The description reinforces the query syntax with examples but adds little beyond the schema. Baseline 3 is appropriate.

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 (a mailbox) and scopes the output precisely: Gmail query syntax returning message metadata, not full bodies. This clearly distinguishes it from get_gmail_message and the other mail search tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: use this to find messages, then get_gmail_message to read one, or apply_gmail_labels to file them. That is an explicit when-to-use plus named alternatives, backed by concrete query examples.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources