Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

by aimasteracc

edit

Destructive

Apply code edits with AST-backed validation to guard against structural breakage and unintended side effects.

Instructions

Code-intelligence (codegraph-compatible) safety and change-management facade. Actions: ast_diff, classify, constraints, guard, impact, mutation_probe, plan_rename, pr, refactor, release_snapshot, rename, safe, verify. Pass action=help with target_action for an exact action schema. Cost: action=safe is slow.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoAction sub-mode (e.g. summary|cycles).
limitNoMax results.
queryNoSearch query/pattern.
scopeNoAction discriminator (e.g. point|graph).
actionYesWhich business capability to invoke, or help for discovery. One of: ast_diff, classify, constraints, guard, help, impact, mutation_probe, plan_rename, pr, refactor, release_snapshot, rename, safe, verify
symbolNoSymbol/function name.
persistNoWrite evaluated violations through to the cache. Set false for RFC-0022 read-only evaluation; no database or file is created.
languageNoLanguage hint (usually auto).
file_pathNoTarget file path.
access_modeNoExplicit P0.4 zero-write access mode for routed read adapters.
scope_pathsNoPrimitive-issued frozen scope for action=constraints, or impact capture scope for action=impact.
snapshot_idNoCertified P0.1 index snapshot capability ID.
function_nameNoFunction name (alias of symbol).
output_formatNoOutput format: JSON.
target_actionNoBusiness action to describe when action is help.
route_lease_idNoOwnership token required by action=release_snapshot.
diff_snapshot_idNoRFC-0022 frozen diff ID for constraints/classify/ast_diff/release_snapshot.
modification_typeNoRequired for action=guard: type of planned modification. One of: add_feature, behavior_change, delete, fix_bug, refactor, rename, signature_change.
source_generationNoCertified P0.1/P0.2 source generation.
capture_diff_snapshotNoExplicitly produce a frozen diff ID for same-process consumers; supported only on POSIX.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv2.2.0
    • changedInput schema / properties / action / description
      Previous value: -"Which capability to invoke. One of: ast_diff, classify, constraints, guard, impact, mutation_probe, plan_rename, pr, refactor, release_snapshot, rename, safe, verify"New value: +"Which business capability to invoke, or help for discovery. One of: ast_diff, classify, constraints, guard, help, impact, mutation_probe, plan_rename, pr, refactor, release_snapshot, rename, safe, verify"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "ast_diff",
      -  "classify",
      -  "constraints",
      -  "guard",
      -  "impact",
      -  "mutation_probe",
      -  "plan_rename",
      -  "pr",
      -  "refactor",
      -  "release_snapshot",
      -  "rename",
      -  "safe",
      -  "verify"
      -]New value: +[
      +  "ast_diff",
      +  "classify",
      +  "constraints",
      +  "guard",
      +  "help",
      +  "impact",
      +  "mutation_probe",
      +  "plan_rename",
      +  "pr",
      +  "refactor",
      +  "release_snapshot",
      +  "rename",
      +  "safe",
      +  "verify"
      +]
    • addedInput schema / properties / target_action
      Added value: +{
      +  "description": "Business action to describe when action is help.",
      +  "type": "string"
      +}
  2. Changed12 schema fields changedv1.30.0
    • addedInput schema / properties / access_mode
      Added value: +{
      +  "description": "Explicit P0.4 zero-write access mode for routed read adapters.",
      +  "enum": [
      +    "read_existing"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / action / description
      Previous value: -"Which capability to invoke. One of: ast_diff, classify, constraints, guard, impact, pr, refactor, safe"New value: +"Which capability to invoke. One of: ast_diff, classify, constraints, guard, impact, mutation_probe, plan_rename, pr, refactor, release_snapshot, rename, safe, verify"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "ast_diff",
      -  "classify",
      -  "constraints",
      -  "guard",
      -  "impact",
      -  "pr",
      -  "refactor",
      -  "safe"
      -]New value: +[
      +  "ast_diff",
      +  "classify",
      +  "constraints",
      +  "guard",
      +  "impact",
      +  "mutation_probe",
      +  "plan_rename",
      +  "pr",
      +  "refactor",
      +  "release_snapshot",
      +  "rename",
      +  "safe",
      +  "verify"
      +]
    • addedInput schema / properties / capture_diff_snapshot
      Added value: +{
      +  "description": "Explicitly produce a frozen diff ID for same-process consumers; supported only on POSIX.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / diff_snapshot_id
      Added value: +{
      +  "description": "RFC-0022 frozen diff ID for constraints/classify/ast_diff/release_snapshot.",
      +  "type": "string"
      +}
    • changedInput schema / properties / output_format / description
      Previous value: -"Output format (toon|json)."New value: +"Output format: JSON."
    • addedInput schema / properties / output_format / enum
      Added value: +[
      +  "json"
      +]
    • addedInput schema / properties / persist
      Added value: +{
      +  "default": true,
      +  "description": "Write evaluated violations through to the cache. Set false for RFC-0022 read-only evaluation; no database or file is created.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / route_lease_id
      Added value: +{
      +  "description": "Ownership token required by action=release_snapshot.",
      +  "type": "string"
      +}
    • addedInput schema / properties / scope_paths
      Added value: +{
      +  "description": "Primitive-issued frozen scope for action=constraints, or impact capture scope for action=impact.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / snapshot_id
      Added value: +{
      +  "description": "Certified P0.1 index snapshot capability ID.",
      +  "type": "string"
      +}
    • addedInput schema / properties / source_generation
      Added value: +{
      +  "description": "Certified P0.1/P0.2 source generation.",
      +  "type": "string"
      +}
  3. Changed1 schema field changedv1.25.0
    • addedInput schema / properties / modification_type
      Added value: +{
      +  "description": "Required for action=guard: type of planned modification. One of: add_feature, behavior_change, delete, fix_bug, refactor, rename, signature_change.",
      +  "enum": [
      +    "add_feature",
      +    "behavior_change",
      +    "delete",
      +    "fix_bug",
      +    "refactor",
      +    "rename",
      +    "signature_change"
      +  ],
      +  "type": "string"
      +}
  4. First observedv1.23.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false, and idempotentHint=false. The description adds context beyond annotations by describing the facade nature, listing supported actions, and noting the cost of action=safe. It does not detail side effects or which actions are destructive, but the annotations carry that burden and there is no contradiction.

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?

Three short, front-loaded sentences cover scope, actions, discovery mechanism, and a cost warning with no filler. It is compact and scannable, though the dense action list makes it slightly terse.

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 high complexity (20 parameters, 14 actions, no output schema), the description is not fully self-contained. It compensates by directing the agent to action=help for exact schemas, but it still lacks per-action summaries, selection guidance, and side-effect context, so it is only minimally complete.

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 description coverage is 100%, so the baseline is 3. The description adds one useful link between action=help and target_action, but it does not explain which parameters apply to which actions or clarify the action-specific parameter combinations.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/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 code-intelligence 'safety and change-management facade' and enumerates 14 concrete actions, which separates it from the read-oriented sibling tools. It does not reach 5 because the action names are cryptic and their individual purposes are not explained.

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?

It explicitly tells the agent to pass action=help with target_action to get the exact action schema, and warns that action=safe is slow. However, it does not state when to use this tool versus siblings or how to choose among the listed actions, so the guidance is useful but incomplete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.