Skip to main content
Glama

Add wiki attachment

add_wiki_attachment
Destructive

Attach a file to a wiki page, identified by 'pageId' or by 'spaceKey' + 'title': pass its bytes as 'contentBase64', or its content as 'text' when the file is text. Re-attaching a filename the page already has replaces its bytes and bumps its version, as the wiki does everywhere else, so retrying this call cannot leave two copies. A file on the person's own disk — a screenshot, a PDF — is better attached by path through the pm-files MCP server than typed out as base64; local_files_setup says how to connect it. An attached file is not on the page until the body references it — the answer hands you the Markdown to add with update_wiki_page. An image may also carry a dark-theme version, attached as the same name with '-dark' before the extension (diagram.svg + diagram-dark.svg); the body still references the plain name. Requires permission to edit the page.

Input Schema

NameRequiredDescriptionDefault
textNoThe file's content as text, stored as UTF-8 — for a log, CSV or Markdown file you are writing here. Alternative to 'contentBase64'; passing both is refused.
titleNoExact page title, when identifying the page by title.
pageIdNoPage id (as returned by search_wiki).
commentNoShort note about this upload, shown in the page's attachment list.
filenameYesFile name to store, e.g. 'diagram.png'. Any directory part is dropped.
mimeTypeNoContent type to record for the listing, e.g. 'text/csv'. Ignored when the bytes identify themselves, and never used to serve the file.
spaceKeyNoSpace key, when identifying the page by title.
contentBase64NoThe file's bytes, base64-encoded (a 'data:…;base64,…' URL is accepted and unwrapped). Use 'text' instead when the file is text.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and readOnlyHint=false; the description earns its keep by explaining exactly what that destruction means — re-attaching the same filename replaces the bytes and bumps the version, so retries are idempotent and cannot produce duplicate copies. It also discloses the permission requirement to edit the page and the dark-theme variant naming convention, none of which appear in the 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?

Information-dense and front-loaded: identifying scheme, content modes, then idempotency, then routing advice, then the follow-up step. It is longer than most descriptions, but nearly every sentence carries a constraint the agent could not infer, so only minor tightening is possible.

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 an 8-parameter mutation tool with no output schema, the description covers the addressing semantics, the return value ('the answer hands you the Markdown'), the permission prerequisite, and the follow-up call required to make the attachment appear in the page body. Nothing an agent needs in order to invoke it 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 already 100%, so the baseline is 3. The description still adds meaning the schema doesn't: the valid page-identification combinations, the 'contentBase64' vs 'text' exclusivity, and the '-dark' before-extension convention for dark-theme image variants. That extra is modest because the schema already documents each parameter individually.

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+resource (attach a file to a wiki page) and immediately gives the two addressing modes ('pageId' or 'spaceKey' + 'title') and the two content modes (bytes vs 'text'). This is clearly distinguishable from the sibling add_attachment (non-wiki) and from delete_wiki_attachment/get_wiki_attachment.

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 the agent: use the pm-files MCP server by path instead for local files like screenshots or PDFs (pointing to local_files_setup), and use 'text' rather than base64 for text files. It also names the follow-up step, telling the agent the attachment is not visible on the page until update_wiki_page adds the returned Markdown reference.

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.

Resources