Skip to main content
Glama

Search Gmail messages

search_gmail_messages

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

TableJSON 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.4/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden. It usefully discloses the return shape (metadata fields), explicitly states that full bodies are NOT returned, and implicitly signals a non-mutating search operation. It does not mention rate limits, authorization requirements, or pagination, but those are minor for a read-oriented search tool that already provides query examples.

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?

The description is three compact sentences with no filler. It front-loads purpose and output constraints, then gives usage guidance and examples. Every sentence earns its place, and the examples are high-value rather than decorative.

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

Completeness4/5

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

Given four fully-documented parameters and no output schema, the description compensates well by listing the returned metadata fields and excluding full bodies. It covers the core what, when, and how with examples. It could be slightly more complete by noting result ordering or pagination behavior, but nothing critical is missing for an agent to invoke it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3; the description earns a 4 by adding meaningful query-syntax examples ('subject:invoice is:unread') that go beyond the schema's generic 'Gmail search query, same syntax as the Gmail search box.' Other parameters like limit, mailbox, and labelIds are already fully documented in the schema, so no additional parameter explanation is needed.

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 opens with a specific verb and resource: 'Search a mailbox using Gmail's own query syntax' and precisely scopes the output to 'message metadata (id, subject, sender, date, snippet, labels) — not full bodies.' It also differentiates from siblings by naming get_gmail_message for reading a message and apply_gmail_labels for filing, so an agent can distinguish this search tool from adjacent Gmail tools.

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 provides explicit context and a workflow: 'Use this to find messages, then get_gmail_message to read one, or apply_gmail_labels to file them.' Query examples like 'from:acme.com' and 'has:attachment newer_than:7d' clarify when the tool fits. It stops short of stating explicit exclusions, such as when to prefer list_messages over this search tool, so it gets a 4 rather than a 5.

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