Skip to main content
Glama
leolulu

siyuan-mcp-server

by leolulu

append_block

Appends a block as the last child of a specified parent block, ensuring stable hierarchy. Ideal for adding lists or content under a heading without affecting sibling order.

Instructions

插入后置子块。

适用场景: - 需要稳定地追加到某个父块末尾(强父子关系)。 - 例如把有序/无序列表追加到某个 H2/H3 下。

使用方法: - parent_id 传入目标父块 ID。 - data 为待插入内容,data_type 支持 markdown 或 dom。

注意事项: - 该工具不会使用 next_id/previous_id 锚点,适合避免层级歧义。 - 若需要插入到父块子节点中间位置,请使用 insert_block 并结合锚点。

与 insert_block 的区别: - append_block 强制作为父块的最后一个子块,层级关系稳定。 - insert_block 依赖相邻块定位,层级可能因 next_id/previous_id 而变化。

示例(假设现有结构:父块A -> 子块B -> 子块C): # 插入到 A 的末尾(作为最后一个子块) append_block(parent_id="block_a", data="新块") # 结果:A -> B -> C -> 新块

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
data_typeNomarkdown
parent_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.31.0

TDQS

A4.7/5.0
Behavior4/5

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

No annotations are provided, so the description carries full responsibility for behavioral disclosure. It reveals that the tool does not use next_id/previous_id anchors and forces the new block to be the last child, which is important behavioral context beyond the basic insert action. It does not cover error cases or side effects of invalid input, but the core behavior is well-documented.

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?

The description is well-structured with sections for scenarios, usage, notes, differences, and an example. Each sentence adds value and the content is front-loaded with the core purpose. While a bit lengthy, the structure makes it easy to scan, and no filler is present.

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 simple append operation, the description covers the purpose, parameters, usage scenario, behavioral nuance, and distinction from a sibling tool. An output schema exists, so return values do not need to be documented. The example clarifies the expected result, making the tool fully usable without consulting additional resources.

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 description coverage is 0%, so the description must compensate for documenting parameters. It does so by explaining parent_id as the target parent block ID, data as the content to insert, and data_type as supporting markdown or dom. However, it does not elaborate on the exact allowed values or the optional nature of data_type beyond what the schema implies.

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?

The description clearly states the tool inserts a trailing child block under a parent, using the phrase '插入后置子块' and demonstrating with an example. It explicitly distinguishes from insert_block, making its specific resource and behavior clear.

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?

The description provides explicit when-to-use guidance: appending to a parent block for stable hierarchy, and when not to use it, directing users to insert_block for inserting in the middle. The section '与 insert_block 的区别' explicitly defines the alternative and the conditions that select it.

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