Skip to main content
Glama

write_file

Write content to a file, automatically creating parent directories if needed. Optionally append instead of overwrite.

Instructions

Write content to a file. Creates parent directories if needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path (relative to home or absolute)
appendNoIf true, append instead of overwrite (default: false)
contentYesThe content to write

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden and does add one genuinely useful trait: it creates parent directories automatically. However, it omits the most important behavioral fact for a write tool — that it overwrites existing file content by default (destructive), plus any permission/auth or error-return behavior.

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 short, front-loaded sentences with zero filler; the core action comes first and the directory-creation side effect follows. Nothing is wasted.

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

Completeness3/5

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

With no annotations and no output schema, the description should do more to cover behavior around overwriting and the result of the call. What is present is accurate but leaves meaningful gaps for a default-destructive file mutation.

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%, so the schema already documents path, content, and the append-vs-overwrite semantics. The description adds no parameter meaning beyond that, which is the expected baseline when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a clear verb+resource pair ('Write content to a file') that an agent can immediately map to the write_file tool as distinct from read_file/list_files. It does not explicitly name sibling alternatives, but the operation is unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied — the agent can infer you call this when you need to persist content, but there is no guidance on when to prefer it over run_command or how it relates to the read/write siblings. No conditions or exclusions are stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.