Skip to main content
Glama

AST Structural Search

ast_search
Read-onlyIdempotent

Identify code patterns by matching abstract syntax trees, not raw text. Use $VAR for single nodes and $$$ for sequences; ignores comments and strings.

Instructions

Tree-sitter AST structural search via ast-grep. Matches real syntax trees, not text — so patterns can never match inside strings or comments. Use $VAR for one node, $$$ for many. Example: 'try { $$$ } catch ($E) { }'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNots
pathYesAbsolute path to the repository root
patternYesast-grep pattern, e.g. 'useEffect($$$)' or '$X as any'
Behavior4/5

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

Annotations already declare read-only, idempotent, and non-destructive behavior, which covers the safety profile. The description adds valuable behavioral context about how matching works (against real syntax trees, avoiding matches in strings/comments) and the syntax for variables, which goes beyond the annotations.

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 efficient sentences: definition, behavioral advantage, and syntax example. Zero fluff, critical information is front-loaded, and the example is illustrative without being verbose.

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 read-only search tool with annotations covering safety, the description adequately explains the matching semantics and pattern syntax. It does not specify the return format or mention installation prerequisites, but these are minor gaps given the tool's simplicity and the presence of annotations.

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 67% (only 'pattern' has a description). The main description adds explanation for the pattern parameter (the $VAR/$$$ syntax) and provides an example, which enriches understanding beyond the schema. Path and lang are not elaborated, but the pattern syntax is the most nuanced parameter.

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?

Description clearly states it is a structural search on ASTs via ast-grep, explicitly distinguishing from text search ('not text'). The example pattern and explanation of matching against syntax trees make the tool's purpose and scope unambiguous.

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

Usage Guidelines4/5

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

The description gives clear context that this is for structural matching, implying use for AST-aware searches rather than text. However, it does not explicitly name alternative tools (e.g., 'search') or state when not to use it, so it falls short of providing explicit exclusions.

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/CerisonAutomation/argus-mcp'

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