Skip to main content
Glama
Reflex

Reflex

Official

list_locations

Locate every line where a text pattern occurs and return matches grouped by file, optionally including line previews.

Instructions

Where does X occur? Every matching line, by file: {path: [line, ...]}; a line with two matches appears once, like grep -n. The cheapest search, no limit. preview:true gives [line, text] pairs (text trimmed, 120 chars). Same matching as search_code.

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": "list_locations"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoOnly paths containing this substring
globNoOnly paths matching (gitignore rules)
langNoLanguage filter: rust, python, typescript, text, …
patternYesText to find
previewNoAdd each matching line (120 chars)
containsNoSubstring match (grep -F) instead of whole identifiers
ignore_caseNoCase-insensitive (rg -i)
include_locksNoAlso search lock files
include_generatedNoAlso search generated files

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.3.1
    • removedInput schema / properties / dependencies
      Removed value: -{
      -  "description": "Attach each file's imports",
      -  "type": "boolean"
      -}
    • 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. Changed12 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 / dependencies / description
      Previous value: -"Include dependency information (imports) in results. Only extracts static imports."New value: +"Attach each file's imports"
    • changedInput schema / properties / exclude / description
      Previous value: -"Exclude files matching patterns (e.g., ['vendor/**', '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)"
    • changedInput schema / properties / file / description
      Previous value: -"Filter by file path substring (e.g., 'Controllers')"New value: +"Only paths containing this substring"
    • 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 patterns (e.g., ['app/**/*.php']) 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)"
    • changedInput schema / properties / include_generated / description
      Previous value: -"Also search generated files by name (*.pb.go, *.min.js, *.min.css, *.map, *_generated.*). Indexed but left out unless asked for; `lang: \"generated\"` selects them alone. Default false."New value: +"Also search generated files"
    • changedInput schema / properties / include_locks / description
      Previous value: -"Also search lock files (Cargo.lock, package-lock.json, *.lock, go.sum). They are indexed but left out unless asked for; `lang: \"lock\"` selects them alone. Default false."New value: +"Also search lock files"
    • changedInput schema / properties / lang / description
      Previous value: -"Filter by language: rust, typescript, javascript, go, java, php, kotlin, python, c, cpp, csharp, ruby, vue, svelte, zig — or \"text\" for the plain-text tier (every other non-binary file: docs, config, templates, extensionless), \"lock\" for lock files, \"generated\" for generated files (the last two are excluded unless named or include_locks / include_generated is set)."New value: +"Language filter: rust, python, typescript, text, …"
    • changedInput schema / properties / pattern / description
      Previous value: -"Search pattern (text to find)"New value: +"Text to find"
    • addedInput schema / properties / preview
      Added value: +{
      +  "description": "Add each matching line (120 chars)",
      +  "type": "boolean"
      +}
  3. Changed7 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 patterns (e.g., ['vendor/**', 'tests/**'])"New value: +"Exclude files matching patterns (e.g., ['vendor/**', '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 patterns (e.g., ['app/**/*.php'])"New value: +"Include files matching patterns (e.g., ['app/**/*.php']) 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"
      +}
    • addedInput schema / properties / include_generated
      Added value: +{
      +  "description": "Also search generated files by name (*.pb.go, *.min.js, *.min.css, *.map, *_generated.*). Indexed but left out unless asked for; `lang: \"generated\"` selects them alone. Default false.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / include_locks
      Added value: +{
      +  "description": "Also search lock files (Cargo.lock, package-lock.json, *.lock, go.sum). They are indexed but left out unless asked for; `lang: \"lock\"` selects them alone. Default false.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / lang / description
      Previous value: -"Filter by language (php, rust, typescript, python, etc.)"New value: +"Filter by language: rust, typescript, javascript, go, java, php, kotlin, python, c, cpp, csharp, ruby, vue, svelte, zig — or \"text\" for the plain-text tier (every other non-binary file: docs, config, templates, extensionless), \"lock\" for lock files, \"generated\" for generated files (the last two are excluded unless named or include_locks / include_generated is set)."
  4. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the behavioral burden and discloses key traits: every matching line is returned by file, duplicate matches on one line are collapsed like grep -n, there is no limit, and preview changes the return shape with trimmed 120-character text. It omits permissions, error behavior, and ordering details, but covers the main search behavior well.

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 tightly front-loaded, starting with the core question and immediately giving the return shape. Every sentence and fragment carries useful information with no filler.

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 nine-parameter search tool with no output schema and no annotations, the description adequately explains the return value, deduplication, lack of limit, preview behavior, and matching semantics. The schema handles the filters, though the description could say more about default inclusion of lock and generated files.

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 the baseline is 3. The description adds meaningful value beyond the schema by explaining that preview:true returns [line, text] pairs with trimmed text and by clarifying matching semantics with search_code.

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 states the operation as locating every occurrence of a pattern and gives the exact result shape keyed by file path with line numbers. It distinguishes itself from search_code by being the cheapest search with no limit and by sharing the same matching semantics.

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?

It frames itself as the cheapest search with no limit and says it uses the same matching as search_code, which gives clear context for choosing it over a more expensive or limited search. It does not explicitly state when not to use it or route to the other siblings, but the guidance is clear enough.

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