Skip to main content
Glama

Upload a file

upload_file
Destructive

Upload files into Foundry VTT user data, creating target directories as needed and returning a usable document path. Existing files with the same name are overwritten.

Instructions

Uploads a file from this server into Foundry's user data (images, audio, video, PDF, JSON, text), creating the directory if needed. Returns the path to use in documents. A file of the same name is overwritten.

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": {
      "localPath": "<localPath>",
      "dir": "<dir>"
    },
    "name": "upload_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
dirYesDirectory under Data, e.g. "assets/scenes/maps/session4"
nameNoFile name in Foundry; defaults to the local name
localPathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already flag destructiveHint=true and openWorldHint=false, and the description earns credit by explaining exactly what makes it destructive: 'A file of the same name is overwritten.' It further discloses side effects (directory auto-creation) and the return value, which annotations cannot convey. It stops short of noting size limits, permissions, or whether the overwrite is recoverable.

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 short sentences, front-loaded with the action and scope, followed by return value and the overwrite hazard. Every sentence carries distinct information and nothing is repeated from the schema or annotations.

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 three-parameter mutation tool with no output schema, the description covers the action, side effects, return value, and the destructive overwrite case, which is most of what an agent needs. The remaining gap is the semantics of localPath, the one parameter documented in neither the schema nor the description.

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 coverage is 67%, with localPath carrying no schema description at all. The description adds real meaning for two parameters — dir implies parents are created, and name is linked to the overwrite rule — but it never clarifies whether localPath is absolute, relative to the server, or restricted to certain locations, leaving the undocumented parameter unexplained in both places.

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?

States a specific verb and resource ('Uploads a file from this server into Foundry's user data') and enumerates supported media types, so the operation is unambiguous. It does not explicitly contrast itself with siblings such as browse_files or run_script, but the action is distinct enough that an agent can pick it without further reading.

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?

Usage is only implied: the phrase 'Returns the path to use in documents' hints at a follow-up workflow, and auto-creating the directory implies it should be preferred over a manual mkdir step. There is no explicit statement of when to use this versus listing/browsing existing files or any exclusion for large or unsupported uploads.

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