Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

search

Read-onlyIdempotent

Search code using symbol, AST query, regex, or grep. Supports batch, chain, and select operations for flexible analysis.

Instructions

Code-intelligence (codegraph-compatible) search facade. Covers codegraph_symbol_search (BM25), codegraph_query (tree-sitter AST), codegraph_query chain DSL, and ripgrep/fd text search in one tool. Pick a capability via action:

  • action=symbol — BM25 FTS lookup of a symbol by name (fast 'where is X defined', codegraph_symbol_search equivalent). Params: query, language, kind, limit.

  • action=query — tree-sitter .scm query DSL (semantic AST match, NOT the same as symbol). Params: query_key, query_string, filter, file_path.

  • action=content — ripgrep text/regex search across files. Params: query, roots, include_globs, ...

  • action=grep — two-stage fd (file discovery) + ripgrep search. Params: query, roots, ...

  • action=batch — run multiple ripgrep searches in one call. Params: queries (required array of 2-10 items; each item requires pattern and may include roots/include_globs/exclude_globs/max_results/label), output_format.

  • action=chain — jQuery-style codegraph chain DSL: compose search / explore / callers / callees in one process. Steps are separated by '.' (NOT '|'), e.g. query="search('IndexShard').callers()" or "explore('parse').related()"; a plain string with no parentheses is treated as explore(string).related(). Params: query (required — the chain string), max_symbols, max_files, include_code, compact.

  • action=select — Hyphae DSL, a CSS-selector-style graph query (RFC-0003). ONE selector replaces chains of navigate/callers/search: #name, .kind (.function/.method/.class), *, :calls(#X), :callees(#X), :not(sel), :in(path), [file=p]/[language=l]/[class=C], combinators A > B / A B. Example: '.function:calls(#IndexShard):in(server/)'. Params: selector (required), max_results, output_format.

  • action=subscribe — RFC-0001 reactive push: subscribe to a Hyphae selector. Receive send_resource_updated when results change; re-read resource_uri. Returns { sub_id, resource_uri }. Params: selector (required), min_interval.

  • action=unsubscribe — cancel a Hyphae subscription. Params: sub_id or selector.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: batch, chain, content, grep, query, select, subscribe, symbol, unsubscribe
scopeNoAction discriminator (e.g. point|graph).
modeNoAction sub-mode (e.g. summary|cycles).
file_pathNoTarget file path.
symbolNoSymbol/function name.
function_nameNoFunction name (alias of symbol).
queryNoSearch query/pattern.
languageNoLanguage hint (usually auto).
limitNoMax results.
output_formatNoOutput format (toon|json).
kindNoSymbol kind filter for action=symbol (default: any).
Behavior5/5

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

Annotations indicate read-only, idempotent, non-destructive. The description adds behavioral context: explains each action's output (e.g., subscribe returns {sub_id, resource_uri}), the chain DSL syntax, and select DSL syntax. No contradictions with annotations.

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 long but well-organized with bullet points for each action. It front-loads the overall purpose and action list. However, some redundancy (e.g., repeating 'Params:' for each action) could be trimmed. Still clear and usable.

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 tool's complexity (11 parameters, 9 actions) and no output schema, the description is thoroughly complete: it covers all actions, their parameters, and expected outputs (e.g., subscribe returns sub_id and resource_uri). No gaps for an AI agent to invoke correctly.

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?

Input schema has 100% description coverage, but the description adds significant context: e.g., for 'chain' action, explains the query parameter format with examples; for 'batch', explains the 'queries' array structure; for 'select', explains the CSS-selector-like syntax. This adds value beyond the schema.

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 a 'Code-intelligence (codegraph-compatible) search facade' covering multiple search capabilities, and lists all 9 actions with specific purposes. It distinguishes itself from siblings (e.g., edit, nav) by defining its search role.

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 each action (e.g., 'action=symbol for fast "where is X defined"', 'action=content for ripgrep text/regex search') and contrasts similar actions (e.g., 'action=query is NOT the same as symbol'). Offers enough detail for an agent to select the right action.

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/aimasteracc/tree-sitter-analyzer'

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