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. Pass thread to attach the document to a thread; preserve that owner on updates. Use expected_version 0 to create; otherwise pass the version you last read.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesDocument name, unique within the space, including thread artifacts.
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.
threadNoThread that owns this artifact. Omit for a space document. Immutable after creation.
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. Changed2 schema fields changed
    • changedInput schema / properties / name / description
      Previous value: -"Document name, unique in the space."New value: +"Document name, unique within the space, including thread artifacts."
    • addedInput schema / properties / thread
      Added value: +{
      +  "description": "Thread that owns this artifact. Omit for a space document. Immutable after creation.",
      +  "maxLength": 100,
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and readOnlyHint=false, so the description adds value by explaining the expected_version semantics (0 for create, otherwise last read) and that thread ownership is preserved on updates. This contextualizes the mutation behavior beyond what annotations convey.

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?

Two sentences with no waste. The core purpose is stated first, followed by the key usage rules. Every clause earns its place, and it's easy to scan.

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 9 parameters, the description covers the critical aspects: purpose, versioning, thread attachment, and content expectations. Optional parameters like tags and metadata are self-explanatory from the schema, and the lack of an output schema is acceptable for a write operation.

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 all parameters are documented. The description adds meaning to expected_version and thread, and gives content guidance ('Include evidence, progress, and remaining questions'), which enriches understanding beyond schema field names.

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?

Clearly states the tool's purpose: create or update a document to preserve findings and share investigation context. It specifies the resource (named document) and the action (create/update), and differentiates from read-only or discovery tools like 'read' and 'discover'.

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?

Provides explicit guidance on how to distinguish create vs update via expected_version, and explains thread ownership handling. It doesn't explicitly list when NOT to use the tool, but the purpose and sibling context make it clear this is the write path. The versioning and thread instructions are actionable.

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.