Skip to main content
Glama

query_knowledge

Search the local knowledge base to retrieve relevant information. Returns top matching knowledge cards with scores and content. Use to find existing knowledge before conducting web research.

Instructions

Search the local knowledge base for relevant information.

Returns top-k knowledge cards matching the query, with scores and content. Use this to find existing knowledge before doing web research.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of results to return (default 5).
queryYesThe search query in natural language.
rerankNoWhen true, fetches limit*3 candidates and uses an LLM cross-encoder to score each (query, candidate) pair on 0-10 relevance. Improves top-1 precision for ambiguous queries at the cost of one LLM call per candidate (~2s each). Default false.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations exist, so description must disclose behavior. It describes return format (top-k, scores, content), implying read-only. Could add more detail on response structure, but sufficient 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?

Two concise sentences with a clear usage directive. Zero fluff, every sentence adds value.

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, description doesn't need to detail return values. It covers purpose, usage, and basic input semantics. Complete enough for a simple search tool.

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 coverage is 100%, so parameters are already well-documented in the schema. The description adds no further semantic meaning beyond the schema's own descriptions, meeting baseline expectations.

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 searches the local knowledge base, returns top-k cards with scores and content, and distinguishes it from sibling tools like fetch_url or save_research.

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?

Explicit guidance to 'use this to find existing knowledge before doing web research' tells the agent when to invoke this tool and implies alternatives (web research tools).

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/zfy465914233/scholar-agent'

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