Skip to main content
Glama

Write Document Tool

write_document

Create a project document or save a new Markdown version after approval; pass the read base version to prevent overwriting a teammate’s concurrent save and request a merge.

Instructions

Creates a project document or saves a new version of one: Markdown, the whole text. Only when the person asks or agrees, after showing them the text or the changes. To change an existing document, read it first and pass the version you read as base_version: if a colleague saved in the meantime, nothing is overwritten and you are told to merge into the new version. With client_visible: true the project's client sees the document too (read-only, the current version), only when the person asks for that; share_with_client changes it later. Never secrets, passwords or tokens.

Input Schema

NameRequiredDescriptionDefault
bodyYesThe whole document, in Markdown (not only the changed part).
noteNoWhat changed, in one short line, e.g. "Added the color palette".
repoNoThe git remotes of the working directory (git remote -v).
titleYesThe document's title, e.g. "Brief", "Logo concept", "Decisions". An existing title saves a new version of that document.
projectNoProject slug or name, if not this session's.
sessionNoThis session's id, from the cemainou line at the start of the session. The session's project wins over the repo.
base_versionNoThe version you read with read_document. Required to change an existing document; leave it out to create one.
client_visibleNotrue: the project's client sees the document too; false: only the team. Only when the person asks; only on a project visible to its client.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden well: it discloses concurrency handling, client visibility, and a safety rule against secrets. It does not cover auth requirements, rate limits, or general success return behavior, so it is strong but not complete.

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 dense but appropriately sized for an 8-parameter write tool with concurrency and visibility concerns. It is front-loaded with the core action and each sentence adds non-redundant operational guidance.

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 complex mutation tool with no annotations and no output schema, the description covers the critical workflow, conflict behavior, visibility, and safety constraints. The main remaining gap is that it does not describe the normal success response, which is not documented elsewhere.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds meaningful semantics beyond the schema for base_version conflict behavior and client_visible read-only sharing. It also reinforces that body must be the whole Markdown document and that an existing title creates a new version.

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?

States a specific verb and resource: creates a project document or saves a new version of one. It distinguishes creation from updating and explicitly names read_document and share_with_client as related siblings.

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?

Gives clear when-to-use guidance: only when the person asks or agrees, after showing them the text or changes. It also explains the read-first workflow for updates and when to use client_visible versus share_with_client.

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