Skip to main content
Glama

Query Knowledge Base

knowledge_query
Read-onlyIdempotent

Retrieve the most relevant passages from a knowledge base plus (optionally) a grounded, cited answer.

Returns found:false rather than a guess when the passages don't contain the answer.

Args: namespace: The knowledge-base namespace. question: The natural-language question. top_k: How many passages to retrieve. rerank: Re-order retrieved passages before answering. synthesize: Also return a grounded answer.

Returns: dict with keys: answer (str|null), found (bool), passages (list), synthesized (bool), reranked (bool), ...

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
top_kNoHow many passages to retrieve
rerankNoRe-order the retrieved passages before answering
questionYesThe natural-language question
namespaceYesThe knowledge-base namespace to query
synthesizeNoAlso return a concise answer grounded only in the retrieved passages

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint, idempotentHint, destructiveHint=false) and openWorldHint. On top of that the description adds real behavioral context: the refusal-to-guess semantics (found:false), the grounding constraint on the synthesized answer, the rerank/synthesize toggles and their effects, and the full return dictionary shape. That goes beyond what structured annotations alone provide.

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?

Front-loaded: core retrieval behavior in the first line, then the critical failure-mode guarantee, then a compact args/returns list. No redundant prose; every sentence earns its place. Slightly more than minimal, but the extra behavioral terms (found, synthesized, reranked keys) justify the length.

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?

A 5-parameter tool with rich retrieval/synthesis semantics is thoroughly covered: inputs, outputs, defaults, and groundedness caveats are all stated. Remaining gaps are minor and nice-to-haves — no worked example, no note on what happens when rerank or synthesis fail, no pagination/latency costs — and none prevent a capable agent from invoking it correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the bar for added value is 3; the description clears it by defining the keyword-argument contract (dst, fields, values), while the description explains defaulting and clustering behavior in prose. Defaults are repeated clearly (top_k=6, rerank=false, synthesize=true), and the description gives the parameters purpose and interplay (reranking before synthesis) rather than just types.

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 opens with a specific verb plus resource ('retrieve the most relevant passages from a knowledge base') and its optional answer-generation mode, which is immediately distinguishable from siblings. The explicit found:false behavior (rather than guessing) further sharpens scope, and the args/returns list makes the purpose unmistakable.

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?

The description implies usage context (knowledge-base, natural-language question, grounding) and clarifies the return behavior when no match exists, but it never names alternatives like answer_question or check_groundedness, nor does it say when not to use this tool (e.g., when an answer must be ungrounded, or when passages are not required). Context is clear; exclusions are absent.

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.

TDQS

A3.6/5.0
Disambiguation4/5

Most tools map cleanly to distinct capabilities, and the descriptions make the intended use clear. A few adjacent pairs—extract_entities vs link_entities_to_wikidata and detect_pii vs detect_conversational_pii—require careful selection, but they are distinguishable by their stated outputs.

Naming Consistency4/5

Names are uniformly lowercase snake_case and mostly follow a verb_object pattern, such as analyze_*, detect_*, extract_*, summarize_text, and translate_text. A few outliers like aspect_sentiment, fraud_feedback, and knowledge_ingest break the verb-first feel, but the overall pattern remains predictable.

Tool Count3/5

At 22 tools, this is on the heavy side of the borderline range. Each tool has a distinct job, but the mix of core NLP, safety, fraud, health-checking, and knowledge-base management makes the surface feel sprawling rather than tightly scoped.

Completeness3/5

The core NLP coverage is broad: sentiment, toxicity, PII, entities, QA, summarization, translation, and groundedness are all present. However, the knowledge-base tools support ingest/list/query but no delete or update, creating a dead end when documents need correction or removal.

Resources