Skip to main content
Glama

retrieve_context

Search a knowledge base and retrieve formatted results with source citations for LLM context building. Supports filters to refine results.

Instructions

Search and return results formatted for LLM context building.

Args: query: Natural language query. k: Number of results (max 20). filters: Optional JSON string of filter conditions.

Returns: Formatted string with source citations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
queryYes
filtersNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations provided, so description must disclose behavioral traits. It states return format (formatted string with source citations) but lacks info on read-only nature, auth requirements, rate limits, or error scenarios. For a search tool, more transparency on side effects is needed.

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?

Description is concise (5 lines) in docstring format with clearly separated Args and Returns sections. No fluff; each 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?

Given the presence of similar sibling tools (search, search_context) and no annotations, the description adequately covers purpose, parameters, and return format. Missing some edge case details but sufficient for standard use.

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 description coverage is 0%, so description compensates by explaining each parameter: query as natural language, k as number of results (max 20), filters as optional JSON string. Adds meaningful context beyond schema types.

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?

Description clearly states verb (search and return) and resource (results for LLM context building). Differentiates from siblings like 'search' and 'search_context' by emphasizing formatted output for context building.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives like 'search' or 'search_similar'. The description only lists parameters without context about appropriate use cases or exclusions.

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/moliver28/corpus-kb'

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