Skip to main content
Glama

structural_search

Find code structures across repositories using AST patterns. Provide a pattern and language to locate definitions or other syntactic elements.

Instructions

ast-grep over the repo: a pattern that PARSES, e.g. 'def $F($$$)' with lang=python.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNo
patternYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It usefully highlights that the tool PARSES (rather than text-matches) and operates repo-wide, but does not disclose read-only status, error behavior for invalid patterns, or performance implications.

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?

A single, well-structured sentence front-loads the core functionality and uses an example to clarify usage. No unnecessary words or repetition.

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?

Given the presence of an output schema, the description does not need to explain return values. It covers purpose, scope, and gives a practical example. Missing details about pattern syntax and lang defaults are parameter-level and do not severely undermine completeness.

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?

The schema has no parameter descriptions (0% coverage). The description adds meaning by mentioning 'pattern' and 'lang' via a concrete example, implicitly defining pattern as a structural code pattern and lang as a language selector, though it doesn't fully enumerate allowed values.

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 identifies the tool as ast-grep for structural search over the repo, with a concrete pattern example and language specification. This distinguishes it from the sibling ontology and surface-scanning tools.

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

Usage Guidelines3/5

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

The description implies usage for syntactic/code-pattern search ('over the repo'), but it does not explicitly state when to use this tool over alternatives, nor provide any exclusions or comparison with sibling tools.

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/socialite-ml/montology'

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