Skip to main content
Glama
taylorwilsdon

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

Search Gmail Messages

search_gmail_messages
Read-onlyIdempotent

Search Gmail messages by query to retrieve matching message and thread IDs with web links. Use standard operators, pagination, and optional headers for metadata, solving email discovery needs.

Instructions

Searches messages in a user's Gmail account based on a query. Returns both Message IDs and Thread IDs for each found message, along with Gmail web interface links for manual verification. Supports pagination via page_token parameter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesThe search query. Supports standard Gmail search operators.
page_sizeNoThe maximum number of messages to return. Defaults to 10.
page_tokenNoToken for retrieving the next page of results. Use the next_page_token from a previous response.
include_headersNoIf True, also fetch each message's metadata and include Subject, From, and Date per result. Costs one metadata get per result, grouped into HTTP batches of up to 10, plus retries for transient failures. Defaults to False (output unchanged from prior versions).
user_google_emailYesThe user's Google email address. Required.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

Annotations already mark the operation read-only and idempotent. The description adds meaningful behavioral details: the return of both Message IDs and Thread IDs, Gmail web links for manual verification, and pagination support. It does not disclose potential rate limits or the additional cost of fetching headers, but the schema covers the include_headers behavior.

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 sentences, front-loaded with the primary action, and contains no redundant information. Every sentence earns its place: purpose, return value, and pagination feature.

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 the presence of an output schema and full schema parameter descriptions, the description provides sufficient context for a search tool. It covers the main purpose, return values, and pagination. It does not mention include_headers, but that parameter's behavior is fully described in the schema.

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 100%, so parameters are fully documented in the schema. The description mentions query and page_token but adds no new semantics beyond what the schema already provides, such as Gmail search operator support or pagination token usage.

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 clearly states the tool searches a user's Gmail messages based on a query, returns Message IDs and Thread IDs, and provides web links for verification. It uses specific verbs and resources, distinguishing it from sibling tools that fetch content or manage labels.

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

Usage Guidelines3/5

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

The description clarifies the search context and mentions pagination but does not explicitly contrast with sibling tools like get_gmail_message_content or search_drive_files. No when-not-to-use scenarios or alternative recommendations are provided.

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/taylorwilsdon/google_workspace_mcp'

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