Skip to main content
Glama
moton16

Mortis-RAG-MCP

by moton16

kb_search

Search knowledge bases and retrieve structured raw chunks. Narrow results with tags, path prefix, vault, or modification-time filters, or search across all registered vaults.

Instructions

搜索知识库并返回结构化原始 chunks。不传 vault_path 时跨全部注册库 fan-out 检索(结果带 vault 字段)。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tagsNo可选,frontmatter 标签过滤:命中任一标签即保留(大小写不敏感,自动去掉 '#' 前缀)
limitNo可选,本页最多返回条数;缺省时用 top_k
queryYes
top_kNo
dedupeNo可选,默认 true:正文完全相同的 chunk 只保留排在最前面的一条(重复备份/复制段落不再占多格 top_k)
offsetNo可选,跳过前 N 条结果(分页用)
use_rerankNo
vault_pathNo可选,已注册知识库的绝对路径;缺省时跨全部注册库检索
mtime_afterNo可选,只保留修改时间 >= 该值的文件;epoch 秒或 ISO 8601 字符串(如 '2026-01-01')
path_prefixNo可选,只保留 source 以该前缀开头的 chunk(source 是库内相对 posix 路径,如 '教材/')
mtime_beforeNo可选,只保留修改时间 <= 该值的文件;epoch 秒或 ISO 8601 字符串
group_by_vaultNo可选,仅跨库检索(不传 vault_path)时生效:结果按知识库分组返回 groups,每组取 top_k 条

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.5.0
    • addedInput schema / properties / dedupe
      Added value: +{
      +  "default": true,
      +  "description": "可选,默认 true:正文完全相同的 chunk 只保留排在最前面的一条(重复备份/复制段落不再占多格 top_k)",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / group_by_vault
      Added value: +{
      +  "default": false,
      +  "description": "可选,仅跨库检索(不传 vault_path)时生效:结果按知识库分组返回 groups,每组取 top_k 条",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "可选,本页最多返回条数;缺省时用 top_k",
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / mtime_after
      Added value: +{
      +  "description": "可选,只保留修改时间 >= 该值的文件;epoch 秒或 ISO 8601 字符串(如 '2026-01-01')",
      +  "type": [
      +    "number",
      +    "string"
      +  ]
      +}
    • addedInput schema / properties / mtime_before
      Added value: +{
      +  "description": "可选,只保留修改时间 <= 该值的文件;epoch 秒或 ISO 8601 字符串",
      +  "type": [
      +    "number",
      +    "string"
      +  ]
      +}
    • addedInput schema / properties / offset
      Added value: +{
      +  "default": 0,
      +  "description": "可选,跳过前 N 条结果(分页用)",
      +  "minimum": 0,
      +  "type": "integer"
      +}
    • addedInput schema / properties / path_prefix
      Added value: +{
      +  "description": "可选,只保留 source 以该前缀开头的 chunk(source 是库内相对 posix 路径,如 '教材/')",
      +  "type": "string"
      +}
    • addedInput schema / properties / tags
      Added value: +{
      +  "description": "可选,frontmatter 标签过滤:命中任一标签即保留(大小写不敏感,自动去掉 '#' 前缀)",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. First observedv0.4.1

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the transparency burden; it explicitly discloses that the tool is a read-only search returning raw chunk data and that cross-vault results include a vault field. It doesn't discuss auth/rate-limit or full result-shaping behaviors, but for a search tool the core contract is clear.

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?

Two sentences, front-loaded with the action, then the key scope caveat. No redundant restatement of the schema.

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

Completeness3/5

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

The description states the essential return type and the one scope-dependent output field. With 12 parameters, no output schema, and no annotations, it leaves result field details and default behavioral implications (dedupe, rerank, grouping) to the schema, which is adequate for invocation but not fully complete.

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

Parameters3/5

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

Schema coverage is75%, so most parameters already carry descriptions; the description reinforces vault_path's default behavior and notes the vault field in cross-vault output, adding mild value. query, top_k, and use_rerank lack schema descriptions and the description does not compensate for them.

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?

States a specific action ('搜索知识库') and output type ('结构化原始 chunks'), and distinguishes the cross-vault fan-out behavior. This clearly differentiates it from siblings like kb_read or kb_list.

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

Usage Guidelines4/5

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

Provides a clear scope rule: omitting vault_path searches across all registered vaults and attaches a vault field, while supplying it targets one vault. It does not name alternative sibling tools or give exclusion criteria, so it doesn't earn a 5.

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