Skip to main content
Glama

write

Create or replace files with intelligent caching that suppresses unchanged content, returning only diffs for modified files. Supports append and dry-run previews.

Instructions

Create or replace a file, with cache refresh and optional overwrite diffs.

Use this when you already know the full new file content. For targeted changes inside an existing file, prefer edit or batch_edit.

Routing rules:

  • New file or full replacement: use write.

  • Small localized change: use edit.

  • Multiple localized changes in one file: use batch_edit.

Behavior:

  • Deterministic successful overwrites omit full diffs by default.

  • Set show_diff=true or use debug mode to include the diff explicitly.

  • New files return creation status.

  • append=true supports chunked construction for large files.

  • dry_run=true previews without writing.

  • auto_format=true is best used near the end of an edit cycle.

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?

No annotations provided, so description carries full burden. It describes behavior like deterministic overwrites omitting diffs, new files returning creation status, append mode, dry run, and auto_format. Lacks explicit mention of return format but covers key behaviors.

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?

Highly structured: opening purpose, usage guidance, routing rules, behavior notes, then parameter descriptions. No filler; every sentence adds value.

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?

Given output schema exists, description needn't detail returns. It covers purpose, usage, behavior, parameters, and distinguishes from siblings. Complete for the tool's complexity.

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 description explains each parameter's meaning and usage, e.g., content is full content or appended content, auto_format best near end of edit cycle. Adds significant value over bare 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 clearly states the tool creates or replaces a file, with cache refresh and optional diffs. It distinguishes from siblings like edit and batch_edit by specifying when to use each.

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 provides when-to-use (full new content) and when-not-to-use (targeted changes) with alternatives listed. Includes routing rules and parameter guidance.

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