Skip to main content
Glama

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

NameRequiredDescriptionDefault
nameYes
contentYes
encodingNotext
instanceNo
overwriteNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.1

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does well: it discloses write-scope restrictions (nothing outside files/<N>/), the 10 MB cap, base64 validation, overwrite refusal, and that the instance need not be running. It adds real behavioral context but the flat numeric score is held down by how verbose the disclosure is per unit of distinct behavior.

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?

Front-loads the core purpose in the first sentence, then groups parameter rules and finally failure modes and return shape. Every clause carries operational information, though the run-on failure-condition sentence is dense and could be tightened.

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?

Complete for a mutation tool despite zero annotation coverage: scope limits, size limits, encoding modes, overwrite semantics, and failure modes are all present, and an output schema exists so the inline return summary is a bonus rather than a necessity. Only the instance-targeting semantics leave a small gap.

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 0%, so the description must compensate, and it largely does: name is defined as a relative path with parent folders auto-created and absolute paths/'..' refused; content is text-UTF-8 or binary with encoding='base64'; overwrite's false default triggers a fail-without-write; instance need not be running. The instance parameter's selection semantics (which instance is targeted) and the encoding enum values beyond 'base64' are only lightly covered.

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+resource (write a file into the instance's staging folder files/<N>/) and pins down the exact purpose: handing the sandbox a file without shell access, with concrete examples (CSV, SVG, text). It also distinguishes itself from siblings by naming open_file, upload_file and app Open dialogs as the consumers of what it writes.

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 clear context for when to reach for it (no shell access, need to stage a file before import/upload) and a sequencing hint ('stage files first, launch after' — the instance need not be running). It does not explicitly state when to prefer this over upload_file, leaving the boundary between the two to inference.

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