Skip to main content
Glama

write

Create or replace files with content. Supports append, preview, auto-formatting, and showing diff for updates.

Instructions

Create or replace a file. Prefer edit/batch_edit for localized changes.

Overwrites the whole file, or appends with append=true. Reports status created for a new path or updated for an existing one; an update also returns a unified diff against the previous content.

Args: path: File path to create or replace. content: Full content to write, or appended content when append=true. create_parents: Create missing parent directories when needed. dry_run: Preview without writing. auto_format: Run formatter after write. show_diff: Return the diff explicitly even for deterministic writes. append: Append instead of overwrite.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
contentYes
create_parentsNo
dry_runNo
auto_formatNo
show_diffNo
appendNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
truncatedNo
statusNo
pathNo
diffNo
diff_stateNo
diff_omittedNo
createdNo
dry_runNo
tokens_savedNo
bytes_writtenNo
tokens_writtenNo
diff_statsNo
content_hashNo
from_cacheNo
Behavior4/5

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

With no annotations, the description bears full burden. It discloses overwrite semantics, append behavior, status reporting (created/updated), and unified diff return. Lacks details on permissions or irreversible actions but is generally transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with a concise summary and clearly separated argument list. Every sentence adds value, though the Args section is slightly verbose; still efficient for the information density.

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?

Covers all parameters, return status, and diff behavior. With an output schema present, absence of return format detail is acceptable. Lacks mention of error cases or atomicity, but overall sufficient for a file write tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, but the description adds thorough parameter explanations, including the interaction between `content` and `append`, default behaviors, and purpose of each parameter, fully compensating for the schema gap.

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 'Create or replace a file' and explicitly distinguishes from siblings like 'edit' and 'batch_edit' for localized changes, providing specific verb+resource and sibling differentiation.

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

Usage Guidelines5/5

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

Explicitly advises to prefer `edit`/`batch_edit` for localized changes, giving clear when-not guidance. Also describes append mode as an alternative use case, aiding correct selection.

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/CoderDayton/semantic-cache-mcp'

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