Skip to main content
Glama

fetch_attachments

Destructive

Download the files attached to one already-fetched mail and file them as documents. Required: email_id. Optional: entity + entity_id to say what they belong to (a mail already matched to an asbestos job attaches to that job by itself), include_inline (default false — signature images and template logos stay out), max_bytes. Running it twice does not store anything twice. Returns what was stored, what was skipped and why. The mailbox is only read: nothing is marked as seen and nothing is deleted.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "email_id": "<email_id>"
    },
    "name": "fetch_attachments"
  }
}

Input Schema

NameRequiredDescriptionDefault
entityNoRecord type the attachments belong to (use with entity_id)
email_idYesID of the email
entity_idNoID of the record
max_bytesNoMaximum size in bytes for attachments to store
include_inlineNoAlso include inline

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / email_id / description
      Added value: +"ID of the email"
    • addedInput schema / properties / entity / description
      Added value: +"Record type the attachments belong to (use with entity_id)"
    • addedInput schema / properties / entity_id / description
      Added value: +"ID of the record"
    • addedInput schema / properties / include_inline / description
      Added value: +"Also include inline"
    • addedInput schema / properties / max_bytes / description
      Added value: +"Maximum size in bytes for attachments to store"
  2. First observed

TDQS

A3.9/5.0
Behavior2/5

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

Useful disclosure is present: inline images default out, the mailbox is only read (nothing marked seen or deleted), and the call reports what was stored versus skipped. However, 'Running it twice does not store anything twice' reads as an idempotency promise while the annotations declare idempotentHint=false, so an agent may wrongly assume retries are free of additional effect. The destructiveHint=true and openWorldHint=true traits are also left unaddressed (what exactly is written/overwritten, and any external fetch implications).

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?

Front-loaded with the action and the required key, and almost every sentence carries information an agent needs. It is slightly dense with parenthetical asides, which costs a little readability, but no sentence is filler.

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 five-parameter write tool with no output schema, the description covers preconditions, defaults, side effects, dedupe behavior, and the shape of the return (stored / skipped / why). Gaps remain around permissions or limits and the exact effect of max_bytes when an attachment exceeds it, but the essentials are there.

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, and the description genuinely adds meaning: include_inline is explained by its concrete exclusions (signature images, template logos), entity/entity_id are explained by the auto-attach behavior when a mail is already matched, and max_bytes frames skipping. That is real semantic value beyond the terse schema strings.

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 sentence names a specific verb and resource ('Download the files attached to... and file them as documents') and pins the scope to 'one already-fetched mail,' which cleanly separates it from the mailbox-fetching siblings such as fetch_inbox. An agent knows exactly what it produces (documents) without opening the schema.

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?

It states the prerequisite ('one already-fetched mail') and the required key (email_id), and explains the conditional case where entity/entity_id can be omitted because a matched mail auto-attaches to its job. What is missing is any explicit when-not-to-use guidance or a named alternative for pulling raw mail content.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.