Skip to main content
Glama
leolulu

siyuan-mcp-server

by leolulu

find_documents

Find documents in SiYuan notebooks by title, creation, or update date. Filter by notebook to locate specific notes quickly.

Instructions

在指定的笔记本中查找文档,支持多种过滤条件。

适用场景: - 按笔记本、标题、创建/更新时间筛选文档块(type='d')。

使用方法: - notebook_id: 指定笔记本范围。 - title: 对文档名称字段做 LIKE 模糊匹配。 - created_after / updated_after: 传入 YYYYMMDDHHMMSS。

注意事项: - 本工具按 blocks.name 过滤标题,不按 hpath 过滤。 - 若需要更复杂条件(例如按 hpath 前缀),请使用 execute_sql。

Args: notebook_id (Optional[str]): 在哪个笔记本中查找。如果省略,则在所有打开的笔记本中查找。 title (Optional[str]): 根据文档标题进行模糊匹配。 created_after (Optional[str]): 查找在此日期之后创建的文档,格式为 'YYYYMMDDHHMMSS'。 updated_after (Optional[str]): 查找在此日期之后更新的文档,格式为 'YYYYMMDDHHMMSS'。 limit (int): 返回结果的最大数量,默认为 10。

Returns: list: 包含文档信息的字典列表,每个字典包含 'name', 'id', 和 'hpath'。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo
titleNo
notebook_idNo
created_afterNo
updated_afterNo

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 burden. It transparently discloses key behavioral traits: title filtering is done via blocks.name, not hpath; omitting notebook_id searches all open notebooks; and the return format is a list of dicts with 'name', 'id', and 'hpath'. This goes beyond a simple action statement and equips the agent with non-obvious behavior details.

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-organized with clear sections (适用场景, 使用方法, 注意事项, Args, Returns) and every sentence adds value. It avoids redundancy and front-loads the most important usage guidance. The length is appropriate for the tool's complexity.

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 complexity, the description is complete: it covers all parameters, states the return structure, highlights the critical difference between name and hpath filtering, and names the alternative tool for advanced queries. The output schema is not shown but the Returns section sufficiently describes the result format.

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%, so the description fully compensates by explaining every parameter in plain language: notebook_id scope, title LIKE fuzzy matching, exact date format YYYYMMDDHHMMSS for created_after/updated_after, and the default limit of 10. This is significantly more informative than the bare schema properties.

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 a specific action (find documents) with a specific resource (documents in notebooks) and defines the scope via filtering options such as notebook_id, title, and timestamps. It also explicitly scopes to type='d', which distinguishes it from generic block search tools like search_blocks and from related tools like find_notebooks.

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 explicitly tells the agent when to use this tool: for filtering documents by notebook, title, or date fields. It also provides a clear alternative, stating that complex conditions like hpath prefix filtering should use execute_sql. The note about filtering by blocks.name rather than hpath further guides correct usage and avoids common mistakes.

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