Skip to main content
Glama
fanfan14543

dsh-local-rag

by fanfan14543

rag_search

Search local session logs, docs, skills, and persona files via full-text index to recall past chats, project decisions, or document details. Returns ranked snippets with source and ID.

Instructions

在本地资料库里做全文检索(中文按二字组切分,SQLite FTS5 + BM25 排序)。资料库包含:历史会话记录、工作区文档、技能库、人设与记忆文件。当需要回忆以前聊过什么、翻某个项目的旧决定、查文档里的细节时用它。返回按相关度排序的片段,带来源和 id,可用 rag_open 取上下文。

Input Schema

NameRequiredDescriptionDefault
queryYes检索词,自然语言即可,中文英文混排也行。
top_kNo返回条数,默认 6,最大 30。
sourceNo限定来源,可选 session / doc / skill / persona,不填则全库搜。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

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 full burden and does well: it discloses the retrieval mechanism (SQLite FTS5 + BM25 ranking), the CJK bigram tokenization that explains Chinese matching behavior, and the return shape (relevance-sorted snippets with source and id). It does not cover empty-result behavior or any limits on the corpus (e.g. staleness, indexing requirements), which keeps it short of a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Four sentences, front-loaded with the core action and corpus scope, then use cases, then return format. The implementation parenthetical (FTS5 + BM25) earns its place by explaining ranking and Chinese tokenization, though it is the one part an agent could live without.

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?

No output schema exists, so the description correctly compensates by describing return values (ranked snippets with source and id) and the natural follow-up via rag_open. For a 3-parameter read tool this is nearly complete; only edge behavior (no hits, index freshness) is unaddressed.

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 description coverage is 100%, so all three parameters (query, top_k, source) are already documented in the schema, including the source enum values and top_k bounds. The description adds no parameter-level detail beyond the schema, so the baseline 3 applies.

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 verb and resource ('在本地资料库里做全文检索') and immediately scopes the corpus (session logs, workspace docs, skill library, persona/memory files). It also distinguishes itself from rag_open by noting that rag_open is what you use to pull surrounding context, so an agent can separate the two without opening either schema.

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?

Gives concrete use cases: recalling past conversations, retrieving old project decisions, looking up document details. This is clear positive guidance, but it never states when NOT to use it or contrasts it with rag_index / rag_stats, so a small inference gap remains.

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

Deploy Server

Other Tools