Skip to main content
Glama

Get Attachment

get_attachment
Read-onlyIdempotent

Reads an attachment file from the Obsidian vault and returns its content as binary data. Images and audio are properly formatted; text-based files are rejected to avoid misuse.

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

TableJSON 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).
Behavior5/5

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

Beyond the annotations (readOnlyHint, idempotentHint), the description discloses that images return as `image` blocks, audio as `audio` blocks, others as base64 `resource`, and that attachments must be inside the vault. It also specifies the 5 MB default cap with maxBytes up to 50 MB. 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 sentences, each serving a distinct purpose: purpose, return types and size limit, and exclusions with alternatives. No redundancy, front-loaded with key 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?

Given the tool's binary file reading nature, the description covers return formats, size limits, vault scope, and file type restrictions. With no output schema, the description sufficiently explains what to expect. It also cross-references sibling tools for completeness.

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 description coverage is 100%, so baseline is 3. The description adds context about maxBytes' default (5,242,880 bytes) and hard cap, and explains that path is vault-relative. While it doesn't add much for path, the description of how maxBytes affects the behavior (raising cap) provides marginal added value, justifying a 4.

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 description clearly states the tool reads and returns attachment bytes, specifies the return types (image, audio, resource), and explicitly distinguishes itself from siblings by noting that .md, .canvas, and .base files are rejected and should use get_note, read_canvas, or read_base instead.

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?

The description provides explicit when-to-use and when-not-to-use guidance: for binary attachments, not for text-format files. It mentions the default 5 MB cap and how to raise it via maxBytes, and suggests alternative tools for rejected file types.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rps321321/obsidian-mcp-pro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server