Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

health

Read-onlyIdempotent

Analyze code health with project grading, file metrics, anti-pattern detection, dead code identification, dependency analysis, and test coverage gaps.

Instructions

Code-intelligence (codegraph-compatible) health and analysis facade. Covers codegraph_complexity_heatmap, codegraph_import_graph, codegraph_dependency_matrix, codegraph_dead_code, codegraph_overview, and project/file health metrics in one tool. Pick a capability via action:

  • action=project — overall project code-quality grade + per-file grade breakdown. Params: min_grade, max_files.

  • action=file — per-file health: complexity, duplication, style. Params: file_path (required), language.

  • action=scale — lines-of-code / complexity / size metrics. Params: file_path, file_paths, language, metrics_only, include_complexity, include_details, include_guidance.

  • action=patterns — anti-pattern detection by category and severity. Params: file_path (required), categories, severity_threshold.

  • action=heatmap — complexity heatmap ranked by file or function (codegraph_complexity_heatmap equivalent). Params: mode, file_path, function_name, language, directory, max_files.

  • action=imports — module import dependency graph (who imports whom, codegraph_import_graph equivalent). Params: mode, file_path, max_depth.

  • action=matrix — coupling matrix and top-k coupling ranks (codegraph_dependency_matrix equivalent). Params: mode, file_path, top_k, threshold.

  • action=dead — unreferenced functions / unused imports / unused variables (codegraph_dead_code equivalent). Params: mode, include_test_files, max_dead, max_imports, max_variables.

  • action=routes — HTTP route discovery across framework conventions. Params: mode, url_pattern, file_path, framework.

  • action=overview — entry-points / hub files / dead-code summary (codegraph_overview equivalent). Params: max_entry_points, max_hubs, max_dead, max_coupled_files.

  • action=deps — dependency analysis (R5 multi-mode). Params: mode (summary|cycles|blast|file_deps), file_path. mode=summary: project-level dependency overview. mode=cycles: detect circular dependencies. mode=blast: blast-radius for a given file_path. mode=file_deps: file-level dependency details.

  • action=test_gap — untested symbol discovery ranked by cyclomatic complexity. Params: mode (summary|gaps|file), file_path, language, max_files, max_gaps, include_covered, output_format. For UML diagrams, call/dependency graph visualizations, and similarity analysis, use the viz facade instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesWhich capability to invoke. One of: dead, deps, file, heatmap, imports, matrix, overview, patterns, project, routes, scale, test_gap
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 already indicate read-only, non-destructive, idempotent, and not open-world. The description adds context about the tool being 'codegraph-compatible' and details the behavior of each action (e.g., 'unreferenced functions / unused imports' for dead action). 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 long but well-structured with bullet points for each action and sub-options. It front-loads the overall purpose and then systematically lists actions. Every sentence adds value; no wasted words. Could be slightly more concise but appropriate given the complexity.

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 tool's complexity (12 actions, 10 parameters, many sub-modes), the description is comprehensive. It covers all actions and their parameters, mentions alternatives (viz), and describes behavioral outcomes. Missing explicit return format descriptions, but overall 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 has 100% description coverage, but descriptions are terse (e.g., 'Target file path'). The tool description extensively lists parameters per action, often with specifics like 'min_grade, max_files' that are not in the schema's explicit properties (since schema uses additionalProperties true). This adds meaning beyond the schema but also introduces inconsistency since those parameters are undocumented in the schema itself.

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 it's a 'Code-intelligence (codegraph-compatible) health and analysis facade' and lists 12 distinct actions, each with a specific verb (e.g., 'dead', 'deps', 'file'). It explicitly distinguishes from the sibling tool 'viz' by stating 'For UML diagrams... use the viz facade instead.'

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 clear context: 'Pick a capability via action' and details each action with parameters. It explicitly says when not to use this tool ('For UML diagrams... use the viz facade instead'). However, it does not guide on when to use this tool over other siblings like 'project' or 'search', though the scope is well-defined.

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