Skip to main content
Glama
admin0330

KnowledgeBase MCP

by admin0330

kb_search

Search a personal knowledge base for relevant text chunks using keyword, semantic, or hybrid matching. Filter by folder to turn questions or keywords into targeted notes and documents.

Instructions

Search the knowledge base and return the most relevant text chunks.

Space-separated words must all appear (if nothing has all of them, chunks with the most words are returned, source="keyword-partial"). File names are matched too (source="filename").

:param query: Keywords or a question, e.g. "预算 硬件 2026". :param top_k: Number of chunks to return (1-30). :param mode: "keyword", "semantic" (needs KB_ENABLE_SEMANTIC) or "hybrid". :param folder: Optional sub-folder to search in, e.g. "02_Books".

Input Schema

NameRequiredDescriptionDefault
modeNohybrid
queryYes
top_kNo
folderNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.1

TDQS

A4/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it delivers: it discloses the AND-matching rule, the partial-match fallback with its source tag, and filename matching. It doesn't mention ranking, pagination, or cost/latency differences between modes.

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?

The behavior is front-loaded in two tight sentences, then parameter docs. The ':param' docstring residue is slightly noisy but each line adds real information.

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?

With an output schema present, the description needn't explain return values, and it covers matching semantics and all parameters. It stops short of explaining folder recursion and how hybrid mode ranks results.

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

Parameters5/5

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

Schema coverage is 0%, and the description documents all four parameters: a query example including non-English terms, top_k bounded 1-30, the three mode values with the env-var requirement, and a folder example. It fully compensates for the empty schema.

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?

States a specific verb and resource ('Search the knowledge base and return the most relevant text chunks') and explains the matching model. It does not distinguish itself from kb_read_document, the closest sibling for retrieving KB content, so it stops short of 5.

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?

It gives useful selection guidance for the mode parameter ('semantic' needs KB_ENABLE_SEMANTIC, default hybrid) and the fallback to keyword-partial when nothing matches. It never says when to use this instead of kb_read_document or kb_list_tree, so the routing decision is left to inference.

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