Skip to main content
Glama
leolulu

siyuan-mcp-server

by leolulu

get_file

Read file contents from the SiYuan knowledge base for snapshots or data files. Returns text with sensitive information masked, or a binary data placeholder when decoding fails.

Instructions

读取指定文件的内容(只读)。

用于读取历史快照或其他数据文件。

注意事项: - 文本内容会进行敏感信息打码。 - 若文件为二进制且无法解码为 UTF-8,将返回 '[Binary Data]'。

Args: path: 文件路径,例如 '/data/history/2023/01/...'。

Returns: str: 文件内容(文本)或二进制数据提示。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.31.0

TDQS

A3.9/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 behavioral disclosure burden. It does this well by revealing that text content will be masked for sensitive information and that binary files that cannot be decoded as UTF-8 return '[Binary Data]'. It stops short of documenting error behavior or access permissions, but for a simple read tool this is substantive.

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: a one-line primary purpose, a short usage sentence, bulleted behavioral notes, and an Args section. Every sentence adds value, and the most important information is front-loaded.

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

Completeness4/5

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

For a one-parameter read tool, the description covers the essential aspects: purpose, path semantics, masking behavior, and binary fallback. An output schema is indicated as present, so return-value details need not be expanded. It is slightly incomplete in not guiding the agent toward the binary-capable sibling when raw bytes are needed, but overall it is sufficient.

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?

The input schema provides only a bare 'path' string with no description, so schema coverage is 0%. The description compensates by explaining that path is a file path and gives a concrete example format ('/data/history/2023/01/...'). With only one parameter, this is sufficient semantic coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a clear verb+resource statement: '读取指定文件的内容(只读)' (read the content of the specified file, read-only), which immediately tells the agent what the tool does. It also hints at a text-reading focus by describing binary fallback behavior, but it does not explicitly distinguish itself from siblings like get_file_base64 or get_history_file.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states a general usage context: '用于读取历史快照或其他数据文件' (for reading historical snapshots or other data files). This gives some situational guidance, but it does not specify when to prefer this tool over alternatives such as get_file_base64 or get_history_file, nor does it give any exclusions.

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