Skip to main content
Glama

spec_nav_find_functions

Find existing functions by describing desired behavior in words before writing new logic. Returns function IDs for further reading.

Instructions

Before writing new logic: find existing functions by describing the behaviour in words ("calculate order fee"). Lexical ranking over name, aliases, class, signature, doc comment, path, called names and body, with stem, abbreviation and synonym matching; each candidate says why it matched, and matches only via calls or body rank lower. Not semantic: if nothing fits, use spec_nav_similar_functions. Returns ids for spec_nav_read_function. Paged by limit/cursor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoOnly files whose path contains this, matches it as a * glob, or as a regex (/…/, or a value with | ( ^ $ \, e.g. "services/(order|payment)").
limitNoCandidates per page (default 20, max 100).
queryNoWhat the function does, in words. E.g. "calculate order fees"
cursorNoThe nextCursor from the previous page. Repeat the other arguments unchanged.
formatNo"text" (default, compact) or "json" (structured).
queriesNoUp to 5 phrasings (synonyms, another language), ranked together in one call; each result says which matched.
languageNoe.g. "typescript", "javascript", "python", "go"
servicesNoServices/directories relative to the root (e.g. "services/api"); "." is the root project's own files. Default: the whole repo.
searchBodiesNoAlso match words in function bodies (default true; weighted low; body-only matches need every word). false drops body-only matches.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.8.0
    • changedInput schema / properties / file / description
      Previous value: -"Only files whose path contains this (or matches it, with * globs)."New value: +"Only files whose path contains this, matches it as a * glob, or as a regex (/…/, or a value with | ( ^ $ \\, e.g. \"services/(order|payment)\")."
    • addedInput schema / properties / queries
      Added value: +{
      +  "description": "Up to 5 phrasings (synonyms, another language), ranked together in one call; each result says which matched.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "maxItems": 5,
      +  "type": "array"
      +}
    • 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."
    • removedInput schema / required
      Removed value: -[
      -  "query"
      -]
  2. First observedv0.4.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and mostly does: it discloses the matched fields, stemming/abbreviation/synonym handling, that each candidate explains its match, and that call-only or body-only matches rank lower. It does not state the read-only nature explicitly or describe output shape beyond 'ids', but the behavioural disclosure is well above average.

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?

The most important sentence, the pre-writing trigger, is front-loaded, and the whole thing fits in a dense paragraph with no filler. It is semicolon-heavy and slightly crowded, but each clause carries distinct information rather than restating the name.

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 9-parameter search tool with full schema coverage and no output schema, the description covers the two things the schema cannot: the ranking model and the handoff to spec_nav_similar_functions / spec_nav_read_function. It omits any description of the returned candidate fields and how 'text' vs 'json' output differ, which keeps it short of a 5.

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 limit/cursor/file/queries/format are all already documented; the description mostly repeats paging ('Paged by limit/cursor') and adds no syntax or format detail beyond the schema. The one value-add is the ranking note that body-only matches need every word, which is already stated in the searchBodies field description.

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 and resource ('find existing functions') plus the unusual input mode ('describing the behaviour in words'), which is enough to separate it from spec_nav_functions and the sibling tools. It also names the lexical ranking surface it searches, so the agent knows exactly what this tool does rather than having to infer it.

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?

Opens with an explicit trigger ('Before writing new logic') and gives an explicit when-not plus alternative ('Not semantic: if nothing fits, use spec_nav_similar_functions'). It also routes the follow-up step ('Returns ids for spec_nav_read_function'), so the agent knows both when to enter and what to do next.

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