Skip to main content
Glama

Upload a file

upload_asset

Uploads a file to a Wiki.js asset folder for page embedding. Accepts base64 content; rejects SVG/HTML/XML to prevent script execution.

Instructions

Uploads an image or file to an asset folder, so it can be embedded in a page. Content is passed base64-encoded and the content type is derived from the extension. SVG, HTML and XML are refused: Wiki.js serves assets from the wiki’s own origin, so those can carry script that runs for every reader. Note that Wiki.js 2.x has no GraphQL mutation for uploads at all — this uses the editor’s own route, which is undocumented and could change in a future Wiki.js release.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesFile name including its extension, e.g. "diagram.png".
folder_idNoTarget folder id. 0 (default) is the root.
content_base64YesFile contents, base64-encoded.
Behavior5/5

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

Annotations only specify idempotentHint=false, so the description carries the full behavioral burden. It reveals non-obvious restrictions (SVG/HTML/XML refused) with a security rationale, and it discloses that the underlying Wiki.js route is undocumented and may change in future releases. This goes well beyond what the schema or annotations reveal.

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?

Each sentence earns its place: the first defines the operation, the second explains encoding and type derivation, the third documents the refusal rules and rationale, and the fourth warns about the fragile route. No filler or redundancy.

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 mutation tool with minimal annotations and no output schema, the description covers encoding, content-type behavior, security-based refusals, and the unstable route. It omits an explicit statement about return values or error behavior, but the information needed to invoke the tool correctly is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all three parameters are already documented. The description adds the useful fact that the content type is derived from the extension and that content is base64-encoded, but it does not substantially expand on the schema definitions. Baseline 3 applies.

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?

The description clearly states a specific action ('Uploads'), a specific resource ('an image or file to an asset folder'), and its purpose ('so it can be embedded in a page'). It differentiates this from sibling asset tools like list_assets, rename_asset, and delete_asset by describing a creation workflow.

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?

The description gives practical usage context: content is base64-encoded, the content type is derived from the extension, and SVG/HTML/XML are explicitly refused. It also warns that the route is undocumented and may change. It does not explicitly name alternatives, but there is no competing upload tool among the siblings.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ni-c/wikijs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server