Skip to main content
Glama

BRAINIAC Source Code Structure & Correctness Checks

Index source maintainability

code_maintainability-index

Build a structural AST from a caller-supplied JavaScript, TypeScript, Python, or Go snippet, or from a caller-supplied AST, and score cyclomatic complexity, cognitive load, nesting depth, and duplicated function structure. The snippet is not executed or stored. Price $0.04 USDC. POST /api/v1/code/maintainability-index. Unpaid calls return 402 and do not run.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "code_maintainability-index"
  }
}

Input Schema

NameRequiredDescriptionDefault
astNo
sourceNo
languageNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.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 discloses that the snippet is not executed or stored, states the price ($0.04 USDC), the endpoint (POST /api/v1/code/maintainability-index), and that unpaid calls return 402 and do not run. These are concrete operational facts an agent needs. It omits rate limits and the shape of the returned score payload, keeping it below a 5.

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?

The definition is dense and front-loaded: what it builds, what it scores, then the non-execution guarantee, price, endpoint, and payment behavior. Every sentence carries information. The price and endpoint lines are arguably operational metadata rather than behavior, but they earn their place for a paid API.

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

Completeness4/5

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

For a three-parameter tool with no annotations and no output schema, the description covers the important ground: inputs accepted, metrics produced, side-effect profile, and payment behavior. The remaining gaps, mainly the source-vs-ast exclusivity rule and the response format, are minor but real, so it is not fully complete.

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 0%, so the description must compensate. It adds real meaning by listing the accepted languages (JavaScript, TypeScript, Python, Go) and by establishing that either a snippet or a caller-supplied AST can be provided. It does not clarify whether source and ast are mutually exclusive, which one wins if both are passed, or which is required, leaving a meaningful gap for three parameters.

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 uses specific verbs and resources: 'Build a structural AST' and 'score cyclomatic complexity, cognitive load, nesting depth, and duplicated function structure.' This clearly differentiates the tool's analysis domain from siblings like change-coupling or concurrency-hazard. However, it does not name any sibling or explicitly state the contrast, so it stops short of a 5.

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

Usage Guidelines2/5

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

There is no explicit when-to-use or when-not-to-use guidance. The description mentions that a caller can supply a snippet or an AST, which is a parameter-choice hint, not a routing rule between tools. An agent gets no guidance on when this maintainability analysis is the right pick versus the other code analysis siblings.

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.

Resources