Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

edit

Analyze code safety, blast radius, dependencies, and refactoring opportunities to guide safe edits.

Instructions

Code-intelligence (codegraph-compatible) safety and change-management facade. Covers codegraph_pr_review (PR analysis via codegraph), safe-to-edit gates, blast-radius guards, change impact scanning, refactoring suggestions, constraint checks, semantic classification, and AST diff in one tool. Pick a capability via action:

  • action=safe — pre-edit safety gate: is this file safe to edit right now? Returns SAFE/UNSAFE verdict. Params: file_path, edit_type, output_format.

  • action=guard — blast-radius guard BEFORE touching a symbol: how many callers, what test coverage, what risk level. Params: symbol, modification_type, file_path.

  • action=impact — post-edit dependency blast-radius scan combining git diff + dependency graph: affected files, must-run tests, risk verdict (SAFE/REVIEW/WARN). Call after every non-trivial edit. Params: scope_paths, output_format.

  • action=refactor — refactoring-opportunity analysis for a source file: extract candidates, complexity hotspots, skeleton. Params: file_path, language, max_suggestions, include_extractions, include_skeleton, output_format.

  • action=constraints — scan the project for constraint/rule violations (architecture, naming, coupling). Params: severity_min, output_format.

  • action=pr — AI review of a PR diff via codegraph: structural issues, blast-radius, test-coverage gaps (codegraph_pr_review equivalent). Params: pr_url or diff (see inner schema).

  • action=classify — semantic change classification: classify a file's diff between git refs (file_path [+ old_ref/new_ref]) or two code strings (old_source + new_source + language). With only file_path, defaults to the file/git-ref mode. Params: file_path | old_source+new_source+language, output_format.

  • action=ast_diff — structural AST diff between two snapshots/versions of a file: added/removed/changed nodes. Params: file_path, before, after or git ref params (see inner schema). NOTE: safe/impact/classify/constraints/pr/ast_diff are read-only in practice; refactor/guard suggest changes but do not write files. readOnlyHint is False for the whole facade (mixed action set).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: ast_diff, classify, constraints, guard, impact, pr, refactor, safe
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).
Behavior4/5

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

Annotations set readOnlyHint=false, and the description clarifies that certain actions are read-only in practice while others are not, adding context beyond annotations. It explains that refactor/guard suggest changes but do not write files. No contradiction 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 well-structured with action labels and bullet points, front-loading the overall purpose. While it is lengthy, every section serves a purpose; it could be slightly reduced but remains clear.

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 complexity of 10 parameters and no output schema, the description comprehensively explains each action, its parameters, and usage notes. It compensates well for the missing output schema by describing the type of output per action (e.g., 'Returns SAFE/UNSAFE verdict').

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3. The description groups parameters per action (e.g., 'Params: file_path, edit_type, output_format' for safe), adding some context beyond the schema. However, it does not deeply elaborate on parameter meanings beyond listing them.

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 a 'safety and change-management facade' covering multiple code intelligence capabilities. It lists all actions and their purposes, distinguishing this tool from sibling tools like 'search' or 'structure' by focusing on code analysis and change management.

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 provides explicit when-to-use guidance for each action (e.g., 'Call after every non-trivial edit' for impact). It does not explicitly discuss when not to use it or alternatives, but the detailed action breakdown offers clear context for selection.

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