Skip to main content
Glama
aimasteracc

tree-sitter-analyzer

by aimasteracc

viz

Read-onlyIdempotent

Visualize code architecture and detect duplicate code in one call: generate UML diagrams, call/dependency graphs, and knowledge graph exports, plus identify near-duplicate code segments.

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 (toon|json).
min_group_sizeNoaction=similarity: min clone group size to report (default: 2).

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 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"
      +}
  2. 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"
      +}
  3. First observedv1.23.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive behavior. The description adds meaningful behavioral detail beyond those annotations: similarity defaults to a summary map with no code bodies, include_bodies=true is required for snippets, and the knowledge action exports a materialized graph for Sigma.js/Graphology. This goes beyond what the structured annotations alone provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with a one-sentence summary of the tool's role, then organized into four compact action bullets. The length is justified by the multi-capability facade nature of the tool. There is no filler or tautology; every clause adds routing or parameter information.

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?

This is a complex tool with four action modes, 14+ parameters, an open additionalProperties schema, and no output schema. The description covers action selection, per-action parameter sets, and at least one key output behavior (similarity's summary map default). Still, it does not describe output shapes or formats for UML, graph, or knowledge actions, which an agent would need to confidently interpret results. That gap prevents a 5.

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. The description earns a 4 by listing action-specific parameters that are not present in the schema (e.g., diagram, source, target, max_depth, visualization_format, include_bodies, export_format, lod, focus), which is critical because additionalProperties is true. It also embeds defaults and behavioral semantics like min_lines defaulting to 5, max_groups defaulting to 20, and include_bodies controlling snippet inclusion. However, many listed parameters are not individually explained, so it isn't a 5.

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 opens with a specific statement of purpose: 'Code-intelligence (codegraph-compatible) visualization and similarity facade.' It enumerates four distinct capabilities (UML, graph visualization, similarity, knowledge graph) and maps each to concrete action values. This clearly distinguishes the tool from search/nav/structure siblings by framing it as a visualization and similarity facade.

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 strong internal routing guidance: 'Pick a capability via action' and then itemizes exactly which parameters apply to which action. However, it does not explicitly contrast this tool with sibling tools like search or structure, nor state when not to use viz. The usage context is clear, but exclusions and external alternatives are absent.

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

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