Skip to main content
Glama

write_file

Destructive

Replaces document text with operational-transform edits that retain unchanged regions. Requires a recent document ID and version to reject stale writes and verify applied content.

Instructions

Replace text using OT edits that retain unchanged regions. Requires docId/version from a recent read. Rejects stale versions; waits for server application and verifies document identity and content. An unknown write outcome blocks further writes to that document on the connection; reconnect and inspect before retrying. Concurrent edits may be merged by Overleaf.

Input Schema

NameRequiredDescriptionDefault
pathYes
contentYes
projectIdYes
expectedDocIdYes
expectedVersionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare destructive/non-idempotent/open-world, and the description adds real context beyond them: server-side verification of document identity and content, stale-version rejection, concurrent edits possibly merged by Overleaf, and the crucial recovery rule that an unknown write outcome blocks further writes on that connection until reconnect and inspection. This is exactly the failure-mode disclosure a write tool needs.

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?

Front-loaded with the operation, then prerequisites, then failure behavior, then concurrency caveat; five tight sentences with no filler. Every clause carries operational content.

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?

For a destructive, non-idempotent write with no output schema, the description covers preconditions, verification, and the blocked-connection recovery path, so an agent can call it safely. The remaining gap is what exactly `content` and `path` mean for a document that already exists.

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 0%, so the description must carry the parameter meaning and it only partly does. It explains `expectedDocId`/`expectedVersion` indirectly ('docId/version from a recent read') but says nothing about `projectId`, `path`, or what `content` represents (full body versus replacement text), leaving the most consequential field ambiguous.

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?

States a specific verb and resource ('Replace text using OT edits') plus the mechanism (operational-transform edits preserving unchanged regions), which is far more than a restatement of the name. It does not draw the boundary against the sibling tool `replace_text`, so an agent cannot tell from the description alone which of the two to use.

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?

Gives a clear precondition ('Requires docId/version from a recent read') and a failure rule ('Rejects stale versions'), which tells the agent when this call will succeed. It never names the alternative siblings (`replace_text`, `create_file`, `upload_file`) or says when file content should be written versus patched.

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