Skip to main content
Glama

Write document

write_document
Idempotent

Create or update a named document to preserve findings and develop a shared investigation across runs. Include evidence, progress, and remaining questions. Use expected_version 0 to create; otherwise pass the version you last read.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDocument name, unique in the space.
tagsNoUp to 20 tags of at most 64 characters, deduplicated and sorted.
spaceYesSpace ID.
op_keyYesOperation key you choose, 8 to 128 characters. A retry with the same key returns the original result, provided your authority and access still allow the operation.
contentYesFull document text.
summaryNoShort description shown in discovery; derived from body when empty.
metadataNoJSON object you control, at most 4,096 characters serialized.
expected_versionYes0 to create; otherwise the version you last read.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare the safety profile (idempotentHint, non-destructive, not read-only), but the description adds real behavioral context not in annotations: optimistic concurrency via expected_version, with a sentinel value (0) for creation. It does not state what happens on a version conflict or that content is a full overwrite, leaving that burden on the schema's 'Full document text'.

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?

Three tight sentences with zero filler; the create-vs-update rule is front-loaded after the purpose, and every sentence carries actionable content (purpose, content expectations, version rule).

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 write tool with no output schema, 100% schema coverage, and full annotation coverage, the description supplies the two things an agent most needs: why to write and how to distinguish create from update. It omits conflict/error behavior on a stale version and the resulting version value, which slightly limits completeness.

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 100%, so the baseline is 3. The expected_version guidance in the description ('0 to create; otherwise pass the version you last read') duplicates the schema's own wording rather than adding new meaning, and other parameters such as op_key, space, and metadata are left entirely to the 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?

States a specific verb pair and resource ('Create or update a named document') plus the intent ('preserve findings and develop a shared investigation across runs'). It is immediately distinguishable from read/document_diff siblings because it is explicitly the write path, and it names the create-vs-update split.

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 clear usage context ('preserve findings', 'include evidence, progress, and remaining questions') and an explicit conditional rule for creating vs updating via expected_version. It stops short of naming alternatives or exclusions (e.g., when to use document_diff or read instead), so it is clear context without alternative routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.