Skip to main content
Glama

Write Document

write_document
Idempotent

Replace document text while preserving Scrivener formatting. Reports if formatting is fully preserved or takes a snapshot when non-round-trippable content would be dropped.

Instructions

Replace a document's text with new content, preserving the surrounding Scrivener formatting the edit did not touch (stylesheet, styles, images, footnotes) byte-for-byte. The result reports whether formatting was fully preserved; when an edit would drop non-round-trippable content it takes a Scrivener snapshot first (restorable in Scrivener) and says so. To change only the title or metadata use update_document; to add a new document use create_document. Requires an open project and a valid document id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoWrite even if the project appears open in Scrivener. Default false, which refuses the write to protect against your changes being overwritten by Scrivener on save.
contentYesDocument body as plain text. May be empty.
documentIdYesScrivener document UUID, as returned by get_structure (a binder item "id").
Behavior4/5

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

The description discloses important behaviors beyond annotations: it reports formatting preservation, takes a Scrivener snapshot when dropping non-round-trippable content, and explains the force parameter's default refusal. Annotations already provide idempotentHint=true and destructiveHint=false, so the description adds value without contradiction.

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?

The description is concise and front-loaded: it states the purpose first, then covers behavior, alternatives, and prerequisites in a clear, well-structured paragraph without unnecessary words.

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?

The description covers all necessary aspects: what the tool does, how it handles formatting, the safety behavior (force and snapshot), alternatives, and prerequisites. Even without an output schema, it explains the return result (formatting preservation report and snapshot notification).

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 coverage is 100%, so baseline is 3. The description does not add significant new meaning beyond the schema's parameter descriptions. The force parameter behavior is already described in the schema, so no extra semantic value from the description.

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's purpose: 'Replace a document's text with new content, preserving the surrounding Scrivener formatting...' It uses a specific verb (replace) and resource (document's text), and explicitly distinguishes from siblings update_document and create_document.

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?

The description explicitly states when to use alternatives: 'To change only the title or metadata use update_document; to add a new document use create_document.' It also mentions prerequisites: 'Requires an open project and a valid document id.'

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/writerslogic/scrivener-mcp'

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