Skip to main content
Glama
A1-x-Tech

A1 Gmail MCP

Search and list messages

list_messages
Read-onlyIdempotent

Search Gmail messages using Gmail query syntax and get summaries with id, subject, sender, and date. Filter by labels, exclude spam/trash, and paginate results.

Instructions

Searches the mailbox with Gmail query syntax and returns one summary per message: id, threadId, labelIds, snippet, from, to, subject, date, internalDate. Filter with query (same operators as the Gmail search box: from:, to:, subject:, is:unread, is:starred, has:attachment, label:, newer_than:7d, before:/after:) and/or label_ids (all must match). Spam and trash are excluded unless include_spam_trash=true. Paginate with page_token from nextPageToken; page_size defaults to 25 (max 100 — each summary costs one metadata read, throttled to a few at a time). A message deleted between the search and its metadata read is skipped, so a page can hold slightly fewer summaries than page_size. Set include_metadata=false to get bare ids only (cheapest). resultSizeEstimate is an estimate, not an exact count. Read a full body with get_message; read a whole conversation with get_thread.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoGmail query syntax, e.g. "from:amy@example.com is:unread newer_than:7d has:attachment subject:invoice". Same operators as the Gmail search box.
label_idsNoOnly messages carrying ALL of these label ids (see list_labels).
page_sizeNoMessages per page (1..100, default 25).
page_tokenNonextPageToken from the previous page.
include_metadataNofalse = bare ids only, no per-message metadata reads (default true).
include_spam_trashNoAlso search SPAM and TRASH (default false).
Behavior5/5

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

Annotations cover readOnly/idempotent/non-destructive, and the description adds substantial behavioral context: pagination via nextPageToken, page_size defaults and throttling, skipped deleted messages causing short pages, resultSizeEstimate being an estimate, and metadata-read costs. This goes far beyond what annotations already provide.

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 dense but every sentence earns its place, moving from the core search behavior to return shape, filtering, pagination, edge cases, cost options, and alternatives. It is front-loaded with the most important purpose and keeps the reader oriented.

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?

With no output schema, the description needs to explain return values, and it does: summary fields are listed and the bare-id alternative is described. It also covers filtering, exclusion behavior, pagination, incomplete-page edge cases, and alternative tools, making the definition complete for correct selection and invocation.

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

Parameters5/5

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

Even though schema coverage is 100%, the description adds important meaning: query uses Gmail search-box operators, label_ids must all match, page_size has cost implications per metadata read, page_token comes from nextPageToken, and include_metadata=false switches to bare ids only. These are practical semantics an agent needs to invoke the tool well.

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 states a specific verb and resource: 'Searches the mailbox with Gmail query syntax' and returns per-message summaries. It clearly distinguishes itself from related tools by saying a full body should be read with get_message and a whole conversation with 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 Guidelines5/5

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

The description gives explicit when-to-use guidance: filtering via query/label_ids, excluding spam/trash unless include_spam_trash=true, and the tradeoff between include_metadata=false for cheapest results. It also routes to alternatives for body and thread retrieval, leaving no ambiguity about which sibling to pick.

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

Install Server

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/A1-x-Tech/mcp-google-gmail'

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