Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

edit

Evaluate edit safety, guard blast radius, scan impact, suggest refactoring, check constraints, classify changes, and diff AST. Pick the appropriate action.

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* (required), modification_type* (required), 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: mode (diff|staged|branch|pr, default: diff), 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. Mode is inferred from args when omitted. Modes: diff_files (old_file + new_file), diff_strings (old_source + new_source + language), diff_git (old_ref + new_ref + file_path). 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).
modification_typeNoRequired for action=guard: type of planned modification. One of: add_feature, behavior_change, delete, fix_bug, refactor, rename, signature_change.
Behavior4/5

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

The description adds value beyond annotations by explaining the mixed nature of the actions (some read-only, some non-writing). Annotations set readOnlyHint=false overall, but the description clarifies which specific actions are safe. 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 lengthy but well-structured, with action definitions clearly separated. It front-loads the overall purpose and uses bullet-style formatting. For the complexity of 8 actions and 11 parameters, it is appropriately sized, though slightly verbose.

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 complex multi-action facade with no output schema, the description covers each action's purpose, parameters, and behavior comprehensively. It notes data formats and override behaviors, making it complete for the tool's scope.

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?

The description significantly enriches the input schema by detailing required parameters per action (e.g., 'symbol* (required)' for guard) and adds context on how parameters like 'mode' or 'output_format' are used. Schema coverage is 100%, but the description provides the 'why' behind parameter usage.

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 defines the tool as a 'safety and change-management facade' for code intelligence, listing 8 distinct actions with specific verbs and resources (e.g., 'action=safe — pre-edit safety gate'). It distinguishes itself from sibling tools like 'health' or 'index' by being a composite facade covering multiple capabilities.

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 guidance for each action, stating when to use them (e.g., 'Call after every non-trivial edit' for impact) and notes that some actions are read-only while others suggest changes. However, it does not explicitly state when not to use this tool in favor of alternatives.

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