Skip to main content
Glama

similar

Find semantically similar cached files to a given source file. Use to discover related code, tests, or configs after seeding the cache with batch_read.

Instructions

Find cached files semantically similar to one source file.

Use this to discover related implementations, tests, or configs after the surrounding code has already been seeded into the cache.

Important constraint:

  • The source file is handled automatically.

  • Candidate neighbor files must already be cached, typically via batch_read, or they will not appear.

Usage guidance:

  • Seed a directory with batch_read first.

  • Start with k=3 to k=5.

  • Empty results usually mean either only the source file is cached or the relevant neighbors were never seeded.

Args: path: Source file path. k: Maximum number of similar files to return.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
kNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
truncatedNo
source_pathNo
similar_filesNo
source_tokensNo
files_searchedNo
kNo
Behavior5/5

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

Despite no annotations, the description reveals critical behavior: it relies on cache, is a read operation (implied by 'find'), and explains constraints. There is no contradiction with missing annotations.

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 well-organized into clear sections (purpose, constraint, usage guidance, args). It is concise with no redundant sentences.

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 the presence of an output schema, the description does not need to explain return values. It covers purpose, prerequisites, usage, and parameter details, making it complete for this tool's complexity.

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?

With 0% schema description coverage, the description fully compensates by explaining both parameters: path (source file path) and k (max similar files, with recommended range). This adds significant meaning beyond the bare schema.

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's purpose: 'Find cached files semantically similar to one source file.' It uses a specific verb and resource, and given the sibling list (batch_read, search, etc.), 'similar' is distinct as a semantic similarity search.

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: when to use (after seeding cache), prerequisites (candidate neighbor files must be cached), and even recommends starting k=3 to 5. It also explains what empty results mean.

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