Skip to main content
Glama

Write File

write_file
DestructiveIdempotent

Create or replace files with specified content in permitted directories, handling text encoding automatically. Use carefully as existing files are overwritten without warning.

Instructions

Create a new file or completely overwrite an existing file with new content. Use with caution as it will overwrite existing files without warning. Handles text content with proper encoding. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
contentYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
Behavior4/5

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

Annotations already indicate destructiveHint=true and readOnlyHint=false, but the description adds valuable context beyond this: it warns about overwriting without warning, specifies it handles text content with proper encoding, and mentions it only works within allowed directories. This enhances transparency without contradicting 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?

The description is front-loaded with the core purpose and caution, followed by additional details in a logical flow. Every sentence earns its place by adding critical information (overwriting behavior, encoding, directory restrictions) without redundancy, making it highly efficient and well-structured.

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?

Given the tool's complexity (destructive write operation), annotations cover safety aspects, and an output schema exists (so return values need not be explained). The description adds necessary context like overwriting behavior and directory restrictions, but could benefit from more on error handling or success conditions to be fully complete.

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?

The input schema has 0% description coverage, but the description does not add specific meaning to the 'path' and 'content' parameters beyond implying 'path' is for file location and 'content' is text. It mentions allowed directories for 'path' and text encoding for 'content', which provides some compensation, but lacks details like format constraints or examples.

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 clearly states the tool's purpose with specific verbs ('create' and 'overwrite') and resource ('file'), and distinguishes it from siblings like 'edit_file' by emphasizing complete overwriting rather than partial modification. It explicitly mentions handling text content with encoding, which further clarifies its scope.

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 provides clear context for when to use this tool ('create a new file or completely overwrite an existing file') and includes a caution about overwriting without warning. However, it does not explicitly name alternatives (e.g., 'edit_file' for partial updates) or specify when not to use it beyond the caution, missing full sibling differentiation.

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/agentward-ai/agentward'

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