Skip to main content
Glama
leolulu

siyuan-mcp-server

by leolulu

get_block_diffs

Retrieve content block changes within a specified time range, returning before/after text and diff statistics to audit edits and identify added, removed, or replaced content.

Instructions

查询指定时间范围内修改的内容块并返回前后对比。

适用场景:

  • 需要审计每个块的具体改动(含 before/after)。

  • 需要变更类型(新增/删减/替换)和差异统计。

与 get_block_changes 的区别:

  • 本函数会读取历史快照并与当前内容对比。

  • 返回 before/after 文本和 diff 统计, 但更重且依赖 /history。

注意事项:

  • 依赖 history_root 可读;若历史目录不可访问,将无法完成比对。

  • before/after 为脱敏文本;max_text_length 会对长文本截断。

Args: start_time: 起始时间,格式为 'YYYYMMDDHHMMSS'。 end_time: 结束时间,格式为 'YYYYMMDDHHMMSS',可选。 limit: 最大返回条目数,默认为 50。 history_root: 历史快照根目录,默认为 '/history'。 max_text_length: 前后文本最大长度,超出将截断。

Returns: Dict[str, Any]: 包含块变更差异结果。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
end_timeNo
start_timeYes
history_rootNo/history
max_text_lengthNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.31.0

TDQS

A5/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full behavioral burden. It discloses the dependency on history_root readability, the failure condition when history is inaccessible, that before/after text is sanitized, and that max_text_length truncates long text. This is strong behavioral disclosure beyond the bare tool name.

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 clear sections: purpose, applicable scenarios, differences from the sibling, caveats, and arguments. It front-loads the main purpose and every sentence adds value, making it efficient without being bloated.

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?

Given the tool's moderate complexity, zero annotation coverage, and no schema-level parameter descriptions, the description adequately covers selection criteria, invocation parameters, key caveats, and return intent. The output schema is present, so detailed return-value documentation is not required here.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description compensates fully by documenting every parameter: start_time and end_time formats, default values for limit/history_root/max_text_length, and the truncation semantics of max_text_length. It adds meaningful meaning beyond the raw JSON schema.

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: query modified content blocks in a time range and return before/after comparisons. The applicable scenarios (auditing specific block changes and needing change types/diff statistics) further clarify its purpose, and it explicitly contrasts itself with the sibling get_block_changes.

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 applicable scenarios and directly differentiates this tool from get_block_changes, noting that it reads historical snapshots, returns before/after text with diff statistics, and is heavier while depending on /history. This gives an agent clear criteria for choosing this tool over alternatives.

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