Skip to main content
Glama

godot_get_complexity

Calculate cyclomatic complexity for every function in a Godot GDScript file to identify complex code and guide refactoring.

Instructions

Calculate cyclomatic complexity for all functions in a file.

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": {
      "file": "<file>"
    },
    "name": "godot_get_complexity"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileYesFile path to analyze

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations exist, so the description carries the full disclosure burden. It does not state that the operation is read-only/analysis-only (no file mutation), does not mention any complexity threshold or interpretation of results, and says nothing about the response shape or whether the file must exist or be parseable.

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?

A single, front-loaded sentence with no filler or redundancy. It is efficient, though the extreme brevity is part of why behavioral context is thin rather than a structural flaw.

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?

The tool is simple (one required parameter, no nested objects, no output schema), so the description is close to sufficient. However, with no annotations and no output schema, the absence of any return-value or read-only disclosure leaves a meaningful gap for correct invocation.

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% and the single 'file' parameter is fully documented as a file path, so the schema does most of the work. The description adds nothing beyond it, such as whether the path is project-relative or absolute or what happens for non-GDScript files; baseline 3 applies for a one-parameter tool with complete schema coverage.

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?

Specific verb 'Calculate' paired with a precise resource, 'cyclomatic complexity for all functions in a file', which tells an agent exactly what is produced and at what granularity. It contrasts implicitly with the sibling godot_complexity_heatmap, though it never names or frames that distinction explicitly.

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 when-to-use guidance, no prerequisites, and no mention of alternatives such as the complexity heatmap sibling. The agent is left to infer that this is the per-file drill-down versus the project-wide view.

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