Skip to main content
Glama

search_messages

Read-onlyIdempotent

Search Gmail messages using native search syntax like from:, subject:, is:unread, and boolean operators. Returns full plain-text bodies, not snippets, to find emails fast.

Instructions

Search messages using Gmail's own search syntax.

query accepts exactly what you'd type into the Gmail search box: from:, to:, subject:, after:YYYY/MM/DD, before:YYYY/MM/DD, has:attachment, is:unread, is:starred, label:name, and boolean operators (OR, -exclude, quoted "exact phrases"). Leave query empty to list recent mail instead. Each result includes the extracted plain-text body, not just a snippet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNo
label_idsNo
page_tokenNo
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent and non-destructive, so the safety profile is covered. The description adds genuinely non-obvious behavior: results include the extracted plain-text body rather than just a snippet, which shapes how the agent should treat the output.

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 purpose and the query-syntax contract are front-loaded, and every clause adds usable information (syntax examples, empty-query fallback, body extraction) with no filler.

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?

An output schema exists, so return values need no explanation, and the safety profile is annotation-covered. The one gap is pagination semantics for page_token, which the description never addresses for a result-capped search.

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 0%, so the description must carry parameter meaning, and it documents only `query` (with extensive syntax help). label_ids, page_token and max_results remain undocumented in both places, so the coverage gap is only partly compensated.

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 (messages) and immediately scopes it to Gmail's own query syntax, which distinguishes it from the ID-based siblings get_message and get_thread.

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?

Gives clear context for the main input, including the fallback behavior ('Leave query empty to list recent mail instead'), which tells the agent how to enumerate rather than search. It does not name siblings or state when to prefer get_message/get_thread, so it stops short of full routing guidance.

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