Skip to main content
Glama

Upload a file to a page

upload_attachment

Uploads a local file to an editable wiki page, then returns a token to paste where the attachment should appear before saving.

Instructions

Upload a local file (absolute path on the machine running this server) to a page you can edit. Returns the token ![name](attachment:<uuid>): paste it where the file should show in the body, then save with update_page. The server decides which file types and sizes it takes and says so when it refuses one.

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": {
      "page_id": "<page_id>",
      "path": "<path>"
    },
    "name": "upload_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute path of a local file (also ~/… or file://).
page_idYesSophia page id (uuid), from get_page_tree, search_pages or recent_pages.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare a non-read-only, non-destructive, closed-world write, and the description adds genuinely new behavior: the return value is a markdown attachment token that only becomes visible after update_page persists it, plus server-side validation of file types and sizes with an explicit refusal message. It leaves unstated whether an uploaded-but-unreferenced attachment is orphaned or cleaned up, which is the main remaining behavioral gap.

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, front-loaded with the core action, then the return-value/next-step workflow, then the validation caveat. Every sentence carries information an agent needs and there is no 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?

With no output schema, the description compensates well by describing the exact token shape returned and the follow-up call required, and it covers failure behavior at a high level. It is nearly complete for a two-parameter tool, missing only edge-case behavior around re-upload/overwrite and orphaned attachments.

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; the description adds meaning beyond the schema by clarifying that 'path' resolves on the server host rather than the client and that 'page_id' must reference an editable page. That permission qualifier is real semantic value not present in the property descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a concrete verb and resource ('Upload a local file ... to a page you can edit') and adds the distinguishing constraint that the path is on the machine running this server, which implicitly separates it from remote/import-style siblings such as import_attachment. It stops short of naming an alternative sibling explicitly, so the differentiation is inferred rather than stated.

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?

It provides clear situational context: the target page must be one the caller can edit, and the returned token must be pasted into the body and saved with update_page, which is a non-obvious follow-up step. It does not state when to prefer this over list_attachments/import_attachment or what to do if the page is not editable, so there are no explicit exclusions.

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