Skip to main content
Glama

search

Find cached files by keyword relevance using BM25 ranking. Supports natural-language queries and returns matches with a relevance score and optional preview.

Instructions

Find cached files by keyword relevance (BM25 ranking).

Searches only files already in the cache — seed them first with read/batch_read (thin results usually mean too few files are cached). Ranks by BM25 term relevance, so multi-word and keyword queries work well; matching is lexical, not embedding-based, so synonyms won't match a word that isn't present. For an exact string or regex use grep; to pull more of the repo into the cache use batch_read. Returns matches with a normalized 0–1 relevance score (best match = 1.0) and a short preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNoMaximum number of matches to return.
queryYesKeywords to rank by. Natural-language phrasing is fine, but ranking is on the individual words.
directoryNoRestrict matches to files under this directory.
show_previewNoInclude a short preview line for each match.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
kNo
countNo
queryNo
matchesNo
directoryNo
truncatedNo
cached_filesNo
show_previewNo
files_searchedNo
Behavior4/5

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

The description discloses that the tool only searches cached files, uses lexical BM25 matching (not embedding-based), and returns a normalized relevance score and preview. However, it does not explicitly state that the tool is read-only or mention any side effects, though these are implied.

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 with no wasted words, covering key points in 6 sentences. It front-loads the purpose and then provides necessary context and comparisons 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 no annotations and an output schema (present but not provided), the description adequately covers prerequisites (caching), ranking behavior, comparison to siblings, and return format (score and preview). It is complete for the tool's complexity.

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?

The input schema covers all 4 parameters with descriptions (100% coverage). The description adds value by clarifying that queries are ranked on individual words and that multi-word queries work well, which complements the schema's explanation of the 'query' parameter.

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 verb 'Find cached files by keyword relevance' and specifies the ranking algorithm (BM25). It distinguishes itself from sibling tools by explicitly mentioning 'grep' for exact/regex and 'batch_read' for caching more files.

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?

The description provides explicit usage guidance: it states that files must be cached first (using 'read'/'batch_read') and advises when to use alternatives ('grep' for exact/regex, 'batch_read' to cache more). This helps the agent choose correctly.

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/CoderDayton/semantic-cache-mcp'

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