Skip to main content
Glama
Reflex

Reflex

Official

find_references

Locate every code line where an identifier is used plus its definition, excluding comments and strings by default. Filter by language, glob, symbol kind, or return only counts.

Instructions

Every line where a name (any identifier, not only a symbol) is used in code, plus its definition, in code files only. Lines where it is only in a comment or string are left out by a whole-file scan, so no re-check is needed (include_strings:true keeps them). Answer: {definition, references, total_references, returned_count, filtered_out, pagination}; mode:"count" returns the count after filtering.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pattern": "<pattern>"
    },
    "name": "find_references"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoOnly paths containing this substring
globNoOnly paths matching (gitignore rules)
kindNoSymbol kind of the definition
langNoLanguage filter: rust, python, typescript, text, …
modeNocount: {count, files} only
limitNoMax results (default 200, at most 500)
offsetNoSkip this many results (next page)
patternYesText to find
containsNoSubstring match (grep -F) instead of whole identifiers
ignore_caseNoCase-insensitive (rg -i)
include_locksNoAlso search lock files
include_stringsNoKeep matches in strings and comments
include_generatedNoAlso search generated files

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.3.1
    • removedInput schema / properties / exclude
      Removed value: -{
      -  "description": "Skip paths matching (gitignore rules)",
      -  "items": {
      -    "type": "string"
      -  },
      -  "type": "array"
      -}
    • removedInput schema / properties / force
      Removed value: -{
      -  "description": "Run a pattern too broad to run by default",
      -  "type": "boolean"
      -}
  2. Changed15 schema fields changedv2.0.3
    • changedInput schema / properties / contains / description
      Previous value: -"Substring matching, like `grep -F`. DEFAULT IS FALSE, which matches WHOLE IDENTIFIERS ONLY: pattern \"verify_csrf\" does NOT match \"verify_csrf_form_field\", and \"jwks_rps\" does NOT match \"jwks_rps_limit\". Pass true to find a pattern anywhere inside a longer identifier. If a search returns 0, check the response `hint` — it reports how many substring matches exist."New value: +"Substring match (grep -F) instead of whole identifiers"
    • changedInput schema / properties / exclude / description
      Previous value: -"Exclude files matching glob patterns (e.g., ['target/**', 'tests/**']) Patterns follow gitignore rules: a pattern containing '/' (src/**/*.rs) is anchored at the index root; a bare name (*.rs, Makefile) matches at any depth; **/src/**/*.rs matches src/ anywhere; * does not cross /."New value: +"Skip paths matching (gitignore rules)"
    • addedInput schema / properties / file
      Added value: +{
      +  "description": "Only paths containing this substring",
      +  "type": "string"
      +}
    • changedInput schema / properties / force / description
      Previous value: -"Force execution of potentially expensive queries (bypasses broad query detection)"New value: +"Run a pattern too broad to run by default"
    • changedInput schema / properties / glob / description
      Previous value: -"Include files matching glob patterns (e.g., ['src/**/*.rs']) Patterns follow gitignore rules: a pattern containing '/' (src/**/*.rs) is anchored at the index root; a bare name (*.rs, Makefile) matches at any depth; **/src/**/*.rs matches src/ anywhere; * does not cross /."New value: +"Only paths matching (gitignore rules)"
    • changedInput schema / properties / ignore_case / description
      Previous value: -"Match letters regardless of case, like `rg -i` (`ignore_case` + `contains` is `rg -i -F`). Default false. The trigram index is still used, so this costs about the same as a case-sensitive search."New value: +"Case-insensitive (rg -i)"
    • addedInput schema / properties / include_generated
      Added value: +{
      +  "description": "Also search generated files",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / include_locks
      Added value: +{
      +  "description": "Also search lock files",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / include_strings / description
      Previous value: -"Include matches inside string literals and comments (default: false). By default these are excluded to focus on real call sites."New value: +"Keep matches in strings and comments"
    • changedInput schema / properties / kind / description
      Previous value: -"Filter definition lookup by symbol kind (function, class, struct, trait, etc.)"New value: +"Symbol kind of the definition"
    • changedInput schema / properties / lang / description
      Previous value: -"Filter by language (rust, typescript, python, go, etc.)"New value: +"Language filter: rust, python, typescript, text, …"
    • changedInput schema / properties / limit / description
      Previous value: -"Max references per page (default: 200, max: 500). The 200-result default covers most find-all tasks in a single call. Pagination applies to references only."New value: +"Max results (default 200, at most 500)"
    • changedInput schema / properties / mode / description
      Previous value: -"Response mode: \"list\" (default) returns full results with definition + references; \"count\" returns only {count, pattern}: every reference AFTER string/comment filtering (all pages, not one); with include_strings:true it is the raw total and equals list-mode total_references."New value: +"count: {count, files} only"
    • changedInput schema / properties / offset / description
      Previous value: -"Pagination offset for references (skip first N). Use with limit."New value: +"Skip this many results (next page)"
    • changedInput schema / properties / pattern / description
      Previous value: -"Symbol name or text pattern to find references for (e.g., 'CacheManager', 'extract_symbols')"New value: +"Text to find"
  3. Changed5 schema fields changedv2.0.1
    • addedInput schema / properties / contains
      Added value: +{
      +  "description": "Substring matching, like `grep -F`. DEFAULT IS FALSE, which matches WHOLE IDENTIFIERS ONLY: pattern \"verify_csrf\" does NOT match \"verify_csrf_form_field\", and \"jwks_rps\" does NOT match \"jwks_rps_limit\". Pass true to find a pattern anywhere inside a longer identifier. If a search returns 0, check the response `hint` — it reports how many substring matches exist.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / exclude / description
      Previous value: -"Exclude files matching glob patterns (e.g., ['target/**', 'tests/**'])"New value: +"Exclude files matching glob patterns (e.g., ['target/**', 'tests/**']) Patterns follow gitignore rules: a pattern containing '/' (src/**/*.rs) is anchored at the index root; a bare name (*.rs, Makefile) matches at any depth; **/src/**/*.rs matches src/ anywhere; * does not cross /."
    • changedInput schema / properties / glob / description
      Previous value: -"Include files matching glob patterns (e.g., ['src/**/*.rs'])"New value: +"Include files matching glob patterns (e.g., ['src/**/*.rs']) Patterns follow gitignore rules: a pattern containing '/' (src/**/*.rs) is anchored at the index root; a bare name (*.rs, Makefile) matches at any depth; **/src/**/*.rs matches src/ anywhere; * does not cross /."
    • addedInput schema / properties / ignore_case
      Added value: +{
      +  "description": "Match letters regardless of case, like `rg -i` (`ignore_case` + `contains` is `rg -i -F`). Default false. The trigram index is still used, so this costs about the same as a case-sensitive search.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / mode / description
      Previous value: -"Response mode: \"list\" (default) returns full results with definition + references; \"count\" returns only {count, pattern} — faster, skips match body serialization."New value: +"Response mode: \"list\" (default) returns full results with definition + references; \"count\" returns only {count, pattern}: every reference AFTER string/comment filtering (all pages, not one); with include_strings:true it is the raw total and equals list-mode total_references."
  4. Changed3 schema fields changedv1.6.0
    • addedInput schema / properties / include_strings
      Added value: +{
      +  "description": "Include matches inside string literals and comments (default: false). By default these are excluded to focus on real call sites.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / limit / description
      Previous value: -"Max references per page (default: 100). Pagination applies to references only."New value: +"Max references per page (default: 200, max: 500). The 200-result default covers most find-all tasks in a single call. Pagination applies to references only."
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "Response mode: \"list\" (default) returns full results with definition + references; \"count\" returns only {count, pattern} — faster, skips match body serialization.",
      +  "enum": [
      +    "list",
      +    "count"
      +  ],
      +  "type": "string"
      +}
  5. First observedv1.0.0

TDQS

A3.6/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 does real work: it discloses the filtering behavior (comment/string-only lines are dropped by a whole-file scan, so callers need not re-verify), the include_strings override, and the exact answer shape including pagination fields and the count mode. It never states the read-only nature explicitly, which is left implicit in the name 'find'.

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?

Front-loaded with the core behavior in the first clause, then the filtering nuance, then the return shape. Dense but every sentence contributes; the parenthetical asides are slightly cramped but not wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 13-parameter tool with no output schema, supplying the answer shape is a meaningful addition. However, the definition leaves the agent without sibling routing guidance and without any statement of read-only vs mutating behavior, which is the main remaining gap for a tool of this complexity.

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 coverage is 100%, so all 13 parameters are already documented, and the baseline of 3 applies. The description adds only marginal nuance — that mode:"count" returns the count after filtering — while most parameters (glob, kind, lang, ignore_case) are left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource: finds every line where a name is used, plus its definition, restricted to code files, and explicitly clarifies it is any identifier rather than only a declared symbol. That scope distinction separates it from a plain text search, but it never names or contrasts with the sibling search_code.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: you use it to locate references to a name, and include_strings:true is given as an opt-in for comment/string hits. There is no explicit 'use this instead of search_code when…' guidance, nor any note on when definition-only lookup or list_locations would be more appropriate.

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