Skip to main content
Glama

Write sandbox text file

sandbox_write_file
DestructiveIdempotent

Write or replace a UTF-8 text file up to 64 KiB in a specified sandbox after user approval; does not touch the MCP server filesystem.

Instructions

Write up to 64 KiB of UTF-8 text to a sandbox, replacing an existing file. Requires the user's approval. Relative paths start at /workspace. Does not write to the MCP server's filesystem.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
confirmYes
contentYes
sandboxIdYesExact sandbox ID from sandbox_create or sandbox_list

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.1.2

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare a destructive, idempotent, non-read-only operation, and the description adds genuinely new context: the 64 KiB cap, UTF-8 encoding, an approval requirement (an auth/policy need not in the annotations), replace semantics, and path resolution. This is exactly the kind of operational disclosure that complements structured hints.

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?

Four tight sentences with the core action front-loaded and no filler; each subsequent sentence adds a distinct constraint (approval, path base, filesystem scope). Nothing is redundant.

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 mutation tool with annotations covering the safety profile and no output schema, the description is nearly complete: size limits, approval, path semantics, and target filesystem are all covered. It leaves one ambiguity – whether the file is created if it does not already exist – which slightly undercuts full completeness.

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 description coverage is only 25% (sandboxId only), so the description must compensate, and it does for most params: '/' workspace base for path, 64 KiB/UTF-8 constraints for content, and the approval requirement tied to confirm. Only confirm is not explicitly mapped by name, keeping this just below the top score.

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 (Write), resource (UTF-8 text file in a sandbox) and scope (up to 64 KiB), and clearly distinguishes itself from siblings like sandbox_read_file and sandbox_exec. The added note that it does not write to the MCP server's filesystem further disambiguates the target.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through notes that it replaces an existing file and requires user approval, which helps decide when to invoke it. However, no alternatives or when-not-to-use conditions are named, so an agent must infer the routing instead of being told.

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