Skip to main content
Glama

Write file

write_file
DestructiveIdempotent

Create or replace a UTF-8 text file on a running cloud sandbox machine, with paths relative to /workspace and parent directories created automatically.

Instructions

Create or replace a UTF-8 text file in a running machine. path is relative to /workspace; parent directories are created.

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": {
      "machine_id": "<machine_id>",
      "path": "<path>",
      "content": "<content>"
    },
    "name": "write_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path relative to /workspace.
contentYesFull new file content.
machine_idYesMachine id (machine_id from create_machine or list_machines).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, so the safety profile is covered; the description's 'replace' wording is consistent with that and clarifies the overwrite is a full-content replacement rather than a merge. It adds real behavioral facts not in the annotations: UTF-8 text only (no binary), paths confined to /workspace, and automatic creation of parent directories. It stops short of saying whether prior content is recoverable or what a write to a non-running machine does.

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 short sentences with zero filler; the operation and encoding are front-loaded and the path/parent-directory caveat follows. Nothing could be removed without losing 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 3-parameter write tool with full schema coverage, rich annotations, and no output schema, the description covers encoding, path root, and directory creation. The remaining gap is what happens when the machine is not running and whether the write is atomic, but nothing essential to calling it correctly is missing.

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 100%, so all three parameters are already documented, including path being relative to /workspace. The description mostly restates that path constraint and only adds one genuinely new detail: parent directories are created. Baseline 3 is appropriate when the schema carries the parameter burden.

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 ('Create or replace a UTF-8 text file') and scopes it to 'a running machine'. The create-or-replace wording also distinguishes it from any append/patch-style writer and makes it the obvious counterpart to read_file. It does not name a sibling explicitly, 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?

Usage is only implied: 'Create or replace' tells the agent this handles both new files and overwrites, which is useful context. There is no explicit when-to-use vs an alternative such as exec (e.g., for binary or shell-driven writes), and no stated preconditions beyond the machine being running.

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