Skip to main content
Glama
stand-out-of-my-sun

Diogenes Context Compression, Code Patching & Deterministic Solver MCP

Polyglot AST Symbol Extractor, Call Graph & Complexity Analyzer

analyze_ast_symbol_graph
Read-onlyIdempotent

Extract imports, exports, classes, interfaces, functions, call edges, and complexity metrics from a source file to map its symbols and hotspots before refactoring.

Instructions

Extracts imports, exports, classes, interfaces, and functions with line numbers, intra-file call edges, McCabe cyclomatic complexity, and Halstead volume across TypeScript, Python, Rust, Go, and Move. Use when mapping the internal functions, call graph, and complexity hotspots of a source file before refactoring; for analyzing cross-file import DAGs, circular dependencies, and topological build order across multiple modules, use audit_module_dependency_cycles instead. Read-only call (32 KB, 60 RPM): accepts 'code' (with enum defaults), uses '?demo=true' or L402 (75 sats); HTTP 400 if invalid.

Input Schema

NameRequiredDescriptionDefault
codeYesSource code file content to parse for symbols and complexity metrics.
languageNoProgramming language grammar used for symbol extraction; defaults to 'typescript' when omitted.

Output Schema

NameRequiredDescriptionDefault
functionsYesExtracted functions with line number, cyclomatic_complexity, and outgoing calls.
lines_of_codeYesTotal line count of the analyzed source code.
halstead_metricsYesHalstead vocabulary_size, program_length, volume, and estimated_bugs.
high_complexity_hotspotsYesFunctions with McCabe cyclomatic complexity >= 8 flagged for refactoring.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered, and the description correctly aligns ('Read-only call'). It adds real operational context beyond annotations: a 32 KB size cap, 60 RPM rate limit, payment paths ('?demo=true' or L402 75 sats), and an HTTP 400 failure mode. It stops short of 5 only because it leaves some ambiguity (e.g., which limit the 32 KB applies to) and adds no non-obvious behavioral caveats beyond these.

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-loads the core capability and then the routing rule before operational details, and every clause carries information. It is dense and slightly run-on, packing output shape, routing, rate limits, payment, and errors into a compressed block, but not wasteful.

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?

An output schema exists, so return values need not be restated, and annotations carry the safety profile. Combined with the enumerated outputs, explicit sibling routing, and operational limits (size, rate, payment, error), nothing an agent needs to invoke this correctly is missing.

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% with only two parameters, so the schema already documents 'code' and the 'language' enum default. The description merely acknowledges them ('accepts code (with enum defaults)') without adding format, size, or language-selection guidance beyond what the schema states. Baseline 3 applies when the schema does the heavy lifting.

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?

States a specific verb and resource ('Extracts imports, exports, classes... call edges, complexity, Halstead volume') with exact scope and enumerated languages. It explicitly distinguishes itself from the sibling audit_module_dependency_cycles by routing cross-file analysis elsewhere, so an agent can separate the two without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives both a strong when-to-use ('mapping internal functions, call graph, and complexity hotspots of a source file before refactoring') and an explicit when-not with a named alternative ('for cross-file import DAGs... use audit_module_dependency_cycles instead'). This is exactly the routing guidance the dimension rewards.

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