Skip to main content
Glama

write_file

Destructive

Creates a UTF-8 text file at a specified workspace path, replacing existing content only when overwrite is enabled. Ideal for new files; use update_file for modifying existing files.

Instructions

Create a UTF-8 text file, or replace one when "overwrite" is true. Prefer edit_file or update_file for changes to an existing file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath relative to the workspace root, or an allowed absolute path.
contentYesComplete UTF-8 file content.
overwriteNoAllow replacing an existing file; defaults to false.
expected_sha256NoOptional SHA-256 returned by a previous read or write. The call fails if the file changed since then.
Behavior4/5

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

Annotations already declare destructiveHint=true, but the description adds meaningful behavior beyond that: it specifies UTF-8 encoding, create-or-replace semantics, and the condition under which replacement occurs. This is useful context not present in the annotations, though it does not elaborate on failure modes or the optimistic concurrency check beyond what the schema provides.

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 tightly written sentences with no filler. The primary purpose is stated first, the conditional behavior second, and the sibling guidance last. Every sentence earns its place.

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?

The description covers the core semantics and guides tool selection, while annotations cover the safety profile and the schema covers all parameters. Minor gaps remain, such as failure behavior and the concurrency guarantee of expected_sha256, but these are adequately represented in structured fields and are not critical for an agent to invoke the 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?

Schema description coverage is 100%, and the schema already documents each parameter including the default of 'overwrite' and the purpose of 'expected_sha256'. The description adds no significant parameter-level detail beyond echoing 'overwrite' and 'content', so the baseline of 3 is appropriate.

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?

Description uses a specific verb ('Create') with a concrete resource ('UTF-8 text file') and clearly states the replace behavior conditional on 'overwrite'. It also distinguishes itself from siblings by directing changes to existing files toward edit_file or update_file. An agent can unambiguously understand this tool's role.

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 'Prefer edit_file or update_file for changes to an existing file', giving clear guidance on when not to use this tool and naming the alternatives. This directly helps an agent choose the right sibling tool without additional inference.

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/JonusNattapong/ChatGPTMCP'

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