Skip to main content
Glama

write_doc

Destructive

Write Markdown into an AFFiNE doc using append or replace mode; replace rewrites the body while preserving board and image markers from read_doc.

Instructions

Write Markdown into a doc. mode "append" adds at the end, "replace" rewrites the body (keep the markers from read_doc to keep boards and images)

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "doc": "<doc>",
      "markdown": "<markdown>",
      "mode": "<mode>"
    },
    "name": "write_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
docYesDoc id or title
modeYes
titleNoNew title, leave out to keep it
markdownYes
workspaceNoWorkspace id or name, leave out for the default workspace

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true and readOnlyHint=false, so the safety profile is known. The description adds genuinely useful context beyond that: replace 'rewrites the body' (data loss) and the agent should keep markers from read_doc to preserve boards and images. That marker caveat is non-obvious behavioral information an agent could not get from structured fields.

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 compact clauses with the core action front-loaded and the mode semantics immediately after. Every phrase carries information; no filler.

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 5-parameter mutation tool with annotations and no output schema, the definition covers the highest-risk behavior (replace destroying body content) and the marker caveat. Minor gaps remain around doc resolution and what is returned, but nothing essential for correct invocation is missing.

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 60% and the description explains the mode enum values behaviorally ('adds at the end' vs 'rewrites the body'), which adds meaning beyond a bare enum list. It says nothing about doc (id or title resolution), title, workspace, or the markdown payload, leaving those entirely to the schema descriptions.

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: 'Write Markdown into a doc.' An agent can immediately tell this mutates document content, distinct from read_doc or create_doc. It stops short of explicitly naming those siblings as alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explains the two modes and their effect, which implicitly tells the agent when to pick append versus replace. However, it gives no guidance on when to use this versus create_doc (e.g., whether it creates a doc if the id/title doesn't exist) and no prerequisites are stated.

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