Skip to main content
Glama
Akxan
by Akxan

Find emails with attachments

gmail_find_attachments
Read-onlyIdempotent

Search Gmail for messages matching a query and list attachment name, type, and size for a GitHub commit. Optionally disable requireAttachment to find body-only messages.

Instructions

Search the authorized Gmail mailbox (read-only) and list matching messages with their attachments (name, type, size), so a photo or document someone emailed can be committed to GitHub with github_commit_attachment. Gmail search syntax: from:, subject:, newer_than:7d, filename:jpg. By default only messages with an attachment are returned; set requireAttachment=false to find a message whose text is in the body itself and read it with gmail_get_message. Only a ~200-character snippet is shown here.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxNoMost messages to return.
queryNoGmail search query, e.g. 'from:alba newer_than:14d'.newer_than:30d
requireAttachmentNoKeep the implicit 'has:attachment' filter. false searches every message, including ones whose content is in the email body (read it with gmail_get_message).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.10.0
    • addedInput schema / properties / max / description
      Added value: +"Most messages to return."
    • addedInput schema / properties / requireAttachment
      Added value: +{
      +  "default": true,
      +  "description": "Keep the implicit 'has:attachment' filter. false searches every message, including ones whose content is in the email body (read it with gmail_get_message).",
      +  "type": "boolean"
      +}
  2. Addedv0.8.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the read-only safety profile is covered. The description adds valuable behavioral context beyond annotations: default only messages with attachments are returned, requireAttachment=false changes the implicit 'has:attachment' filter, and only a ~200-character snippet is shown — a real limitation an agent needs to know.

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?

Two compact sentences pack purpose, usage context, search syntax, default behavior, and a key output limitation without redundancy. Every clause earns its place and the most decision-relevant information is front-loaded.

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?

For a 3-parameter tool with no output schema, the description covers purpose, selection criteria, parameter behavior, and an output limitation (snippet length). It doesn't describe the full return payload structure, but the description already enumerates the key attachment fields, so an agent has enough to invoke it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3. The description goes further by explaining the purpose of requireAttachment (finding body-text messages to read via gmail_get_message) and giving concrete query examples like 'from:alba newer_than:14d', adding meaning beyond the schema's brief parameter descriptions.

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?

Description names a specific verb, resource, and outcome: search the authorized Gmail mailbox and list matching messages with attachment details (name, type, size). It also frames the practical purpose — committing an emailed photo/document to GitHub — and distinguishes itself from gmail_get_message, a sibling that reads a single message's body.

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?

Provides explicit usage context: when you need an attachment for a GitHub commit, use this tool; when the content is in the email body instead, set requireAttachment=false and read it with gmail_get_message. It even includes Gmail search syntax examples, leaving no ambiguity about when this tool is the right choice.

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