put_file
Writes a file into a sandbox instance's staging folder so apps can open, upload, or import it by name without shell access. Supports text or base64 content, creates parent folders, and guards against path escapes.
Instructions
Write a file into the instance's staging folder files// — the way to hand the sandbox a file you produced (a CSV to import, an SVG to open, a text to upload) without shell access. Then open_file(name) / upload_file(name) / an app's Open dialog can use it by that name.
name is a relative path inside the staging folder ('data.csv', 'in/logo.svg'; parent
folders are created); absolute paths and '..' are refused — nothing outside files// can be
written. content is text (written as UTF-8) or, with encoding='base64', binary data.
Returns {"ok", "instance", "path", "name", "bytes", "overwritten"}. Fails (isError), writing
nothing, if the file exists and overwrite is false, the name escapes the folder or names a
directory, the base64 is invalid, or the content exceeds 10 MB. The instance does not have
to be running (stage files first, launch after).
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": {
"name": "<name>",
"content": "<content>"
},
"name": "put_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| content | Yes | ||
| encoding | No | text | |
| instance | No | ||
| overwrite | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |