Skip to main content
Glama

spec_nav_similar_functions

Find functions that behave like a given one by comparing their calls and body vocabulary, regardless of names. Use before edits to spot copied logic; review matches, as similarity is not equivalence.

Instructions

Find functions that behave like a given one, whatever they are named, by comparing the calls they make and their body vocabulary. Subject: id, file+name, or code (a draft). Use on a draft before adding code, on a candidate to find siblings, or before changing logic that may be copied elsewhere. Ranked candidates list the calls and words they share. Similar is not interchangeable: read both.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoFunction id from another spec_nav tool.
codeNoSource of a draft or external function to compare instead.
fileNoFile of the subject function, relative to the root.
lineNoA line inside the subject, to disambiguate.
nameNoName of the subject function in `file`.
limitNoCandidates per page (default 10, max 100).
cursorNoThe nextCursor from the previous page. Repeat the other arguments unchanged.
formatNo"text" (default, compact) or "json" (structured).
inFileNoOnly candidates in files whose path contains this (or matches it, with * globs).
languageNo
minScoreNoLowest similarity listed (default 0.2).
servicesNoServices/directories relative to the root (e.g. "services/api"); "." is the root project's own files. Default: the whole repo.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • changedInput schema / properties / services / description
      Previous value: -"Limit to these services/directories, relative to SPEC_NAV_ROOT (e.g. \"services/api\", \"packages\"). \".\" is the root project's own files. Omit to cover the whole repo — the default."New value: +"Services/directories relative to the root (e.g. \"services/api\"); \".\" is the root project's own files. Default: the whole repo."
  2. First observedv0.4.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are provided, so the description carries the burden. It discloses the comparison mechanism, the ranked-candidate output shape (with shared calls/words), and an important caveat ('Similar is not interchangeable: read both'), which warns against treating results as drop-in replacements. It does not state read-only status or pagination behavior, though cursor/limit in the schema imply paging.

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?

Front-loads purpose, then subject forms, then usage, then output, then caveat. Every sentence carries information with no filler; the caveat sentence in particular earns its place.

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?

For a 12-parameter, no-annotation, no-output-schema tool, the description covers mechanism, subject selection, usage context, output shape, and a caution. The remaining filtered parameters (services, inFile, minScore, format) are well documented by the schema itself, so little is missing.

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 92%, so the baseline is 3, but the description adds genuine value by clarifying the three alternative subject forms (id, file+name, or code for a draft) that the schema lists only as separate undifferentiated properties. It also hints at output content ('ranked candidates list the calls and words they share').

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?

States a specific verb (find), resource (functions), and the distinctive mechanism (comparing calls made and body vocabulary) plus the key differentiator 'whatever they are named'. An agent can immediately distinguish this semantic-similarity search from siblings like spec_nav_find_functions (name search) and spec_nav_callers (reverse call lookup).

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

Usage Guidelines4/5

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

Gives three concrete use scenarios: on a draft before adding code, on a candidate to find siblings, and before changing logic that may be copied elsewhere. The contrast with name-based search is implied by 'whatever they are named', but no sibling tool is named explicitly and there is no 'when not to use' exclusion.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.