Skip to main content
Glama

search_knowledge_base

Retrieve relevant knowledge base snippets by semantic search. Returns text fragments with similarity scores and document titles for answer grounding.

Instructions

语义检索知识库,返回与查询最相关的若干片段(含相似度与所属文档标题)。

何时使用:用户提问涉及具体业务、产品、政策等知识库内容时,先调用本工具拿到
相关片段再作答,并在回答中标注片段来源文档。

参数:
- query(必填):用户原话或主题关键词
- top_k(默认 5):返回片段数,上限 20(超过会被自动钳制)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
top_kNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations provided, but the description discloses behavioral traits: returns fragments with similarity and document title, auto-clamps top_k to 20. Adequate for a search 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?

The description is concise and front-loaded with the core purpose. Every sentence adds value without redundancy.

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?

Given an output schema exists, the description adequately covers usage, parameter semantics, and return format (fragments with similarity and title). No gaps for this simple tool.

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 description coverage is 0%, but the tool description provides meaningful descriptions for both parameters: query as user's words/topic keywords, and top_k with default, max, and clamping behavior. This adds significant value beyond the schema.

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 description clearly states the tool performs semantic search on a knowledge base, returning relevant fragments with similarity and document title. It distinguishes from sibling tools like get_document_content and list_documents.

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?

The description explicitly says when to use (when user's question involves knowledge base content) and instructs to call this tool first before answering. It does not explicitly state when not to use, but the context is clear.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/code-runner-xx/kb-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server