Skip to main content
Glama

code_metrics

Read-onlyIdempotent

Measure code metrics for MQL source files or folders to evaluate complexity and maintainability. Use analyze_mql with checks=['metrics'] as replacement.

Instructions

DEPRECATED (removed in 0.6.0): use analyze_mql(source or root, checks=["metrics"]).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootNoAbsolute folder to aggregate over.
sourceNoAbsolute path of one source file.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.5.0
    • addedInput schema / properties / root / description
      Added value: +"Absolute folder to aggregate over."
    • addedInput schema / properties / source / description
      Added value: +"Absolute path of one source file."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "title": "code_metricsDictOutput",
      +  "type": "object"
      +}
  2. First observedv0.4.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and non-destructive behavior, so the description does not need to restate safety. The description adds the key behavioral fact that this tool is deprecated and removed in 0.6.0, which is valuable context beyond the annotations. No contradiction exists between the description and annotations.

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 entire description is one sentence with the deprecation warning front-loaded and the replacement instruction following immediately. There is no redundant wording or filler, matching the standard for an effective concise tool description.

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?

For a deprecated tool, the description is complete: it warns against usage, names the replacement, and gives the replacement invocation. Safety is fully covered by annotations, and an output schema exists, so return values need no additional description. Nothing essential is missing for an agent to act correctly.

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 root and source are already documented as an absolute folder and an absolute file path. The description adds semantic value by showing how these parameters map into the replacement call: analyze_mql(source or root, checks=['metrics']). This goes slightly beyond the schema and helps the agent migrate usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly identifies the tool as deprecated and immediately redirects to analyze_mql with checks='metrics', which conveys the tool's former purpose by reference. It does not state a direct verb+resource for code_metrics itself, but the deprecation notice makes the intended action clear. This is sufficient for an agent deciding whether to invoke it.

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?

The description gives explicit usage guidance: do not use this tool, use analyze_mql instead. It even provides the exact replacement call pattern, including the source or root argument mapping. This is strong when-to-use/when-not-to-use guidance with a named alternative.

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