Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

by aimasteracc

viz

Read-onlyIdempotent

Generate UML diagrams, call/dependency graphs, duplicate-code reports, and code/doc knowledge graphs from source code through one action-based code-intelligence interface.

Instructions

Code-intelligence (codegraph-compatible) visualization and similarity facade. Covers codegraph_uml (UML diagrams), codegraph_visualize (call/dependency graph visualizations), codegraph_similarity (duplicate code detection), and codegraph_knowledge_graph (code/doc knowledge graph export) in one tool. Pick a capability via action:

  • action=uml — UML class or sequence diagrams (codegraph_uml equivalent). Params: diagram, source, target, max_edges, max_depth, max_paths, package_depth, include_external_bases, file_path, class_name, include_tests.

  • action=graph — call/dependency graph visualizations (codegraph_visualize equivalent). Params: mode, file_path, function, depth, max_edges, direction, visualization_format (mermaid|sigma).

  • action=similarity — duplicate / near-duplicate code detection (codegraph_similarity equivalent). Default response is a summary map (files, line ranges, scores — no bodies). Params: mode, min_lines, min_group_size, max_groups, use_cache, include_bodies (set include_bodies=true to add code snippets; omit for the compact default).

  • action=knowledge — export the materialized code/doc knowledge graph for Sigma.js/Graphology or agents. Params: export_format, lod, focus, max_nodes, max_edges.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoAction sub-mode (e.g. summary|cycles).
limitNoMax results.
queryNoSearch query/pattern.
scopeNoAction discriminator (e.g. point|graph).
actionYesWhich capability to invoke. One of: graph, knowledge, similarity, uml
symbolNoSymbol/function name.
languageNoLanguage hint (usually auto).
file_pathNoTarget file path.
min_linesNoaction=similarity: min function body lines to consider (default: 5).
max_groupsNoaction=similarity: max clone groups to return (default: 20).
path_filterNoaction=similarity: project-relative path glob filter.
function_nameNoFunction name (alias of symbol).
output_formatNoOutput format: JSON.
min_group_sizeNoaction=similarity: min clone group size to report (default: 2).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.30.0
    • 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"
      +]
  2. Changed3 schema fields changedv1.29.1
    • changedInput schema / properties / action / description
      Previous value: -"Which capability to invoke. One of: graph, similarity, uml"New value: +"Which capability to invoke. One of: graph, knowledge, similarity, uml"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "graph",
      -  "similarity",
      -  "uml"
      -]New value: +[
      +  "graph",
      +  "knowledge",
      +  "similarity",
      +  "uml"
      +]
    • addedInput schema / properties / path_filter
      Added value: +{
      +  "description": "action=similarity: project-relative path glob filter.",
      +  "type": "string"
      +}
  3. Changed3 schema fields changedv1.25.0
    • addedInput schema / properties / max_groups
      Added value: +{
      +  "description": "action=similarity: max clone groups to return (default: 20).",
      +  "type": "integer"
      +}
    • addedInput schema / properties / min_group_size
      Added value: +{
      +  "description": "action=similarity: min clone group size to report (default: 2).",
      +  "type": "integer"
      +}
    • addedInput schema / properties / min_lines
      Added value: +{
      +  "description": "action=similarity: min function body lines to consider (default: 5).",
      +  "type": "integer"
      +}
  4. First observedv1.23.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive safety, so the bar is lower, and the description adds real behavioral context beyond them: similarity's default response is a compact summary map (files, ranges, scores, no bodies) with bodies only on opt-in, plus the visualization_format and export_format options. It doesn't cover rate limits, pagination, or failure modes, but for an annotated read-only tool this is solid.

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?

Front-loaded with a one-line purpose and then a clean per-action bullet structure, so it is easy to scan. It is somewhat verbose and references internal 'codegraph_* equivalent' names that no sibling tool in this server actually exposes, which is mild wasted detail, but overall the structure earns its length.

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?

For a 14-parameter, single-required-argument facade with no output schema, the description gives per-action param lists and documents the default response shape for similarity, which is the key completeness concern. Minor gaps remain: generic schema params (query, scope, limit, symbol, language, output_format) and the return shape for the other three actions are not described.

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?

Schema coverage is 100%, so the baseline is 3, but the description goes further by mapping parameter groups to each action (e.g., diagram/source/target/max_edges for uml; mode/direction/visualization_format for graph). It documents action-specific params such as class_name, include_tests, and package_depth that are not present as explicit schema properties (additionalProperties: true), which meaningfully aids invocation.

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 names a concrete resource (a code-intelligence visualization/similarity facade) and enumerates four specific capabilities with verbs (UML/diagram rendering, call/dependency graph visualization, duplicate-code detection, knowledge-graph export). An agent can tell this is the visualization/diagram tool rather than nav, structure, or search without opening the schema. The `action` discriminator makes the mapping from request to capability explicit.

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?

It gives clear routing guidance: 'Pick a capability via `action`' followed by a per-action breakdown, and explicitly notes the similarity default vs `include_bodies=true`. It does not, however, state when to prefer viz over siblings like structure or nav, nor any exclusions, so it stops short of full when/when-not guidance.

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