Skip to main content
Glama
wrale

mcp-server-tree-sitter

by wrale

run_query

Execute tree-sitter queries on project files to analyze and extract code patterns. Specify project, query, and optional file path or language for targeted results. Returns a list of matches for efficient code analysis.

Instructions

Run a tree-sitter query on project files.

    Args:
        project: Project name
        query: Tree-sitter query string
        file_path: Optional specific file to query
        language: Language to use (required if file_path not provided)
        max_results: Maximum number of results

    Returns:
        List of query matches
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathNo
languageNo
max_resultsNo
projectYes
queryYes
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that it returns 'list of query matches' but doesn't describe what happens during execution (e.g., whether it scans all files, performance implications, error handling, or what 'max_results' truncation entails). For a tool with 5 parameters and no annotation coverage, this leaves significant behavioral gaps.

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 appropriately sized and front-loaded with the core purpose in the first sentence, followed by a structured parameter list. Every sentence earns its place by clarifying parameter roles, though the formatting as a docstring with 'Args:' and 'Returns:' sections is slightly verbose but still efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, no annotations, no output schema), the description is moderately complete. It covers the basic purpose and parameters but lacks details on return value structure, error conditions, or performance behavior. Without an output schema, the description should ideally explain more about the 'list of query matches' format, leaving some gaps for agent understanding.

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 description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains each parameter's purpose (e.g., 'optional specific file to query', 'language to use (required if file_path not provided)', 'maximum number of results'), compensating well for the schema's lack of descriptions. However, it doesn't detail parameter formats or constraints (e.g., query string syntax).

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 the specific action ('run a tree-sitter query') and target ('on project files'), distinguishing it from sibling tools like 'get_ast' or 'find_text' that perform different operations on code. It precisely communicates the verb+resource combination without being vague or tautological.

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 through the parameter explanations (e.g., 'required if file_path not provided'), suggesting when certain parameters are needed, but doesn't explicitly state when to use this tool versus alternatives like 'adapt_query' or 'build_query'. It provides some contextual guidance but lacks explicit when/when-not directives.

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

Related 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/wrale/mcp-server-tree-sitter'

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