Skip to main content
Glama

developer.code-metrics

Read-onlyIdempotent

Measure caller-supplied source code with Python AST analysis or a deterministic lexical fallback, including per-function complexity, a SHA-256 fingerprint, density ratios, syntax status, and actionable maintainability signals without retaining or forwarding the code. One bounded no-wallet trial is available through the separate HTTP endpoint https://apiacre.com/trials/developer.code-metrics; this MCP tools/call operation remains paid.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
languageNotext

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesStructured Code metrics result
metaYes
serviceYes
versionYes
request_idYesUnique request identifier

Schema Changelog

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

  1. Changed7 schema fields changed
    • addedOutput schema / properties / meta / properties / next_actions / items / properties / checkout_path
      Added value: +{
      +  "pattern": "^/try/",
      +  "type": "string"
      +}
    • addedOutput schema / properties / meta / properties / next_actions / items / properties / executes_automatically
      Added value: +{
      +  "const": false,
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / meta / properties / next_actions / items / properties / handoff_path
      Added value: +{
      +  "description": "Free full contract and spend-capped command handoff; reading it does not execute or purchase the follow-up.",
      +  "pattern": "^/catalog/",
      +  "type": "string"
      +}
    • addedOutput schema / properties / meta / properties / next_actions / items / properties / handoff_payment_required
      Added value: +{
      +  "const": false,
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / meta / properties / next_actions / items / properties / maximum_atomic_usdc
      Added value: +{
      +  "pattern": "^[1-9][0-9]*$",
      +  "type": "string"
      +}
    • addedOutput schema / properties / meta / properties / next_actions / items / properties / sample_path
      Added value: +{
      +  "pattern": "^/samples/",
      +  "type": [
      +    "string",
      +    "null"
      +  ]
      +}
    • changedOutput schema / properties / meta / properties / next_actions / items / required
      Previous value: -[
      -  "service",
      -  "title",
      -  "reason",
      -  "method",
      -  "path",
      -  "price",
      -  "input_template",
      -  "use_output",
      -  "authorization_required"
      -]New value: +[
      +  "service",
      +  "title",
      +  "reason",
      +  "method",
      +  "path",
      +  "price",
      +  "input_template",
      +  "use_output",
      +  "handoff_path",
      +  "checkout_path",
      +  "sample_path",
      +  "maximum_atomic_usdc",
      +  "handoff_payment_required",
      +  "executes_automatically",
      +  "authorization_required"
      +]
  2. Changed48 schema fields changed
    • addedInput schema / additionalProperties
      Added value: +false
    • addedInput schema / properties / code / minLength
      Added value: +1
    • addedInput schema / properties / language / minLength
      Added value: +1
    • addedOutput schema / properties / data / additionalProperties
      Added value: +false
    • addedOutput schema / properties / data / properties / analysis / additionalProperties
      Added value: +false
    • addedOutput schema / properties / data / properties / analysis / properties
      Added value: +{
      +  "limitations": {
      +    "items": {
      +      "maxLength": 500,
      +      "type": "string"
      +    },
      +    "maxItems": 2,
      +    "minItems": 2,
      +    "type": "array"
      +  },
      +  "method": {
      +    "enum": [
      +      "Python AST with deterministic lexical metrics",
      +      "deterministic lexical heuristics"
      +    ],
      +    "type": "string"
      +  },
      +  "version": {
      +    "const": "apiacre-code-metrics/3",
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / data / properties / analysis / required
      Added value: +[
      +  "version",
      +  "method",
      +  "limitations"
      +]
    • addedOutput schema / properties / data / properties / averageLineLength / maximum
      Added value: +2000000
    • addedOutput schema / properties / data / properties / averageLineLength / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / blankLineDensity / maximum
      Added value: +1
    • addedOutput schema / properties / data / properties / blankLineDensity / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / branchPoints / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / classes / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / commentDensity / maximum
      Added value: +1
    • addedOutput schema / properties / data / properties / commentDensity / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / complexityPerFunction / minimum
      Added value: +1
    • addedOutput schema / properties / data / properties / estimatedCyclomaticComplexity / minimum
      Added value: +1
    • addedOutput schema / properties / data / properties / functionMetrics / items / additionalProperties
      Added value: +false
    • addedOutput schema / properties / data / properties / functionMetrics / items / properties
      Added value: +{
      +  "branchPoints": {
      +    "maximum": 2000000,
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "endLine": {
      +    "maximum": 2000000,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  "estimatedCyclomaticComplexity": {
      +    "maximum": 2000001,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  "kind": {
      +    "enum": [
      +      "function",
      +      "async-function"
      +    ],
      +    "type": "string"
      +  },
      +  "line": {
      +    "maximum": 2000000,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  "lines": {
      +    "maximum": 2000000,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  "name": {
      +    "maxLength": 2000000,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "parameters": {
      +    "maximum": 2000000,
      +    "minimum": 0,
      +    "type": "integer"
      +  }
      +}
    • addedOutput schema / properties / data / properties / functionMetrics / items / required
      Added value: +[
      +  "name",
      +  "kind",
      +  "line",
      +  "endLine",
      +  "lines",
      +  "parameters",
      +  "branchPoints",
      +  "estimatedCyclomaticComplexity"
      +]
    • addedOutput schema / properties / data / properties / functionMetrics / items / type
      Added value: +"object"
    • addedOutput schema / properties / data / properties / functionMetrics / maxItems
      Added value: +500
    • addedOutput schema / properties / data / properties / functions / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / language / maxLength
      Added value: +40
    • addedOutput schema / properties / data / properties / language / minLength
      Added value: +1
    • changedOutput schema / properties / data / properties / language / type
      Previous value: -[
      -  "string",
      -  "null"
      -]New value: +"string"
    • addedOutput schema / properties / data / properties / lines / additionalProperties
      Added value: +false
    • addedOutput schema / properties / data / properties / lines / properties
      Added value: +{
      +  "blank": {
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "code": {
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "comments": {
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "total": {
      +    "minimum": 0,
      +    "type": "integer"
      +  }
      +}
    • addedOutput schema / properties / data / properties / lines / required
      Added value: +[
      +  "total",
      +  "code",
      +  "comments",
      +  "blank"
      +]
    • addedOutput schema / properties / data / properties / longLineCount / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / maintainabilitySignal / maximum
      Added value: +100
    • addedOutput schema / properties / data / properties / maintainabilitySignal / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / maximumFunctionComplexity / minimum
      Added value: +1
    • addedOutput schema / properties / data / properties / maximumLineLength / maximum
      Added value: +2000000
    • addedOutput schema / properties / data / properties / maximumLineLength / minimum
      Added value: +0
    • addedOutput schema / properties / data / properties / reviewSignals / items / additionalProperties
      Added value: +false
    • addedOutput schema / properties / data / properties / reviewSignals / items / properties
      Added value: +{
      +  "code": {
      +    "enum": [
      +      "syntax-error",
      +      "high-complexity-density",
      +      "long-lines",
      +      "work-markers",
      +      "low-comment-density",
      +      "large-source-unit"
      +    ],
      +    "type": "string"
      +  },
      +  "message": {
      +    "maxLength": 500,
      +    "type": "string"
      +  },
      +  "severity": {
      +    "enum": [
      +      "low",
      +      "medium",
      +      "high"
      +    ],
      +    "type": "string"
      +  }
      +}
    • addedOutput schema / properties / data / properties / reviewSignals / items / required
      Added value: +[
      +  "code",
      +  "severity",
      +  "message"
      +]
    • addedOutput schema / properties / data / properties / reviewSignals / items / type
      Added value: +"object"
    • addedOutput schema / properties / data / properties / reviewSignals / maxItems
      Added value: +6
    • addedOutput schema / properties / data / properties / source / additionalProperties
      Added value: +false
    • addedOutput schema / properties / data / properties / source / properties
      Added value: +{
      +  "characters": {
      +    "maximum": 2000000,
      +    "minimum": 1,
      +    "type": "integer"
      +  },
      +  "sha256": {
      +    "pattern": "^[0-9a-f]{64}$",
      +    "type": "string"
      +  },
      +  "utf8Bytes": {
      +    "maximum": 2000000,
      +    "minimum": 1,
      +    "type": "integer"
      +  }
      +}
    • addedOutput schema / properties / data / properties / source / required
      Added value: +[
      +  "sha256",
      +  "characters",
      +  "utf8Bytes"
      +]
    • addedOutput schema / properties / data / properties / syntax / additionalProperties
      Added value: +false
    • addedOutput schema / properties / data / properties / syntax / properties
      Added value: +{
      +  "engine": {
      +    "enum": [
      +      "python-ast",
      +      "lexical-heuristics"
      +    ],
      +    "type": "string"
      +  },
      +  "error": {
      +    "anyOf": [
      +      {
      +        "type": "null"
      +      },
      +      {
      +        "additionalProperties": false,
      +        "properties": {
      +          "line": {
      +            "minimum": 1,
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          },
      +          "message": {
      +            "maxLength": 200,
      +            "type": "string"
      +          },
      +          "offset": {
      +            "minimum": 0,
      +            "type": [
      +              "integer",
      +              "null"
      +            ]
      +          }
      +        },
      +        "required": [
      +          "line",
      +          "offset",
      +          "message"
      +        ],
      +        "type": "object"
      +      }
      +    ]
      +  },
      +  "valid": {
      +    "type": [
      +      "boolean",
      +      "null"
      +    ]
      +  }
      +}
    • addedOutput schema / properties / data / properties / syntax / required
      Added value: +[
      +  "engine",
      +  "valid",
      +  "error"
      +]
    • addedOutput schema / properties / data / properties / workMarkerCount / minimum
      Added value: +0
    • addedOutput schema / properties / data / required
      Added value: +[
      +  "language",
      +  "source",
      +  "lines",
      +  "classes",
      +  "functions",
      +  "branchPoints",
      +  "estimatedCyclomaticComplexity",
      +  "complexityPerFunction",
      +  "maximumFunctionComplexity",
      +  "functionMetrics",
      +  "functionsTruncated",
      +  "syntax",
      +  "maximumLineLength",
      +  "averageLineLength",
      +  "commentDensity",
      +  "blankLineDensity",
      +  "longLineCount",
      +  "workMarkerCount",
      +  "maintainabilitySignal",
      +  "reviewSignals",
      +  "analysis"
      +]
  3. Changed5 schema fields changed
    • addedOutput schema / properties / data / properties / classes
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / data / properties / functionMetrics
      Added value: +{
      +  "items": {},
      +  "type": "array"
      +}
    • addedOutput schema / properties / data / properties / functionsTruncated
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / data / properties / maximumFunctionComplexity
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / data / properties / syntax
      Added value: +{
      +  "type": "object"
      +}
  4. Changed13 schema fields changed
    • addedOutput schema / properties / data / properties / analysis
      Added value: +{
      +  "type": "object"
      +}
    • addedOutput schema / properties / data / properties / averageLineLength
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / data / properties / blankLineDensity
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / data / properties / branchPoints
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / data / properties / commentDensity
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / data / properties / complexityPerFunction
      Added value: +{
      +  "type": "number"
      +}
    • changedOutput schema / properties / data / properties / language / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • addedOutput schema / properties / data / properties / longLineCount
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / data / properties / reviewSignals
      Added value: +{
      +  "items": {},
      +  "type": "array"
      +}
    • addedOutput schema / properties / data / properties / source
      Added value: +{
      +  "type": "object"
      +}
    • addedOutput schema / properties / data / properties / workMarkerCount
      Added value: +{
      +  "type": "integer"
      +}
    • addedOutput schema / properties / meta / properties / next_actions
      Added value: +{
      +  "description": "Optional separately priced follow-up calls. Each action requires a new payment challenge and explicit buyer authorization.",
      +  "items": {
      +    "properties": {
      +      "authorization_required": {
      +        "const": true,
      +        "type": "boolean"
      +      },
      +      "input_template": {
      +        "description": "Client-side template only: $request refers to the original input, $result to this response, and $json(...) serializes its argument. The server does not execute the follow-up.",
      +        "type": "object"
      +      },
      +      "method": {
      +        "const": "POST",
      +        "type": "string"
      +      },
      +      "path": {
      +        "pattern": "^/v1/",
      +        "type": "string"
      +      },
      +      "price": {
      +        "pattern": "^\\$[0-9]+",
      +        "type": "string"
      +      },
      +      "reason": {
      +        "type": "string"
      +      },
      +      "service": {
      +        "type": "string"
      +      },
      +      "title": {
      +        "type": "string"
      +      },
      +      "use_output": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "service",
      +      "title",
      +      "reason",
      +      "method",
      +      "path",
      +      "price",
      +      "input_template",
      +      "use_output",
      +      "authorization_required"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / meta / required
      Previous value: -[
      -  "duration_ms",
      -  "cached",
      -  "sources",
      -  "warnings"
      -]New value: +[
      +  "duration_ms",
      +  "cached",
      +  "sources",
      +  "warnings",
      +  "next_actions"
      +]
  5. Changed2 schema fields changed
    • changedOutput schema / properties / data / properties / lines / type
      Previous value: -"integer"New value: +"object"
    • changedOutput schema / properties / data / properties / maintainabilitySignal / type
      Previous value: -"string"New value: +"integer"
  6. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, destructiveHint=false. The description adds 'without retaining or forwarding the code' (privacy guarantee) and clarifies the trial/payment model (bounded no-wallet trial via separate endpoint; paid MCP call). No contradiction with annotations.

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?

Two sentences: the first packs the main functionality and outputs; the second handles trial/payment info. Front-loaded and waste-free, though dense. Length is appropriate for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, return-value documentation is covered. However, missing parameter semantics and usage guidelines leave gaps. The description covers purpose, behavior, privacy, and payment well, but for a tool with 2 params and 0% schema coverage, it could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 0% description coverage, so the description must compensate. It references 'caller-supplied source code' for the `code` param but never explains the `language` parameter (default 'text', max length 40). No details on acceptable languages, format, or why `code` has a 2MB limit. This is a significant gap.

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?

Description opens with 'Measure caller-supplied source code' – a specific verb and resource. It lists concrete outputs (per-function complexity, SHA-256 fingerprint, density ratios, syntax status, maintainability signals), making the tool's purpose clear and distinguishing it from sibling developer tools like code-change-review or dependency-audit.

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

Usage Guidelines3/5

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

No explicit usage conditions or alternative tools are mentioned. The description implies use for code metrics but doesn't state when to choose this over related tools (e.g., developer.code-change-review). No when-not-to-use guidance is provided.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

TDQS

A3.8/5.0
Disambiguation4/5

Tools are grouped into clear domain prefixes (crypto, data, developer, document, research, web) and each tool name describes a specific function; however, a few umbrella tools like web.full-audit and data.contract overlap with their more targeted counterparts, creating minor ambiguity.

Naming Consistency5/5

All tool names follow a consistent pattern: a domain prefix, a dot, and a hyphenated lowercase compound name (e.g., crypto.base-block-inspect, web.seo-audit). This makes naming predictable and easy to scan.

Tool Count1/5

At 63 tools, the surface area is very large and exceeds the 50+ threshold for extreme mismatch. While the tools are organized into six domains, the sheer number makes it difficult for an agent to select efficiently, and some tools are bundled combinations of others.

Completeness5/5

Each domain offers a thorough set of operations: crypto covers address, account, block, contract, events, gas, and transaction inspection; data covers cleaning, conversion, schema, and validation; developer covers code review, dependency/license audits, and test generation; research covers SEC, OFAC, GLEIF, and USAspending; web covers extraction, SEO, security, and performance. No obvious dead ends exist for the read-only/inspection purpose.

Resources