Skip to main content
Glama
reflex-search

Reflex

Official

search_code

Perform full-text or symbol-only searches to find code definitions and usages, returning line numbers and code previews.

Instructions

Full-text or symbol-only code search with detailed results.

When to use search_regex instead:

  • Patterns with special characters: -> :: () [] {} . * + ? \ | ^ $

  • Complex pattern matching: wildcards, alternation, anchors

  • Examples: '->with(', '::new', 'function*', '[derive]', 'fn (get|set)_.*'

Search modes:

  • Full-text (default): Finds ALL occurrences - definitions + usages

  • Symbol-only (symbols=true): Finds ONLY definitions where symbols are declared

Use this for:

  • Simple text patterns (alphanumeric, underscores, hyphens)

  • Detailed analysis with line numbers and code previews

  • Symbol definition searches

Pagination: Check response.pagination.has_more. If true, use offset parameter to fetch next page.

Error Handling: If you receive an error message containing "Index not found" or "stale", immediately call the index_project tool, wait for it to complete, then retry this operation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dependenciesNoInclude dependency information (imports) in results. **IMPORTANT:** Currently only supported for Rust files — passing this with any other language (typescript, python, go, etc.) will produce no dependency data. Only extracts static imports (string literals); dynamic imports are filtered. See CLAUDE.md for details.
exactNoExact match (no substring matching)
excludeNoExclude files matching glob patterns (e.g., 'target/**')
expandNoShow full symbol body (not just signature)
fileNoFilter by file path (substring)
forceNoForce execution of potentially expensive queries (bypasses broad query detection)
globNoInclude files matching glob patterns (e.g., 'src/**/*.rs')
kindNoFilter by symbol kind (function, class, struct, etc.)
langNoFilter by language (rust, typescript, python, etc.)
limitNoMaximum results per page (default: 100). IMPORTANT: If response.pagination.has_more is true, you MUST fetch more pages using offset parameter.
offsetNoPagination offset (skip first N results). ALWAYS paginate when has_more=true. Example: First call offset=0, second call offset=100, third offset=200, etc.
pathsNoReturn only unique file paths (not full results)
patternYesSearch pattern (text to find)
preview_lengthNoMaximum characters per preview line (default: 180). Use a smaller value (e.g. 60) for wide-result scans where short previews are sufficient.
symbolsNoSymbol-only search (definitions, not usage)
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It fully discloses behavioral traits: full-text vs symbol-only behavior, pagination details, error handling (retry with index_project), and the Rust-only limitation for dependencies. No contradictions.

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 well-structured with clear sections (when to use search_regex, search modes, use this for, pagination, error handling). While it is fairly long, it earns its length by providing essential information. Slightly verbose for the main purpose, but still well-organized.

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

Completeness5/5

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

Given the high parameter count (15) and no output schema, the description covers all necessary aspects: usage guidelines, error handling, pagination, parameter details. It is very complete and leaves no critical gaps for an agent to effectively use the tool.

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 coverage is 100%, so baseline is 3. However, the description adds significant value beyond the schema, such as explaining the Rust-only limitation for 'dependencies', how to use 'offset' and 'limit' for pagination, and suggestions for 'preview_length'. This justifies a score of 4.

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 clearly states it performs full-text or symbol-only code search with detailed results. It explicitly distinguishes from search_regex by specifying when to use each, making the tool's purpose very clear.

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?

Provides explicit guidance on when to use search_regex vs search_code, search modes (full-text/symbol-only), and use cases. Also includes pagination instructions and error handling steps, which are crucial for proper usage.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/reflex-search/reflex'

If you have feedback or need assistance with the MCP directory API, please join our Discord server