Skip to main content
Glama

Write File

write
Destructive

Create or replace workspace text files atomically, preserving metadata and returning a unified diff. Provide a SHA-256 from read to update shared files safely without conflicting with other sessions.

Instructions

Create or overwrite a meaningful text file inside the workspace. New files use an atomic rename; existing files retain their inode and metadata. Returns a unified diff; pass the SHA from read when overwriting shared files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path relative to workspace root.
contentYesComplete file contents to write.
overwriteNoAllow overwriting existing files. Default: true.
create_dirsNoCreate parent directories if missing. Default: true.
workspace_idNoWorkspace id from open_workspace. Omit to use the workspace selected for this MCP session.
expected_sha256NoOptional SHA-256 from read. Fails instead of overwriting if another session changed the file.
Behavior5/5

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

Annotations already indicate destructive and non-readonly behavior, and the description adds valuable behaviorl detail beyond that: atomic rename for new files, inode and metadata retention for existing files, unified diff return, and sha256 concurrency checking. These details help an agent predict side effects accurately, with no contradiction to annotations.

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?

Three sentences, each earning its place: purpose, filesystem behavior, and return/concurrency guidance. The purpose is front-loaded, and there is no redundent exposition or filler.

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 write tool with full schema coverage and ruct annotations, the description captures purpose, filesystem behavior, return value, and concurrency handling. It does not mention failure modes (e.g., overwrite=false on an existing file) or encoding constraints, but those can be inferred from the schema and are not critical for correct invocation.

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?

The schema already documents all 6 parameters at 100% coverage, so the baseline is 3. The description adds meaning by specifying how expected_sha256 should be used ('pass the SHA from read') and mentions the unified diff return. This is useful but does not deeply redefine the schema-provided semantics for each parameter.

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 opens with a clear verb and resource: 'Create or overwrite a meaningful text file inside the workspace.' This unambiguous scope distinguishes it from read (reading) and edit/apply_patch (modifying existing content). The term 'meaningful' is slightly subjective but does not obscure the core purpose.

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?

The description states its primary use case (create or overwrite a text file) and offers concurrency guidance for shared files ('pass the SHA from read when overwriting shared files'). It does not explicitly contrast with alternatives such as edit or apply_patch, and does not say when not to use write, so it falls short of a full 5.

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

Install Server

Other Tools

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/kaiserproger/agent-loom'

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