Skip to main content
Glama

Analyze

analyze

Compute cyclomatic/cognitive complexity, dependency graph, code smells, and an overall quality score in one call. Optionally limit analysis to a subdirectory or file.

Instructions

Use for code review or quality assessment — preferred over manually reading files to eyeball complexity, since it computes cyclomatic/ cognitive complexity, dependency analysis, code smells (long/complex functions, large classes, dead code), and an overall quality score in one call. Read-only; requires an index (see index). Optionally scope to a subdirectory or file via path to keep results focused and fast on large codebases — omit it to analyze the whole indexed codebase.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathNoOptional relative path to filter analysis (subdirectory or file)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.4

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it declares the operation read-only, requires an existing index, and clarifies whole-codebase behavior when path is omitted. It stops short of describing failure modes if the index is missing or stale, but this is adequate for a read-only analysis tool.

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?

Three dense sentences, front-loaded with the primary use case, then metrics, safety, prerequisite, and path guidance. No filler or redundant restatement of the tool name.

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?

The description covers purpose, what the tool computes, read-only behavior, the index prerequisite, and the one parameter's semantics, including default behavior. An output schema is present, so not describing return values is acceptable.

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?

The schema already documents path as an optional filter, and the description adds real value: omitting path means analyzing the whole indexed codebase, while providing it keeps results focused and fast on large codebases. That goes beyond simply restating the schema.

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 specific resource (the indexed codebase) and enumerates concrete analyses: cyclomatic/cognitive complexity, dependency analysis, code smells, and a quality score. This is clearly distinct from siblings like status, search, or explain, which serve different purposes.

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 states when to use the tool ('code review or quality assessment') and explicitly positions it as preferred over manually reading files. It also gives the prerequisite to use the index and explains how the optional path keeps analysis focused and fast, though it does not explicitly exclude sibling tools like explain or graph.

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