Skip to main content
Glama

runtime_sandboxes_files_write

DestructiveIdempotent

Create or replace a file in a sandbox, atomically, making parent directories. content is text unless encoding is base64. Up to 1 MiB; for bigger files use the SDK or npx withruntime sandboxes cp.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
pathYesAbsolute path in the sandbox, e.g. /workspace/app/main.py. Any path the sandbox user may use.
contentYes
encodingNotext

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.1/5.0
Behavior5/5

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

Annotations declare destructiveHint=true and idempotentHint=true, and the description reinforces this with "create or replace" and adds value beyond them: the write is atomic, parent directories are created automatically, content is interpreted as text unless encoding is base64, and there is a hard 1 MiB size ceiling. Atomicity, implicit directory creation, and the size cap are all behavioral facts an agent cannot get from the annotations.

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?

Two sentences, zero padding. The core action and its atomic/replace semantics come first, the encoding rule and size limit follow, and the escalation path for large files closes it out. Everything earns its place.

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 4-parameter mutation tool with no output schema and a sparse schema, the description covers the important behavior (atomicity, overwrite semantics, directory creation, size limit, encoding). It does not mention permission/auth requirements or what a successful call returns, but the absence of an output schema means return-value detail is not required.

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 description coverage is only 25% (only `path` is documented in the schema). The description compensates for the undocumented `encoding` parameter by stating "content is text unless encoding is base64," which is genuinely useful. However, it says nothing about `id` (presumably the sandbox UUID) or about path constraints beyond what the schema already states, so the low coverage is only partially offset.

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?

The description states a specific verb+resource pair: "Create or replace a file in a sandbox," which tells an agent exactly what the tool does and implicitly separates it from the read/list/watch siblings. It does not explicitly name or contrast with any sibling (e.g. files_manage, files_read), so it stops short of full routing clarity.

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?

It gives an explicit fallback condition and alternative: files over 1 MiB should use the SDK or `npx withruntime sandboxes cp`. That is a clear when-to-use-something-else rule. It offers no guidance on when to prefer this over runtime_sandboxes_files_manage or other file siblings.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.