Skip to main content
Glama

get_attachment_content

Read-onlyIdempotent

Reads an attachment's actual content, not just metadata, returning viewable images or text inline and flagging oversized or unsupported files. Use it to inspect attachments without downloads.

Instructions

Read an attachment's actual content, not just its metadata.

Returns a JSON block describing the outcome, followed by the content itself as a native block when it can be inlined:

  • PNG/JPEG/GIF/WebP come back as an image the model can see

  • text-like content (text/*, JSON, XML) comes back as text, cut at the byte limit if it is long (outcome "text", truncated=true)

  • an image over the byte limit is refused whole rather than returned partially (outcome "too_large")

  • anything else returns metadata only (outcome "not_inline_supported"); no bytes, since no MCP client could display them; content_type there is the attachment's stored type, which names the file where the served header only says "not inlineable"

max_bytes may only LOWER the server's configured limit (OPENPROJECT_ATTACHMENT_CONTENT_MAX_BYTES, 5 MB by default), never raise it.

size_bytes is the size of the returned content block, and is null if file_size_bytes is hidden by server configuration, rather than leaking it indirectly under another name.

Nothing is written to disk. Use get_attachment for metadata alone.

Input Schema

NameRequiredDescriptionDefault
max_bytesNo
attachment_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.4

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, and the description adds substantive context beyond them: outcome values (text, too_large, not_inline_supported), the byte-limit refusal behavior, truncation flag, and the assurance that nothing is written to disk. This is a rich behavioral disclosure that a caller could not infer from annotations.

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 core purpose, then well-organized bullets mapping each outcome. Most content earns its place, though the aside about content_type naming the file where the served header says 'not inlineable' is fairly deep detail that could be trimmed without losing caller-critical 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?

No output schema exists, so explaining the return block shape, outcome enumerations, truncation, and refusal semantics is essential — and all are covered. A caller has everything needed to invoke it and interpret results 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 coverage is 0%, so the description must compensate, and it does: max_bytes is explained as a downward-only cap tied to the server-configured OPENPROJECT_ATTACHMENT_CONTENT_MAX_BYTES (5 MB default) with the rule that it never raises the limit. attachment_id is self-evident from the resource context. This meaningfully exceeds what the bare schema conveys.

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 (read) and resource (attachment content) with the crucial qualifier 'not just its metadata,' which separates it from the sibling get_attachment at a glance. An agent can distinguish the two without inspecting schemas.

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 metadata-only requests to get_attachment and explains the content-retrieval path in detail (inlined image vs text vs refused vs metadata-only). The alternatives and conditions are named, not implied.

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

Deploy Server

Other Tools