Skip to main content
Glama
reflex-search

Reflex

Official

search_code

Search entire codebase for text patterns, returning file paths, line numbers, and code previews. Supports symbol definitions and usage counts.

Instructions

Default code search across the whole codebase. Prefer this over Grep / grep -rn / Glob for any pattern made of letters, digits, underscores, or hyphens — one call returns every occurrence with file paths, line numbers, and code previews. Use this for: finding where a pattern occurs; listing all usages of a function/class/variable; finding a symbol's definition (with symbols: true); getting line numbers + previews in a single call.

Modes: full-text by default (definitions + usages); symbols: true returns definitions only; mode: "count" returns just {count, pattern} to check cardinality before paginating. For patterns containing special characters (->, ::, (), [], .*+?\|^$), use search_regex instead.

Result shape is columnar: {columns, rows} — each row aligns positionally to columns (path, language, start_line, end_line, preview; then kind/symbol/context when present). Set env REFLEX_MCP_COLUMNAR=0 for the legacy results[] shape.

Pagination: if response.pagination.has_more is true, fetch the next page with the offset parameter. On "Index not found" / "stale" error, call index_project, then retry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoFilter by file path (substring)
globNoInclude files matching glob patterns (e.g., 'src/**/*.rs')
kindNoFilter by symbol kind (function, class, struct, etc.)
langNoFilter by language (rust, typescript, python, etc.)
modeNoResponse mode: "list" (default) returns full match results; "count" returns only {count, pattern} — faster, skips match body serialization.
exactNoExact match (no substring matching)
forceNoForce execution of potentially expensive queries (bypasses broad query detection)
limitNoMaximum results per page (default: 200, max: 500). The 200-result default covers most find-all tasks in a single call. IMPORTANT: If response.has_more is true, you MUST fetch more pages using offset parameter.
pathsNoReturn only unique file paths (not full results)
expandNoShow full symbol body (not just signature)
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.
excludeNoExclude files matching glob patterns (e.g., 'target/**')
patternYesSearch pattern (text to find)
symbolsNoSymbol-only search (definitions, not usage)
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.
preview_lengthNoMaximum characters per preview line (default: 180). Use a smaller value (e.g. 60) for wide-result scans where short previews are sufficient.
Behavior5/5

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

With no annotations, the description fully covers modes (full-text, symbols, count), result shape (columnar vs legacy), pagination behavior, error handling (call `index_project` on stale index), and parameter-specific limitations (e.g., `dependencies` only for Rust).

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?

Well-structured with sections for summary, modes, result shape, pagination, error handling. Front-loaded with purpose. Slightly lengthy with some details (e.g., environment variable) that could be omitted but overall 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 16 parameters and no output schema, the description covers all critical behaviors: modes, pagination, error handling, result format, and parameter-specific caveats. Complete for selecting and invoking the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Every parameter has a schema description (100% coverage). The tool description adds extra context beyond schema, e.g., for `limit`, `dependencies`, `mode`, `preview_length`, clarifying defaults, important notes, and usage tips.

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 is the default code search for the whole codebase, specifying the verb 'search' and resource 'codebase'. It distinguishes from sibling tools like `search_regex` by noting pattern constraints.

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 when-to-use scenarios (finding occurrences, usages, definitions) and when-not-to-use (special characters -> use `search_regex`). Includes pagination and error handling instructions.

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