Skip to main content
Glama

Get Attachment

get_attachment
Read-onlyIdempotent

Read a vault-relative attachment and return its bytes, rendering images/audio inline and other files as base64 resources. Rejects notes, canvases, and Bases; set maxBytes to raise the 5 MB default.

Instructions

Read an attachment file and return its bytes to the client. Images come back as image content blocks (rendered inline by Claude / Cursor), audio as audio blocks, everything else as a base64 resource block with a vault:// URI. Caps at 5 MB by default to keep token usage sane; raise via maxBytes up to 50 MB. The attachment must be inside the vault — markdown notes (.md), canvases (.canvas), and Bases (.base) are deliberately rejected so callers don't accidentally pull text-format files through this binary path; use get_note / read_canvas / read_base instead.

Input Schema

NameRequiredDescriptionDefault
pathYesVault-relative path to the attachment, e.g. 'assets/diagram.png'.
maxBytesNoMaximum file size to fetch in bytes (default: 5,242,880, hard cap: 52,428,800).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.1.1
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Addedv2.0.0
  3. Removedv1.9.0
  4. Addedv1.8.0

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations by disclosing the return shape per media type (image blocks, audio blocks, base64 resource with vault:// URI), the 5 MB default and 50 MB hard ceiling, and the vault-containment restriction. These are exactly the traits that determine token cost and whether a call will fail.

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?

Four dense sentences, front-loaded with the return behavior, then limits, then constraints, then sibling routing. No sentence is filler; each carries either behavioral or routing information.

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?

With no output schema, the description fully carries the burden of describing return values by content type, plus size limits and path restrictions. Nothing an agent needs to call this correctly is missing.

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, but the description adds rationale the schema lacks: maxBytes exists to keep token usage sane and can be raised to 50 MB, and path must resolve inside the vault. It stops short of any path-format examples, though the schema supplies one.

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?

States a specific verb and resource ('Read an attachment file and return its bytes') and immediately distinguishes itself from the text-format siblings get_note / read_canvas / read_base. An agent can identify the tool and its domain 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 Guidelines5/5

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

Explicitly routes callers: text-format files (.md, .canvas, .base) are rejected here and must go through get_note / read_canvas / read_base instead. It also gives the condition for raising the size cap via maxBytes, so both the when-to-use and when-not-to-use cases are covered.

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