Skip to main content
Glama

Attach a file to a document

add_attachment

Attaches one file to a document already on HTMLRadar, for readers of its links to download. The file types are the website's (PDF, Office documents, images, CSV, text, Markdown, ZIP) and a document holds up to 20 files. The file travels as base64 in content_base64, because a tool argument is JSON, so it can be at most 5.0 MB, the same limit as publishing a page this way; a larger file (the website takes 25 MB) is added on the website. Readers see the file from the next time they load the page. There is no file-path argument.

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": {
      "document_id": "<document_id>",
      "filename": "<filename>",
      "content_base64": "<content_base64>"
    },
    "name": "add_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
filenameYesThe file name with its extension, e.g. "pricing.pdf". The extension decides the type.
document_idYesThe document: the document id from list_documents or list_shares.
content_base64YesThe file's contents, base64-encoded.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare the mutation profile (readOnlyHint false, idempotentHint false, openWorldHint true); the description goes well beyond them with the accepted file types, the 20-files-per-document cap, the 5.0 MB base64 ceiling versus the 25 MB site limit, and the fact that readers see the file only after the next page load. These are exactly the constraints an agent needs to avoid a failed call.

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?

The purpose and the size constraint are front-loaded, and each sentence carries distinct information. Some phrasing is denser than needed ("because a tool argument is JSON"), but nothing 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 write tool with no output schema, the description covers limits, accepted types, per-document capacity, and when changes become visible. The only notable gap is what the call returns (e.g. an attachment id) and whether duplicates or name collisions are rejected.

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 meaning the schema lacks: why content_base64 is base64 (JSON argument), its 5.0 MB maximum, and that the filename extension determines the file type. It also explicitly rules out a file-path argument, preventing a common wrong-parameter guess.

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 ("Attaches one file to a document already on HTMLRadar") plus the purpose ("for readers of its links to download"). The scoping detail "one file" and "no file-path argument" separates it cleanly from siblings like remove_attachment, list_attachments, and replace_document.

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?

Gives a concrete exclusion path: files over 5.0 MB must be uploaded on the website rather than through this tool, which is real when-not guidance. It does not mention sibling tools (e.g. list_attachments to check the 20-file cap, remove_attachment to free a slot), so routing guidance is clear but not exhaustive.

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.