Skip to main content
Glama
gmail-mcp

gmail-mcp

search_and_save

Search Gmail and save matching emails directly to a file in one call, avoiding inline output and MCP output limits.

Instructions

One-shot search + save: search Gmail and write results directly to a file.

Combines list_emails + read_emails_full into a single tool call.
No data is returned inline — just a compact summary + file path.

Required:
  query (str) — Gmail search syntax
    (e.g. "from:PiraeusBank after:2026/03/01 has:attachment").

Optional:
  max_results (int, default=100) — max emails to fetch.
  save_path (str) — local file path. If empty, auto-generates one in
    the configured gmail-mcp directory under emails/.  Overwrite is rejected — use a fresh
    path or let the tool auto-generate.
  format (str, default="md") — "md", "json", "jsonl", or "csv".

Returns on success:
  {"ok": true, "data": {
    "saved": true,
    "path": "C:\Users\...\emails\2026-05-11-piraeus-47.md",
    "count": 47,
    "format": "md",
    "total_size_bytes": 184523,
    "query": "from:PiraeusBank after:2026/03/01",
    "search_summary": "47 emails matched your search query"
  }}

Workflow note: Use this when you want to search Gmail and immediately
  persist results to a file without worrying about MCP output limits.

Input Schema

NameRequiredDescriptionDefault
queryYes
formatNomd
save_pathNo
max_resultsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so well: it discloses that nothing is returned inline, only a compact summary plus path, that overwrite is rejected, and that save_path auto-generates under emails/ when empty. It also spells out the success payload shape, which an agent needs to parse the result.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The action summary is front-loaded and the Required/Optional/Returns layout is easy to scan. The inline JSON return example and the workflow note add some length, but each serves a purpose given there is no output schema; a small amount of vertical bloat is the only cost.

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?

For a four-parameter tool with no annotations and no output schema, the description covers the action, every parameter, a failure mode (overwrite rejection), and the return payload. An agent has everything needed to call it and interpret the response correctly.

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?

Schema description coverage is 0%, so the description must document all four parameters, and it does: query with Gmail search syntax and a concrete example, max_results with default, save_path with default and auto-generation plus the overwrite-rejection behavior, and format with its allowed values md/json/jsonl/csv. This is meaningfully more than the bare titles in the schema.

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 first line states a specific compound action (search Gmail + write results to a file) and explicitly positions it as a combination of two named siblings, list_emails and read_emails_full. An agent can tell exactly what this does and how it differs from the separate read 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 workflow note gives a clear selection condition: use it when you want to persist search results without hitting MCP output limits, which implicitly routes large-result cases here instead of list_emails/read_emails_full. It stops short of an explicit 'do not use when...' exclusion, so it falls just below a 5.

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