Skip to main content
Glama

Write File

file_write
Destructive

Write, append, or create files with text or base64 content, enforcing allowed paths and creating parent directories automatically.

Instructions

Write, append to, or create a text/base64-encoded file. Destructive — requires confirm: true when MACCTL_CONFIRM_DESTRUCTIVE is enabled (the default), for every mode (this framework gates confirmation per-tool rather than per-call, so 'create'/'append' are covered by the same gate as an overwrite). Path is checked against MACCTL_ALLOWED_PATHS/MACCTL_DENIED_PATHS. Parent directories are created as needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNo'write' overwrites (or creates), 'append' adds to the end (creates if missing), 'create' fails if the file already exists. Defaults to 'write'.
pathYes
confirmNoMust be true to execute this destructive action.
contentYesText content, or base64 if encoding is 'base64'.
encodingNoDefaults to utf8.
Behavior5/5

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

Annotations already flag destructiveHint=true, but the description adds substantial context: the confirm:true requirement is gated per-tool for all modes (not just overwrite), path verification against allowed/denied lists, and implicit parent directory creation. This goes well beyond the annotation flags and helps the agent understand safety and side effects.

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, front-loaded with the core purpose. Each sentence provides distinct information (modes, confirmation requirement, path restrictions/auto-creation) with no repetition of schema details. Highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no output schema, the description covers the tool's behavior comprehensively: operation modes, confirmation requirement, path validation, and directory creation. For a write operation, this is sufficient context for an agent to invoke it correctly. No critical behavioral aspects appear to be missing.

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 mode, confirm, content, and encoding with good descriptions (80% coverage). The description adds value by clarifying path behavior (path checked against access lists, parent dirs created), which fills the gap for the undocumented path parameter. It also confirms encoding types align with the schema.

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 'Write, append to, or create a text/base64-encoded file,' a specific verb+resource+scope that immediately distinguishes this tool from read-oriented siblings like file_read and file_list. All three modes are enumerated, making the tool's purpose unmistakable.

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 clearly explains when to use each mode ('write' overwrites, 'append' adds, 'create' fails if exists), giving practical guidance for mode selection. It also mentions parent directory auto-creation, which helps users know prerequisites. However, it does not explicitly contrast against alternative tools (e.g., 'use file_read for reading'), though sibling names make this obvious.

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/sitharaj88/macctl'

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