Skip to main content
Glama

Upload a file into the game

upload_file

Uploads a local mod, save, or image file into a Twine game's file input, optionally triggering a picker button, and returns the updated observation.

Instructions

Upload a local file (mod .zip, exported .save, image) into an in the game. Provide trigger_text/trigger_ref for buttons that open a picker ("Load from File…", "Import"), or let it target the file input directly. If a hardcoded selector like #saves-import does not exist in the build, use find_ui("Load from File") and pass its ref as trigger_ref. Returns the new observation (text; format:"json" for JSON).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoRef of a file input from inspect_ui (alternative to selector).
pathYesAbsolute path of the file on the machine running this MCP server.
formatNoOutput format: "text" (default, human-readable) or "json" (JSON string for programmatic use).
game_idYesSession id returned by open_game.
selectorNoCSS selector of an <input type=file> (used when no trigger is given).
trigger_refNoRef of the trigger button (alternative to trigger_text).
trigger_textNoVisible text of the button that opens the file picker.
trigger_selectorNoCSS selector of the trigger button (e.g. "#saves-import").

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.3

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the return value ('Returns the new observation; format:"json" for JSON'), which is genuinely useful, but says nothing about permissions, what happens to existing game state on upload, failure behavior when no ref/selector/trigger resolves, or whether the upload triggers navigation.

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?

Three sentences, no filler, and the core action is front-loaded in the first clause. The middle sentence is dense with three alternate targeting modes, but each clause carries information an agent needs.

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 an 8-parameter tool with no annotations and no output schema, the description covers the primary flow, the parameter interplay, the fallback path, and the return format. Remaining gaps are error/failure handling and side effects on game state, which are secondary but not negligible.

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, but the description goes beyond the schema by explaining the relationship among the four targeting parameters (trigger_* for picker-opening buttons vs selector/ref for the input itself) and the ordered fallback strategy. That is real added meaning over the flat per-parameter descriptions.

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 and resource ('Upload a local file ... into an <input type=file> in the game') and enumerates the file kinds involved (mod .zip, exported .save, image). This clearly separates it from the sibling download_file, the inverse operation, without needing to open either schema.

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?

Gives concrete routing between the trigger parameters and the direct-target path ('Provide trigger_text/trigger_ref for buttons that open a picker ... or let it target the file input directly'), plus an explicit fallback when a hardcoded selector is missing ('use find_ui("Load from File") and pass its ref as trigger_ref'). It does not, however, state when this tool should be preferred over other siblings like interact or click_ui for the same UI.

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