Skip to main content
Glama

Knowledge base: Search

kb_search
Read-only

Search the caller's knowledge base and return the most relevant chunks. Provide a natural-language 'query'; optional 'collection_id' to scope to one collection, 'top_k' (1..20, default 5) and 'mode' (semantic | keyword | hybrid — default hybrid = vector cosine + keyword). Read-only and fast. Returns { items: [{ doc_id, title, chunk_text, score, collection }] }. Never quota-gated.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "kb_search"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo
queryYes
top_kNo
collection_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the read-only annotations, the description discloses that the tool is fast, never quota-gated, and returns a specific items structure. It also explains that hybrid mode combines vector cosine and keyword search, adding useful behavioral context.

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 front-loaded, dense, and free of filler. Every sentence contributes useful information about parameters, behavior, or return shape.

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 no output schema, the description still supplies the return shape and covers all parameters and core behavior. The only notable gap is explicit guidance on when to choose this tool over related retrieval or document-fetch tools.

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%, so the description carries the full burden and does so effectively. It explains query as natural language, collection_id as scoping, top_k range and default, and mode enum values including the default hybrid behavior.

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?

The description states a specific verb and resource: search the caller's knowledge base and return relevant chunks. It is clear what the tool does, though it does not explicitly distinguish itself from siblings such as kb_get_doc or search_personal.

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 tells the caller to provide a natural-language query and explains optional scoping and mode selection, which implies the intended retrieval use case. However, it does not state when to use this tool instead of alternatives like fetching a specific document or searching other domains.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources