Skip to main content
Glama

yuque_batch_update_toc

Batch update a Yuque repository's table of contents by executing a structured operations plan for creating, appending, moving, or removing nodes; destructive changes require RESTRUCTURE confirmation.

Instructions

Batch update repo TOC. Agent provides ops plan, tool executes only. Supported actions: createTitle, appendNode, removeNode, moveNode, prependDoc. createTitle auto-reuses existing dirs. appendNode/moveNode support target_title. ⚠️ Remove/move ops require confirm='RESTRUCTURE'. For cross-book copy, use yuque_copy_doc instead.

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": {
      "book_id": "<book_id>",
      "ops": "<ops>",
      "confirm": "<confirm>"
    },
    "name": "yuque_batch_update_toc"
  }
}

Input Schema

NameRequiredDescriptionDefault
opsYesJSON array of operations (or JSON-encoded string). Supported: createTitle, appendNode, removeNode, moveNode, prependDoc. createTitle auto-reuses existing dirs. appendNode/moveNode/prependDoc support target_title for name-based lookup.
book_idYesRepository ID or namespace (required)
confirmYesMust be 'RESTRUCTURE' to proceed with any operation that modifies TOC.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv4.0.0
    • addedInput schema / properties / ops / anyOf
      Added value: +[
      +  {
      +    "items": {},
      +    "type": "array"
      +  },
      +  {
      +    "type": "string"
      +  }
      +]
    • changedInput schema / properties / ops / description
      Previous value: -"JSON array of operations. Supported: createTitle, appendNode, removeNode, moveNode, prependDoc. createTitle auto-reuses existing dirs. appendNode/moveNode/prependDoc support target_title for name-based lookup."New value: +"JSON array of operations (or JSON-encoded string). Supported: createTitle, appendNode, removeNode, moveNode, prependDoc. createTitle auto-reuses existing dirs. appendNode/moveNode/prependDoc support target_title for name-based lookup."
    • removedInput schema / properties / ops / type
      Removed value: -"string"
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full behavioral burden. It usefully discloses the destructive-op gate (confirm='RESTRUCTURE') and that createTitle auto-reuses existing directories, which prevents surprise reorganization. It says nothing about atomicity, partial failure across a multi-op plan, ordering guarantees, or what is returned per operation — material gaps for a batch mutation.

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?

Telegraphic and front-loaded: purpose and execution model first, supported actions second, safety gate and alternative last. Dense but every clause carries information, though the fragment style and emoji warning slightly reduce parseability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With a required confirm token, a five-action ops array, and no output schema, this is a complex mutation tool and the definition has to do more work. It covers the ops vocabulary and the safety gate adequately but never describes what a batch run returns or how per-operation failures surface, which an agent needs to report results.

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 schema already documents all three parameters, establishing a baseline of 3. The description adds the confirm gate for remove/move and explains operation semantics, but its target_title note (appendNode/moveNode) is actually narrower than the schema, which also lists prependDoc.

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?

"Batch update repo TOC" names a specific verb and resource, and the sentence "Agent provides ops plan, tool executes only" defines the execution model precisely. It also names the sibling to use for cross-book copy (yuque_copy_doc), so an agent can separate this from copy/read paths without opening a schema.

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 an explicit routing rule for one case: cross-book copy goes to yuque_copy_doc rather than this tool. It also states the condition that gates mutating ops (confirm='RESTRUCTURE'). It stops short of saying when to prefer this batch tool over the single-op yuque_update_toc, leaving that comparison to inference.

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