Skip to main content
Glama

write_file

Create or overwrite files with specified content using strict path and encoding management. Works within authorized directories to ensure controlled file operations.

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
contentYes
pathYes
Behavior4/5

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

With no annotations provided, the description carries full burden and effectively discloses key behavioral traits: it's a destructive operation (overwrites without warning), has safety constraints (allowed directories only), and handles text encoding. It doesn't cover error cases or permissions, but provides substantial context beyond basic function.

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 core functionality, uses three efficient sentences with zero waste, and each sentence adds critical information (purpose, warning, constraints). It's appropriately sized for a tool with two parameters and no annotations.

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 file operation), lack of annotations, and no output schema, the description is mostly complete: it covers purpose, risks, constraints, and content handling. It could benefit from mentioning error responses or success indicators, but provides sufficient context for safe use.

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 adds some semantic context: 'path' relates to file location (implied by 'allowed directories') and 'content' is text with encoding. However, it doesn't detail path format, content limitations, or encoding specifics, leaving gaps in parameter understanding.

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'), distinguishing it from siblings like edit_file (partial modification) and read_file (read-only). 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 usage ('Use with caution as it will overwrite existing files without warning') and constraints ('Only works within allowed directories'), but does not explicitly name alternatives like edit_file for partial updates or create_directory for directories. This gives good guidance but lacks explicit 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

Related 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/Nexus-Digital-Automations/mcp-filesystem-updated'

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