Skip to main content
Glama

Get Solution Metrics

solution_metrics
Read-onlyIdempotent

Get a solution-wide production-code quality rollup in one call and evaluate --fail-on gate expressions for before/after comparisons.

Instructions

The solution-wide quality rollup in one call - the numbers the CLI '--fail-on' quality gate evaluates. symbol_metrics ranks single methods; list_insights shows the findings behind the severity counts.

Use it for a before/after number, or to try a gate expression.

Returns metrics {typeCount, methodCount, complexityMax, complexityAvg, methodsOverComplexityThreshold, ceMax, caMax}, scope (always 'production'), testMethodCount, testTypeCount, severities {critical, warning, info, ok}, debtMinutes, debtApprox, debtRating, complexityThreshold, qualityProfile, layerProfile (when one is in force), knownGateMetrics and, with failOn, gate {expression, passed, violatedClauses}. degradedProducers appears when an insight producer failed; severities and debt are then incomplete. debtMinutes is a coarse estimate from fixed per-finding rules, not measured effort; debtApprox rounds it (1 d = 8 h).

PRODUCTION code only - test projects, per the session's test profile, are excluded from every number, and testMethodCount / testTypeCount give the excluded side. Types are logical (partial fragments merged, multi-TFM deduplicated); methods exclude constructors and accessors. methodsOverComplexityThreshold counts STRICTLY greater than complexityThreshold, while symbol_metrics' minComplexity is inclusive. ceMax / caMax: coupling maxima (caMaxNote: same-named types could raise caMax). severities count insights - one per producer that found something - not findings. The rollup is NOT triage-filtered: suppressed and dismissed findings still count, as in the CLI gate, so debt and severities can be higher than what list_insights shows.

failOn takes the tokens in knownGateMetrics; this gate is advisory, the blocking one is the CLI's.

Profiles: the active QualityProfile of the config DB in force (see dbPath); the session's layer profile, else the one dbPath (or, omitted, the session's analysis DB) configures. Writes nothing of its own; an older dbPath DB is upgraded on open, as the server's own is at startup. Works on a recalled session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dbPathNoOptional path to an AIContextBuilder SQLite DB. When set, the complexity threshold and producer toggles come from that DB's active QualityProfile (same semantics as list_insights); omit to fall back to the server's default config DB (the GUI's, if resolved), else the default profile. Omitted, the layer profile comes from the config DB the session was analysed against.
failOnNoOptional quality-gate expression to evaluate against the rollup (CLI '--fail-on' syntax, e.g. 'critical>0 OR debt>120min OR ce-max>50'). An invalid expression or unknown metric is rejected with the known tokens.
sessionIdYesThe session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.5.46514
    • changedInput schema / properties / dbPath / description
      Previous value: -"Optional path to an AIContextBuilder SQLite DB. When set, the complexity threshold and producer toggles come from that DB's active QualityProfile (same semantics as list_insights); omit to fall back to the server's default config DB (the GUI's, if resolved), else the default profile."New value: +"Optional path to an AIContextBuilder SQLite DB. When set, the complexity threshold and producer toggles come from that DB's active QualityProfile (same semantics as list_insights); omit to fall back to the server's default config DB (the GUI's, if resolved), else the default profile. Omitted, the layer profile comes from the config DB the session was analysed against."
  2. Changed1 schema field changedv0.5.46513
    • changedInput schema / properties / sessionId / description
      Previous value: -"The session_id returned by analyze_solution."New value: +"The session_id returned by analyze_solution. Also takes an absolute .sln/.slnx/.slnf path, analyzed on first use."
  3. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations cover only the read-only/idempotent safety profile; the description adds substantial behavior: production-only scope with test counts reported separately, degradedProducers signalling incomplete severities/debt, debtMinutes being a coarse per-finding estimate, severities counting insights not findings, strict vs inclusive threshold semantics, and non-triage-filtered counting of suppressed findings.

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 purpose and routing, and nearly every sentence carries a distinct behavioral fact. It is dense to the point of strain in the closing profiles paragraph, where nested parentheticals ('the one dbPath (or, omitted, the session's analysis DB) configures') slow parsing, but little is genuinely expendable.

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?

No output schema exists, yet the description enumerates the returned fields (metrics, scope, severities, debt, gate, degradedProducers) and their caveats, plus scope/profile behavior and the DB-upgrade side effect. An agent has everything needed to call it and interpret the result.

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 still adds meaning: failOn must use tokens from knownGateMetrics and is rejected with the known tokens on error, and dbPath controls which QualityProfile supplies the threshold. sessionId's .sln path acceptance is only restated from 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?

States a specific verb+resource: the 'solution-wide quality rollup in one call' that the CLI '--fail-on' gate evaluates. It explicitly distinguishes itself from symbol_metrics (single methods) and list_insights (findings behind severity counts), so an agent can pick it without opening the 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 concrete when-to-use conditions ('a before/after number, or to try a gate expression') and names the two nearest alternatives with the axis that separates them. It also warns that this gate is advisory while the blocking one is the CLI's, which prevents misuse.

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