Skip to main content
Glama

repo_find_symbol

Idempotent

Look up a symbol or file's node_id by name, or by path and line (the symbols enclosing that line, innermost first, then the file), for feeding into repo_neighbours, repo_read, repo_path_between or repo_blast_radius.

Instructions

Look up a symbol or file's node_id by name, or by path and line (the symbols enclosing that line, innermost first, then the file), for feeding into repo_neighbours, repo_read, repo_path_between or repo_blast_radius. Read-only, deterministic, zero side effects, secret files (.env) excluded. A name matches exactly first, then case-insensitively, then as a qualname's last segment; an ambiguous name returns every candidate, with its path. When to use: you know a name (from a traceback, a grep, a review comment) or a file position and want its node_id with no repo_search round trip. When NOT to use: not for open-ended text search (use repo_search) or for repo layout (use repo_map). Output: JSON array of {node_id, name, qualname, kind, path, start_line, end_line, lang}.

Input Schema

NameRequiredDescriptionDefault
kindNoOptional exact node kind filter (e.g. 'function', 'class', 'method').
lineNoOptional 1-based line in `path` (min 1): only the symbols whose span contains it, innermost first, then the file node.
nameNoSymbol or file name to look up (e.g. 'validate_token'). May be omitted when `path` and `line` are given.
pathNoOptional exact repo-relative file path (e.g. 'pkg/mod.py'): only nodes in that file.
limitNoMaximum candidates returned (default 20, min 1, max 50).
path_prefixNoOptional path prefix filter, e.g. 'pkg/'.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv4.0.0
    • addedInput schema / properties / line
      Added value: +{
      +  "description": "Optional 1-based line in `path` (min 1): only the symbols whose span contains it, innermost first, then the file node.",
      +  "type": "integer"
      +}
    • changedInput schema / properties / name / description
      Previous value: -"Symbol or file name to look up (e.g. 'validate_token')."New value: +"Symbol or file name to look up (e.g. 'validate_token'). May be omitted when `path` and `line` are given."
    • addedInput schema / properties / path
      Added value: +{
      +  "description": "Optional exact repo-relative file path (e.g. 'pkg/mod.py'): only nodes in that file.",
      +  "type": "string"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "name"
      -]New value: +[]
  2. Addedv3.0.0

TDQS

A3.9/5.0
Behavior1/5

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

The description asserts 'Read-only, deterministic, zero side effects', but the annotations declare readOnlyHint=false. This is a direct conflict an agent cannot reconcile when deciding whether the call is safe. The genuine added context (secret files such as .env excluded, name-matching order, ambiguity behavior) is real, but the annotations-vs-description contradiction dominates.

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?

One dense, well-structured block: purpose first, then lookup semantics, then when/when-not, then output shape. Every sentence carries information, though the run-on first sentence packs several distinct ideas and could be split for faster scanning.

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?

With no output schema, the description compensates by enumerating the return shape ({node_id, name, qualname, kind, path, start_line, end_line, lang}). Combined with sibling routing and the .env exclusion, an agent has nearly everything it needs; only the unresolved readOnlyHint conflict leaves a residual gap.

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 description coverage is 100%, so baseline is 3, and the description earns an extra point for match-resolution semantics the schema does not state: exact match first, then case-insensitive, then qualname's last segment, with every candidate plus its path returned on ambiguity, and line lookups returning enclosing symbols innermost-first.

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 concrete verb+resource (look up a symbol or file's node_id) plus the two input modes (by name, or by path+line) and the downstream consumers (repo_neighbours, repo_read, repo_path_between, repo_blast_radius). It is clearly distinguishable from repo_search and repo_map, which it names explicitly.

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?

Contains explicit 'When to use' (known name from a traceback/grep/review comment, or a file position, avoiding a repo_search round trip) and 'When NOT to use' (open-ended text search → repo_search; repo layout → repo_map) sections naming the alternatives. Routing is fully determined.

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