Skip to main content
Glama

update_document

Overwrite an entire Markdown document in a mind map with new full content, using the prior read timestamp to prevent concurrent-edit conflicts.

Instructions

マップにあるMD文書(Markdown)の中身を、新しい中身で丸ごと上書きする(一部だけの差し替えはできない。直す前にread_documentで今の中身を読み、直した全文をcontentに渡すこと)。文書の要素の位置・日付・チェックは変わらない。文書を作り直して古い方を消す必要はない。documentIdは、list_elementsが返す文書の要素のdocument.documentId。contentはUTF-8で1000000バイトまで(超えると何も書かずにエラーを返す)。titleを省略すると、新しい中身の最初の見出し(# の行)、無ければ最初の行が行のタイトルになる。baseUpdateTimeには、直前のread_documentが返したupdateTimeをそのまま渡す(必須)。read_documentで読んだあとにアプリなどで文書が変わっていた場合は、何も書かずにエラーを返す(自動ではやり直さない)ので、read_documentで読み直し、最新の中身をもとに直してやり直すこと。

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": {
      "mapId": "<mapId>",
      "documentId": "<documentId>",
      "baseUpdateTime": "<baseUpdateTime>",
      "content": "<content>"
    },
    "name": "update_document"
  }
}

Input Schema

NameRequiredDescriptionDefault
mapIdYeslist_mapsで得たマップのID
titleNo行に見せるタイトル。省略するとcontentの最初の見出しから決める
contentYes書き換え後の文書の全文(Markdown)
documentIdYeslist_elementsで得た、文書の要素のdocument.documentId
baseUpdateTimeYes直前のread_documentが返したupdateTime。これと違えば(読んだあとに変更されていれば)書かずにエラー

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.0

TDQS

A4.8/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: destructive full-body overwrite, a 1,000,000-byte UTF-8 cap that fails without writing, optimistic concurrency via baseUpdateTime that aborts without writing and does not auto-retry, and the guarantee that element position/date/checks are untouched. These are exactly the behavioral traits an agent needs before a write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core action and its constraints are front-loaded, and nearly every clause earns its place. However, it is one dense block of nested parentheticals, and the read_document workflow is effectively restated in the conflict-recovery sentence, adding mild length and reducing scannability.

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?

For a 5-parameter mutation tool with no annotations and no output schema, the description covers everything an agent needs: which IDs to source from which sibling, the required lock token, size limits, title defaults, and failure/recovery behavior.

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 the baseline is 3, but the description adds meaning beyond the schema: the exact 1,000,000-byte content limit with a no-write error, the title-derivation fallback (first '# ' heading, else first line), and the conflict semantics of baseUpdateTime. Some of this duplicates the schema's own property descriptions, which keeps it from a 5.

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: it overwrites the entire Markdown body of a map document, and explicitly rules out partial replacement ("一部だけの差し替えはできない"). The agent can distinguish it from read_document and create_document without opening any schema.

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 explicit when-to-use sequencing: read_document first to get the current body and the updateTime, then pass the full revised text. It also removes a plausible wrong path ("文書を作り直して古い方を消す必要はない") and prescribes the recovery procedure after an optimistic-lock conflict.

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