Skip to main content
Glama

Complexity, signal flow and project statistics

godot_metrics
Read-onlyIdempotent

Measure Godot project complexity, signal wiring, and asset/script stats offline to identify functions to split and broken signal connections before editing.

Instructions

Three measurements from the project's files, offline. op complexity: cyclomatic complexity per function (1 plus every if, elif, for, while, match arm, and, or, ternary) with a grade A to F, lines and nesting; the functions above threshold (default 10) worst first, and the project average. Use it to pick what to split before you change it. op signals: every signal with who emits it and who connects to it (scenes and code), and three lists that are bugs: declared but never emitted, emitted but never connected, and a connection to a method that does not exist; mermaid: true draws the flow. op stats: counts of scripts, scenes, resources and assets, lines of code, comment and blank, how much is typed, the biggest scripts, and the heaviest scenes (nodes, depth, scripts, instances, sub-resources).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "op": "<op>"
    },
    "name": "godot_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
opYeswhat to measure
pathNoproject folder, or a file or folder inside it (relative to the server's folder; default: the current project)
limitNohow many entries to list
mermaidNosignals: return a mermaid flowchart instead of the lists
thresholdNocomplexity: list functions above this (default 10)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, so the description need not restate safety. It adds real context beyond them: "offline" file-based analysis, the default threshold of 10, worst-first ordering, the A–F grading, and the fact that the three signal lists are bugs (declared-never-emitted, emitted-never-connected, missing method). It does not say how results are paginated or truncated.

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?

Op-family-per-sentence structure is front-loaded and dense; each clause carries information (metric definitions, defaults, bug-list meanings). The semicolon-chained complexity sentence is heavy but earns most of its length given three sub-operations.

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?

With five parameters and no output schema, the description does a good job specifying what each op returns, including defaults and ordering. The remaining gap is the interaction between limit and each op, plus path semantics, which an agent must infer.

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 coverage is 100%, so the schema already explains op, path, limit, mermaid, and threshold. The description reinforces threshold's role ("above threshold (default 10) worst first") and mermaid's effect, but never clarifies what limit counts or how path resolution works, so it stays at the baseline.

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 three concrete measurements (cyclomatic complexity per function, signal emitters/connectors, project asset/line counts) and lists the exact metrics each returns. An agent can tell immediately that this is a static-analysis tool, distinct from mutation, edit, or check siblings.

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?

Only the complexity op gets explicit usage guidance: "Use it to pick what to split before you change it." The signals and stats ops are described in terms of output but never say when to reach for them, and no alternative or sibling tool is named for any of the three ops.

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