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 a Gmail account using standard query operators to retrieve matching messages. Returns IDs and Gmail links, with pagination for large result sets.

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.28.0
    • removedInput schema / properties / page_token / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / page_token / type
      Added value: +"string"
  2. Changed1 schema field changedv1.24.0
    • addedInput schema / properties / include_headers
      Added value: +{
      +  "default": false,
      +  "description": "If True, also fetch each message's metadata and include\nSubject, From, and Date per result. Costs one metadata get per result,\ngrouped into HTTP batches of up to 10, plus retries for transient failures.\nDefaults to False (output unchanged from prior versions).",
      +  "type": "boolean"
      +}
  3. Changed12 schema fields changedv1.0.1
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / page_size / description
      Added value: +"The maximum number of messages to return. Defaults to 10."
    • removedInput schema / properties / page_size / title
      Removed value: -"Page Size"
    • addedInput schema / properties / page_token
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Token for retrieving the next page of results. Use the next_page_token from a previous response."
      +}
    • addedInput schema / properties / query / description
      Added value: +"The search query. Supports standard Gmail search operators."
    • removedInput schema / properties / query / title
      Removed value: -"Query"
    • removedInput schema / properties / service
      Removed value: -{
      -  "title": "service",
      -  "type": "string"
      -}
    • addedInput schema / properties / user_google_email / description
      Added value: +"The user's Google email address. Required."
    • removedInput schema / properties / user_google_email / title
      Removed value: -"User Google Email"
    • changedInput schema / required
      Previous value: -[
      -  "service",
      -  "query",
      -  "user_google_email"
      -]New value: +[
      +  "query",
      +  "user_google_email"
      +]
    • removedInput schema / title
      Removed value: -"search_gmail_messagesArguments"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "result": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "type": "object",
      +  "x-fastmcp-wrap-result": true
      +}
  4. First observedv1.0.0

TDQS

A3.5/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so the safety profile is covered. The description adds useful behavioral context by stating that results include both Message IDs and Thread IDs plus web interface links, and that pagination is supported via page_token. There is no contradiction with annotations.

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?

Three short, front-loaded sentences cover the action, the returned identifiers/links, and pagination. There is no filler, and every sentence earns its place.

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

Completeness3/5

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

With an output schema, strong annotations, and 100% schema parameter coverage, most invocation details are present. However, the description omits any differentiation from related search/retrieval siblings and does not signal that fetching full message content is a separate tool's job, leaving a moderate selection gap.

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%, and the schema already documents query, page_size, page_token, include_headers, and user_google_email in detail. The description only restates pagination at a high level and adds no semantic detail beyond what the schema already provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Searches') and identifies the resource ('messages in a user's Gmail account'). It also clarifies the high-level output (Message IDs, Thread IDs, web links), but it does not explicitly distinguish this tool from similarly named siblings like search_messages or get_messages.

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

Usage Guidelines2/5

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

No when-to-use guidance is provided; the description names no alternatives and gives no conditions for choosing this tool over sibling search or retrieval tools. The closest it comes is mentioning pagination and web links, which are features, not usage criteria.

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

Deploy Server

Other Tools