siyuan_database_query
思源数据库查询工具 - 执行 SQLite 查询语句来查询思源笔记的数据库(树形视图/属性视图) 功能说明 此工具允许您查询思源笔记中的数据库(也称为树形视图或属性视图)。您可以使用标准的 SQLite 语法来查询数据库中的数据。 支持的表 - blocks: 内容块表 - attributes: 属性表 - refs: 引用表 数据库表结构 blocks 表 - id: 内容块 ID - parent_id: 父块 ID - root_id: 文档块 ID - box: 笔记本 ID - path: 内容块路径 - hpath: 人类可读路径 - name: 内容块名称 - alias...
This record as markdown: /tools/2234839-mcpserver/siyuan-database-query.md
What siyuan_database_query does on Martin MCP Toolbox
AI agents call siyuan_database_query to retrieve information from Martin MCP Toolbox without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
Why siyuan_database_query is rated Low
Although this tool executes SQL queries (which could theoretically Execute), the description and supported operations are limited to data retrieval from read-only table structures (blocks, attributes, refs). No INSERT, UPDATE, DELETE, or DROP operations are mentioned or implied. The tool's purpose is querying/retrieving note data without modifying it.
From the tool's definition Tool executes SQLite queries against SiYuan notes database with statements like 'SELECT' on tables (blocks, attributes, refs). Description states '执行 SQLite 查询语句来查询思源笔记的数据库' (execute SQLite query statements to query SiYuan notes database).
Attacks that exploit this kind of access
The rule that runs siyuan_database_query safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Martin MCP Toolbox, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For siyuan_database_query, this is the rule to start with:
siyuan_database_query is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Martin MCP Toolbox, apply this rule, and every siyuan_database_query call is checked against it from then on.
Questions about siyuan_database_query
思源数据库查询工具 - 执行 SQLite 查询语句来查询思源笔记的数据库(树形视图/属性视图) 功能说明 此工具允许您查询思源笔记中的数据库(也称为树形视图或属性视图)。您可以使用标准的 SQLite 语法来查询数据库中的数据。 支持的表 - blocks: 内容块表 - attributes: 属性表 - refs: 引用表 数据库表结构 blocks 表 - id: 内容块 ID - parent_id: 父块 ID - root_id: 文档块 ID - box: 笔记本 ID - path: 内容块路径 - hpath: 人类可读路径 - name: 内容块名称 - alias: 别名 - memo: 备注 - tag: 标签 - content: 内容文本 - fcontent: 第一个子块内容 - markdown: Markdown 格式内容 - length: 内容长度 - type: 块类型 (d:文档, h:标题, p:段落, l:列表, t:表格, b:引述, s:超级块, c:代码块, m:数学公式, av:数据库) - subtype: 子类型 - ial: 内联属性列表 - sort: 排序权重 - created: 创建时间 - updated: 更新时间 attributes 表 - id: 属性 ID - name: 属性名称 (自定义属性需加 custom- 前缀) - value: 属性值 - type: 类型 - block_id: 块 ID - root_id: 文档 ID - box: 笔记本 ID - path: 文档路径 refs 表 - id: 引用 ID - def_block_id: 被引用块 ID - def_block_root_id: 被引用块文档 ID - def_block_path: 被引用块路径 - block_id: 引用块 ID - root_id: 引用块文档 ID - box: 笔记本 ID - path: 引用块路径 - content: 引用锚文本 使用示例 1. 查询所有数据库块: SELECT * FROM blocks WHERE type =. It is categorised as a Read tool in the Martin MCP Toolbox MCP Server, which means it retrieves data without modifying state.
Register the Martin MCP Toolbox MCP server in PolicyLayer and add a rule for siyuan_database_query: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Martin MCP Toolbox. Nothing to install.
siyuan_database_query is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the siyuan_database_query rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for siyuan_database_query. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
siyuan_database_query is provided by the Martin MCP Toolbox MCP server (2234839/mcpserver). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Martin MCP Toolbox, and thousands of servers like it.
This server
Across the catalogue