Skip to main content
Glama

Upload Attachment

upload_attachment

Attaches a base64-encoded file up to 10 MB to a Docmost page and can insert it into the body at a selected heading or text location.

Instructions

Upload a file to a page, given as base64, up to 10 MB. Base64 costs about a million tokens per megabyte, so prefer create_upload_link: tell the person that a link is much cheaper, and use this only for small files or when they choose it. By default the file is also added to the page, at the end or where after_heading or after_text say: images are shown, other files appear as a download block. Adding it saves a snapshot of the body first.

Input Schema

NameRequiredDescriptionDefault
pageYesPage id, slug id or Docmost page URL.
file_nameYesFile name with extension.
mime_typeNoType of the file; only used when the file name has no known extension. Pages and scripts (HTML, JavaScript, XML) are stored as downloads.
after_textNoPut the files right after the paragraph or block containing this text.
add_to_pageNoAlso show the file in the page body; false only attaches it.
after_headingNoPut the files at the end of the section under this heading (its text).
content_base64YesThe file, base64.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / mime_type / description
      Previous value: -"Guessed from the file name when left out."New value: +"Type of the file; only used when the file name has no known extension. Pages and scripts (HTML, JavaScript, XML) are stored as downloads."
  2. First observedv1.2.0

TDQS

A4.7/5.0
Behavior4/5

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

Annotations declare this is a non-destructive write with no open-world access, but the description adds context annotations cannot: adding to the page 'saves a snapshot of the body first,' the default is add_to_page=true, and images render inline while other files become download blocks. The token-cost warning (~a million tokens per MB) is a real operational constraint. It does not cover auth requirements or error behavior, so not a 5.

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?

Front-loaded with the verb, format and limit, then the cost/routing warning, then default behavior. Every clause carries routing or behavioral information; nothing is padding.

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?

For a 7-parameter mutation tool with an output schema already covering returns, the description supplies the size ceiling, the cost tradeoff, the default placement behavior, and the snapshot side effect. An agent has everything needed to decide whether to call it and how.

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 the interaction the schema cannot express: the default add-to-page behavior and how placement falls back 'at the end or where after_heading or after_text say,' plus that mime_type only matters when the extension is unknown is echoed at the behavioral level.

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 ('Upload a file to a page') plus the transport format and hard limit ('given as base64, up to 10 MB'). It also names the sibling it is not (create_upload_link), so an agent can separate the two without opening either 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?

Gives an explicit routing rule: prefer create_upload_link, tell the person a link is much cheaper, and use this tool 'only for small files or when they choose it.' Both the preferred alternative and the exception condition are stated.

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