Skip to main content
Glama

find_related

Find code chunks semantically similar to a known file and line. Use after search to get related code for context injection.

Instructions

Find code chunks semantically similar to a known file and one-based line.

Use this after search returns a promising location. Pass the file path exactly as it appears in a result and a line inside that chunk. Results include formatted text for context injection and structured fields.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYesRepository-relative file path exactly as shown in a search result.
limitNoMaximum number of related chunks to return.
lineYesOne-based line number inside the known chunk.
profileNoSaved profile to use for source defaults.
sourceNoGit URL or local path. Omit only when the server has a default source.
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes the tool as finding similar chunks, implying a read-only operation, but does not explicitly state that it has no side effects or any behavioral constraints. This is adequate but not complete.

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 two short paragraphs. The first sentence states the purpose, and the second provides usage context. No unnecessary words.

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 no output schema and 5 parameters (all described in schema), the description provides adequate context: when to use, required inputs, and what results include. It lacks an explicit statement about safety (read-only) but is otherwise complete.

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 description coverage is 100%, so the parameter meanings are already defined in the input schema. The description adds minimal extra context beyond reinforcing the schema (e.g., file path 'exactly as in a result'). Baseline 3 is appropriate.

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 it finds semantically similar code chunks given a file and line number. It distinguishes from sibling 'search' by indicating it is used after 'search' returns a promising location.

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?

Explicitly says to use after 'search' and specifies that the file path must match a search result exactly and the line must be inside that chunk. This provides clear when-to-use guidance.

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/tristanmanchester/sifs'

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