Skip to main content
Glama

write_file

Create or overwrite UTF-8 text files inside the sandbox using a relative path; absolute paths and '..' are rejected to keep writes confined.

Instructions

Create or overwrite a UTF-8 text file inside the sandbox (e.g. write code). 'path' is relative to the sandbox root; absolute paths and '..' are rejected.

Input Schema

NameRequiredDescriptionDefault
pathYesFile path relative to the sandbox root
contentYesFull new contents of the file

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description does useful work by disclosing the overwrite-destroys-existing-content semantics and the path validation rule that rejects absolute paths and '..'. It leaves other behavioral gaps unaddressed: whether parent directories are created, whether writes are reversible via undo_write, size limits, and what (if anything) is returned.

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 tight sentences with zero filler. The core operation is front-loaded, and the path constraint follows immediately as supporting detail.

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 simple two-parameter write tool with no output schema, the description covers what is written, encoding, and path rules. Missing only secondary details an agent might want: return value, directory auto-creation, and interaction with the undo_write sibling.

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 coverage is 100%, so both parameters are already documented. The description adds meaning beyond the schema by stating the hard constraint that absolute paths and '..' segments are rejected, which is actionable validation info the schema does not carry.

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 pair and resource ('Create or overwrite a UTF-8 text file inside the sandbox') with a concrete example of intended use (write code). It is easy to separate from siblings like read_file, undo_write, and file_history.

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?

'Create or overwrite' plus the sandbox-pathing note gives clear context for when this applies versus reading or listing files. It stops short of explicitly naming alternatives such as undo_write for reverting an overwrite or file_history for inspecting prior versions.

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