Skip to main content
Glama

Upload a file

upload_asset

Upload an image or file to a Wiki.js asset folder as base64 so it can be embedded in pages. Blocks SVG, HTML, and 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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
truncatedNoPresent only when the answer was shortened to fit the budget.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • changedInput schema / properties / folder_id / anyOf
      Previous value: -[
      -  {
      -    "description": "Numeric Wiki.js id.",
      -    "maximum": 9007199254740991,
      -    "minimum": 1,
      -    "type": "integer"
      -  },
      -  {
      -    "const": 0,
      -    "type": "number"
      -  }
      -]New value: +[
      +  {
      +    "description": "Numeric Wiki.js id.",
      +    "maximum": 2147483647,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  {
      +    "const": 0,
      +    "type": "number"
      +  }
      +]
  2. Changed2 schema fields changedv0.2.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": true,
      +  "properties": {
      +    "truncated": {
      +      "additionalProperties": true,
      +      "description": "Present only when the answer was shortened to fit the budget.",
      +      "properties": {},
      +      "type": "object"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observedv0.1.2

TDQS

A4.4/5.0
Behavior5/5

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

The description discloses important behavioral traits beyond the annotations: content type is derived from the extension, SVG/HTML/XML are refused for security reasons, and the uploads rely on an undocumented editor route that could change in future releases. This is genuinely useful risk and behavior information.

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 description is compact and front-loaded with the primary purpose, followed by input format, security restrictions, and a stability caveat. It is slightly redundant by restating base64 encoding already present in the schema, but every section still earns its place overall.

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?

With an output schema present and 100% parameter schema coverage, the description supplies the remaining essential context: intended usage, required input form, which file types are rejected and why, and the reliability caveat. An agent has enough information to call the tool correctly.

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?

The schema already fully documents all three parameters, so the baseline is 3. The description adds meaningful semantics by explaining base64 transport, extension-derived content type detection, and the refusal of dangerous file types, which helps an agent understand constraints on filename and content_base64.

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 uses a specific verb ('Uploads') with a clear resource ('image or file to an asset folder') and states the intended purpose: embedding the asset in a page. It also distinguishes this tool from siblings like list_assets, delete_asset, and create_asset_folder, which cover different operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides a clear use case and notes that Wiki.js 2.x has no GraphQL upload mutation, which helps explain why this tool exists. However, it does not explicitly name an alternative or say when not to use this tool, leaving some selection guidance to inference.

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