Skip to main content
Glama

Change a WikiDrive document

wikidrive_edit_doc
DestructiveIdempotent

Edit a WikiDrive document by replacing a section or full text, or renaming it; version checks prevent overwriting changes and support merge-and-retry.

Instructions

Change one of the user's WikiDrive documents: replace the text of one section (change 'section'), replace the whole text (change 'replace'), or rename it (change 'title'). Use it when the user asks to correct, reorganize or rename a document, or, when automatic documents are on, to correct something that became wrong in a document an AI made (why 'auto'); a document the user wrote needs why 'asked'. Send base_version, the version you last saw; if the document changed since, nothing is written and the result gives the current version: open it with wikidrive_open, merge, and try once more. A section runs to the next heading of the same or higher level, so its sub-sections are part of it. The previous text stays in the document's history. Same content rules as wikidrive_create_doc. Afterwards tell the user the returned message in one line, in the user's language; it says how to undo.

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": {
      "prompt_id": "<prompt_id>",
      "change": "<change>",
      "base_version": "<base_version>",
      "why": "<why>",
      "idempotency_key": "<idempotency_key>"
    },
    "name": "wikidrive_edit_doc"
  }
}

Input Schema

NameRequiredDescriptionDefault
whyYes'asked' when the user asked for this in this conversation; 'auto' under the user's automatic-documents setting (only for documents an AI made).
textNoThe new text: of the section without its heading line (change 'section'), or of the whole document (change 'replace'). Keep each heading at most 120 characters, so it can be named later.
titleNochange 'title' only: the new title.
changeYes'section' replaces the text under heading (the section is made when missing); 'replace' replaces the whole text; 'title' only renames.
headingNochange 'section' only: the section's heading text without the leading #s.
prompt_idYesThe document's prompt_id.
base_versionYesThe version wikidrive_open or the last document message showed.
idempotency_keyYesA new random key (e.g. a UUID) for each new save; reuse it only to retry the same save after an unclear result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.6/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: prior text is retained in history, so the destructiveHint=true write is recoverable and the undo path is surfaced through the returned message. It also discloses the optimistic-concurrency contract (base_version mismatch = nothing written, current version returned) and the section-boundary rule, neither of which any structured field carries. It stops short of describing error shapes beyond the version conflict, keeping it a 4 rather than a 5.

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?

Front-loads the three modes in the first sentence, then layers conflict handling, section semantics, and post-call behavior in a deliberate order with no filler. It is dense to the point of feeling run-on (long parenthetical clauses and chained 'so'/'if' constructions) which slightly hurts 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 an eight-parameter destructive mutation with no output schema, it covers what is needed: the mode matrix, conflict/retry protocol, history/undo guarantee, section boundary definition, and a pointer to wikidrive_create_doc for content rules. The agent has enough to invoke it correctly and to report results to the user.

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 meaningfully extends it: base_version is framed as 'the version you last saw' with the conflict consequence explained, idempotency_key as new-per-save/reuse-only-on-retry, and heading scope as extending to sub-sections up to the next same-or-higher heading. These are semantics the schema text does not supply.

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?

Names a specific verb and resource and enumerates its three distinct modes via the 'change' values ('section', 'replace', 'title'), so an agent knows exactly which mutation it is choosing. It also names siblings it interacts with (wikidrive_open, wikidrive_create_doc) rather than leaving them implicit.

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 conditions (user asks to correct, reorganize, rename) and disambiguates the 'why' values: 'auto' only for AI-made documents under automatic documents, 'asked' for user-written ones. It also prescribes the recovery path on conflict (open with wikidrive_open, merge, retry once) and what to tell the user afterwards.

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