Skip to main content
Glama

Write Sandbox File

write_sandbox_file

Write files into an isolated sandbox, auto-creating parent directories, to apply candidate fixes without affecting the developer's project.

Instructions

Write a file inside the sandbox, creating parent directories as needed.

USE THIS to apply a candidate fix. Prefer it over shell heredocs: no quoting to get wrong.

SAFETY: writes land in the sandbox copy only. There is no tool here that writes to the developer's project -- if a change is worth keeping, show them the diff from inspect_changes and let them apply it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesWorkspace-relative path.
contentYesFull new contents of the file.
experiment_idYesThe experiment to write in.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it delivers: it discloses that writes are sandbox-only, that no tool writes to the developer's project, and that parent directories are created as needed. This is unusually clear behavioral context for a mutating tool.

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?

The description is tight and well-structured: the action is first, followed by when to use it, then a safety note. Each sentence earns its place with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers purpose, usage context, safety boundaries, and a key behavioral guarantee. Since the schema covers all parameters and an output schema exists, nothing essential is missing for an agent to correctly select and invoke this tool.

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?

The input schema already documents all three parameters with 100% coverage. The description adds very little parameter-specific meaning beyond referencing the sandbox context, so the baseline of 3 is appropriate because the schema does the heavy lifting.

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?

The description states a specific verb and resource: 'Write a file inside the sandbox.' It also adds a distinct behavioral detail, creating parent directories, and frames the tool's purpose as applying a candidate fix, clearly separating it from read_sandbox_file and other siblings.

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

Usage Guidelines5/5

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

The description explicitly says 'USE THIS to apply a candidate fix' and instructs to prefer it over shell heredocs to avoid quoting issues. It also gives a clear when-not-to-use rule: writes only affect the sandbox, so permanent changes should be shown via inspect_changes and applied by the developer.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dhananjay-JSR/sandbox-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server