Upload a file into the game
upload_fileUploads 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
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Ref of a file input from inspect_ui (alternative to selector). | |
| path | Yes | Absolute path of the file on the machine running this MCP server. | |
| format | No | Output format: "text" (default, human-readable) or "json" (JSON string for programmatic use). | |
| game_id | Yes | Session id returned by open_game. | |
| selector | No | CSS selector of an <input type=file> (used when no trigger is given). | |
| trigger_ref | No | Ref of the trigger button (alternative to trigger_text). | |
| trigger_text | No | Visible text of the button that opens the file picker. | |
| trigger_selector | No | CSS selector of the trigger button (e.g. "#saves-import"). |