Skip to main content
Glama

Write sandbox text file

sandbox_write_file
DestructiveIdempotent

Write up to 64 KiB of UTF-8 text to a sandbox file, replacing existing content with approval; relative paths start at /workspace and no server filesystem is touched.

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. Uses the Lizard API; docs: https://lizard.build/docs/.

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": {
      "sandboxId": "<sandboxId>",
      "path": "<path>",
      "content": "<content>",
      "confirm": "<confirm>"
    },
    "name": "sandbox_write_file"
  }
}

Input 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

A3.7/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=true, and readOnlyHint=false, so the safety profile is covered. The description adds genuinely new context: the 64 KiB ceiling, UTF-8 encoding, mandatory user approval, and the explicit assurance that it does not touch the MCP server's filesystem. The unexplained overwrite-vs-create semantics is the only real gap.

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?

Five short sentences, front-loaded with the action and the size limit, followed by preconditions and a scope disclaimer. The Lizard API/docs pointer is marginal but brief; every other sentence carries operative information.

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 destructive four-parameter write with no output schema, the description covers size limits, encoding, approval, path resolution, and filesystem isolation, which is most of what an agent needs. It stops short of describing error behavior on missing files or whether directories are created.

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 coverage is only 25% (only sandboxId is documented), so the description must compensate. It adds meaning for content (UTF-8, 64 KiB cap) and path (relative paths resolve at /workspace), but says nothing about the required `confirm` flag, leaving one of four parameters explained only by its const:true schema constraint.

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?

States a specific verb and resource (write UTF-8 text to a sandbox) plus the scope constraint of 64 KiB, which clearly separates it from sandbox_read_file and sandbox_list_files. The phrase 'replacing an existing file' is ambiguous about whether it can create new files, which keeps it just short of a 5.

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?

Gives useful preconditions (user approval required, relative paths rooted at /workspace), so an agent knows how to call it. But it never says when to prefer this over sandbox_exec or repo_commit for putting content somewhere, and it does not state what happens if the target file does not exist.

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