Skip to main content
Glama

write_file

Write or overwrite a file at the given path with specified content; any required parent directories are created automatically.

Instructions

Write (or overwrite) a file with the given content. Parent directories are created automatically. Always write the COMPLETE file content, this replaces the entire file.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
file_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations, the description carries full burden. It discloses that the tool overwrites the entire file and auto-creates parent directories. While it lacks details on permissions, encoding, or error handling, it provides essential behavioral traits for safe invocation.

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 consists of three concise sentences with no fluff. The first sentence states the purpose, the second adds a key feature (auto-create directories), and the third reinforces the overwrite behavior.

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 tool has an output schema, so return values are likely covered there. The description covers core behavior but missing details like maximum file size, binary support, or error conditions. For a simple file write tool, this is largely adequate.

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?

Since schema description coverage is 0%, the description must compensate. It adds minimal extra meaning beyond the schema: it emphasizes that content is the complete file content. No details on file path format, encoding, or allowed content types are given.

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 that the tool writes or overwrites a file with given content, using the verb 'write' and resource 'a file'. It explicitly mentions that this replaces the entire file, distinguishing it from sibling tools like patch_file or read_file.

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 notes that parent directories are created automatically, indicating safe usage when directories may not exist. However, it does not explicitly specify when not to use it or provide alternative tools. The emphasis on 'replaces the entire file' hints at differentiation from partial modification tools.

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/ahmad-zurih/ds-mcp-server'

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