Skip to main content
Glama
reflex-search

Reflex

Official

search_regex

Search code using regular expressions to find patterns like alternations, classes, and anchors. Filter by language, path, or glob to return matching lines or counts.

Instructions

Search code with a regular expression (Rust regex): alternation, classes, anchors, e.g. fn (get|set)_\w+ or ->with\(. In JSON double each backslash. Same filters and answer as search_code.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoOnly paths containing this substring
globNoOnly paths matching (gitignore rules)
langNoLanguage filter: rust, python, typescript, text, …
modeNocount: {count, files} only
forceNoRun a pattern too broad to run by default
limitNoMax results (default 200, at most 500)
pathsNoReturn file paths only
offsetNoSkip this many results (next page)
excludeNoSkip paths matching (gitignore rules)
patternYesText to find
ignore_caseNoCase-insensitive (rg -i)
dependenciesNoAttach each file's imports
include_locksNoAlso search lock files
include_generatedNoAlso search generated files

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed14 schema fields changedv2.0.3
    • 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 glob patterns 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"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 glob patterns 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\" (docs, config and every other non-binary file), \"lock\" (lock files), \"generated\" (generated files by name)."New value: +"Language filter: rust, python, typescript, text, …"
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results (default: 200, max: 500). Use with offset for pagination."New value: +"Max results (default 200, at most 500)"
    • changedInput schema / properties / mode / description
      Previous value: -"Response mode: \"list\" (default) returns full match results; \"count\" returns only {count, pattern} — faster, skips match body serialization."New value: +"count: {count, files} only"
    • changedInput schema / properties / offset / description
      Previous value: -"Pagination offset (skip first N results after sorting)"New value: +"Skip this many results (next page)"
    • changedInput schema / properties / paths / description
      Previous value: -"Return only unique file paths: the response is `{status, can_trust_results, paths, total_files}` (plus `has_more` when a `limit` cut the list) instead of `{columns, rows}`. Without `limit`, every matching file is listed."New value: +"Return file paths only"
    • changedInput schema / properties / pattern / description
      Previous value: -"Regex pattern"New value: +"Text to find"
  2. Changed7 schema fields changedv2.0.1
    • changedInput schema / properties / exclude / description
      Previous value: -"Exclude files matching glob patterns"New value: +"Exclude files matching glob patterns 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"New value: +"Include files matching glob patterns 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"New value: +"Filter by language: rust, typescript, javascript, go, java, php, kotlin, python, c, cpp, csharp, ruby, vue, svelte, zig — or \"text\" (docs, config and every other non-binary file), \"lock\" (lock files), \"generated\" (generated files by name)."
    • changedInput schema / properties / paths / description
      Previous value: -"Return only unique file paths"New value: +"Return only unique file paths: the response is `{status, can_trust_results, paths, total_files}` (plus `has_more` when a `limit` cut the list) instead of `{columns, rows}`. Without `limit`, every matching file is listed."
  3. Changed2 schema fields changedv1.6.0
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results (use with offset for pagination)"New value: +"Maximum number of results (default: 200, max: 500). Use with offset for pagination."
    • addedInput schema / properties / mode
      Added value: +{
      +  "description": "Response mode: \"list\" (default) returns full match results; \"count\" returns only {count, pattern} — faster, skips match body serialization.",
      +  "enum": [
      +    "list",
      +    "count"
      +  ],
      +  "type": "string"
      +}
  4. First observedv1.0.0

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It discloses useful regex-specific behavior: Rust regex syntax, examples, and JSON backslash escaping. It also says 'Same filters and answer as search_code,' which conveys some result semantics by reference. However, it does not state read-only nature, output format details, or pagination behavior explicitly.

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 description is front-loaded with purpose and stays compact. Each sentence adds value: regex syntax details, escaping instructions, and a reference to search_code for filters and answer shape. It avoids unnecessary length while remaining readable.

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?

Given 14 parameters, no annotations, and no output schema, the description is adequate but not fully complete. The schema covers parameter semantics well, and the description handles regex syntax and escaping. However, because there is no output schema, the description's reference to 'answer as search_code' leaves return format details dependent on another tool's definition.

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 schema documents all 14 parameters. The description adds meaningful context for the required pattern parameter by clarifying that it is a Rust regular expression with alternation, classes, and anchors, and by explaining JSON backslash doubling. This goes beyond the schema's vague 'Text to find' for the most important parameter.

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?

The description states a specific verb and resource: 'Search code with a regular expression (Rust regex).' It also names the regex engine and gives examples. However, it does not explicitly distinguish search_regex from the sibling search_code beyond saying 'Same filters and answer as search_code,' leaving the choice between them to inference.

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

Usage Guidelines2/5

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

There is no explicit when-to-use guidance or comparison with alternatives. The reference to search_code implies similarity but does not say when to use regex search instead of plain code search. No exclusions or prerequisites are provided.

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