Skip to main content
Glama
reflex-search

Reflex

Official

search_ast

Perform Tree-sitter structural code searches. Specify a glob to limit files and avoid slow full-project parsing.

Instructions

Tree-sitter structural search, e.g. (function_item) @fn. Slow: parses every file that lang and glob select, so always pass glob. Prefer search_code with symbols:true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoOnly paths containing this substring
globNoOnly paths matching (gitignore rules)
langYesLanguage of the query
forceNoRun without a glob
limitNoMax results (default 200, at most 500)
pathsNoReturn file paths only
offsetNoSkip this many results (next page)
excludeNoSkip paths matching
patternYesTree-sitter query (S-expression)
dependenciesNoAttach each file's imports

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 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 (e.g., ['target/**', 'node_modules/**']) 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"
    • changedInput schema / properties / file / description
      Previous value: -"Filter by file path (substring)"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 without a glob"
    • changedInput schema / properties / glob / description
      Previous value: -"Include files matching glob patterns (STRONGLY RECOMMENDED to limit scope, 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 / lang / description
      Previous value: -"Language (REQUIRED: rust, typescript, javascript, python, go, java, c, cpp, csharp, php, ruby, kotlin, zig)"New value: +"Language of the query"
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results (use with offset for pagination)"New value: +"Max results (default 200, at most 500)"
    • 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"New value: +"Return file paths only"
    • changedInput schema / properties / pattern / description
      Previous value: -"AST pattern (Tree-sitter S-expression, e.g., '(function_item) @fn')"New value: +"Tree-sitter query (S-expression)"
  2. Changed2 schema fields changedv2.0.1
    • changedInput schema / properties / exclude / description
      Previous value: -"Exclude files matching glob patterns (e.g., ['target/**', 'node_modules/**'])"New value: +"Exclude files matching glob patterns (e.g., ['target/**', 'node_modules/**']) 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 (STRONGLY RECOMMENDED to limit scope, e.g., ['src/**/*.rs'])"New value: +"Include files matching glob patterns (STRONGLY RECOMMENDED to limit scope, 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 /."
  3. First observedv1.0.0

TDQS

A4.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 disclose a key cost trait: it parses every file selected by lang and glob, hence slow. It implies the glob requirement (with force as the escape hatch, per schema). It does not mention read-only safety or result-return behavior, but the performance disclosure is the important one here.

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?

Three short sentences, front-loaded with the core purpose and the adversative 'Slow:' constraint immediately after the example. Nothing is wasted and the alternative is the last item.

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 10-parameter tool with no annotations and no output schema, the description covers the operative pitfalls (slowness, glob requirement, alternative tool). Details like pagination via limit/offset and the paths/dependencies toggles are left to the schema, which is acceptable.

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 would be 3, but the description adds real intent for `glob` ('always pass glob') and implies when `force` is relevant. It does not elaborate on the other eight parameters, though the schema documents them fully.

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?

States a specific verb and resource ('Tree-sitter structural search') and grounds it with a concrete query example `(function_item) @fn`, which immediately conveys the S-expression pattern semantics. It is clearly distinguishable from search_code and search_regex siblings.

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?

Explicitly routes the agent elsewhere ('Prefer search_code with symbols:true') and gives a hard usage rule ('always pass glob'), plus the performance rationale behind it. Both when-to-use and when-to-prefer-an-alternative are covered.

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