Skip to main content
Glama
retrieval-mcp

retrieval-mcp

by ZhiJiu-An

search

Read-onlyIdempotent

Find supporting evidence in the enterprise knowledge base with hybrid keyword and semantic retrieval, returning citable snippets, chunk IDs and section paths so you can judge which documents are worth fetching in full.

Instructions

在企业知识库中做混合检索(词法 + 语义),返回片段级命中。

返回的是引用:chunk_id + 300 字以内的片段 + 小节路径。 片段只用于判断「值不值得展开」,真正的依据要用 fetch 取。

何时用:需要事实、制度、流程、文档原文作为依据。 何时不用:已知 doc_id 且要完整内容 → 用 fetch 或 resource。

空结果或结果被截断时 hint 里有下一步建议,格式为 CODE: 说明。

Input Schema

NameRequiredDescriptionDefault
queryYes自然语言问题或关键词。优先用文档里可能出现的原词,不要写长句
top_kNo返回条数上限。schema 硬上限 100;实际还会按服务端 RAG_MAX_TOP_K 收敛,越界不会报错
doc_typeNo按文档类型过滤。合法值见 list_sources;不确定就留空
departmentNo按部门过滤。合法值见 list_sources;不确定就留空
updated_afterNoYYYY-MM-DD,只保留该日期后更新的文档

Output Schema

NameRequiredDescriptionDefault
hintNo
hitsYes
queryYes
totalYes
returnedYes
truncatedYes
config_hashYes
chars_returnedYes
corpus_versionYes
schema_versionYes
filters_appliedYes
query_truncatedNo
truncated_reasonNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/closed-world, so safety is covered; the description goes further by explaining that results are citations meant only to judge whether a chunk is worth expanding, that snippets are capped at 300 characters, and that empty or truncated results carry a `CODE: 说明` hint with next steps. It does not, however, describe ranking/scoring behavior or how many hints might appear, leaving modest gaps for a retrieval tool.

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?

Front-loaded with purpose, then return shape, then use/don't-use, then edge-case handling, using bold labels as visual anchors. Every line carries distinct information and nothing is repeated.

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?

An output schema exists, so return structure need not be re-specified, and the description still adds the crucial framing that snippets are citation previews rather than evidence. Combined with explicit when/when-not routing against both siblings and hint-handling for empty/truncated results, nothing an agent needs to call this correctly is missing.

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 every parameter — including the RAG_MAX_TOP_K convergence note and the list_sources pointer for doc_type/department — is already documented in the schema. The description adds no parameter-level detail beyond what the schema provides, 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?

The opening line names a specific verb and resource — hybrid retrieval (lexical + semantic) over an enterprise knowledge base returning snippet-level hits — and immediately defines the return unit (chunk_id + ≤300-character snippet + section path). This cleanly separates it from `fetch`, which is explicitly framed as the tool for full document content.

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?

It states both sides explicitly: use when you need facts, policies, processes, or document原文 as evidence; do not use when the doc_id is known and full content is wanted — go to `fetch` or `resource`. The alternative is named with the exact condition that selects it, so no inference is required.

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