Skip to main content
Glama
leolulu

siyuan-mcp-server

by leolulu

prepend_block

Insert content as the first child of a specified parent block to maintain a stable hierarchy. Provide parent_id and data to prepend markdown or DOM blocks without relying on adjacent positions.

Instructions

插入前置子块。

适用场景: - 需要稳定地插入到某个父块下(强父子关系)。 - 例如把列表、段落挂到某个 H2/H3 下。

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

注意事项: - 该工具是"父块优先"的安全写入方式,不依赖 next_id/previous_id。 - 若需要基于相邻块精确定位,请使用 insert_block。

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

示例(假设现有结构:父块A -> 子块B -> 子块C): # 插入到 A 的开头(作为第一个子块) prepend_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 the full burden. It discloses the key behavioral trait: this is a parent-first safe write that does not depend on next_id/previous_id, and it gives a concrete example of insertion order. It does not cover permissions or error behavior, but the critical positioning semantics are transparent.

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 dedicated sections for use cases, usage, differences, and a worked example. Every section adds value, and the example makes the insertion position unambiguous without being verbose.

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 3-parameter tool with an output schema, the description covers purpose, parameter semantics, alternative routing, and behavioral consequences with a concrete example. Missing details like authentication are not necessary for correct invocation, and return values are handled by the output schema.

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 the schema's silence. It explains that parent_id is the target parent block ID, data is the content to insert, and data_type supports markdown or dom. This covers all parameters, though exact dom formatting and default behavior are not detailed.

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 states a specific verb and resource: inserting a child block at the front of a parent block. It also explicitly contrasts itself with insert_block, so an agent can distinguish the tools without reading schemas.

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?

It provides explicit when-to-use guidance: use when a stable parent-child relationship is needed, and explicitly directs users to insert_block when positioning by adjacent blocks is required. The distinction between the two tools is clearly stated.

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