Skip to main content
Glama

Format GDScript and C#, safely

godot_format
Idempotent

Formats GDScript and C# files to the official style guide without changing behavior, and skips any file whose tokens or build change, reporting the reason.

Instructions

Formats GDScript to the official style guide without changing what it means: tabs for indentation, no trailing spaces, one space around operators and after commas, none inside brackets, two blank lines around functions, one newline at the end. It keeps the lines as they are (nothing is wrapped, joined or reordered) and leaves strings, comments and node paths byte for byte. A guard compares the tokens before and after; when they differ, or the file is not valid GDScript (mixed indentation, conflict markers, an unclosed bracket), the file is skipped with the reason and never written. Default: list the files that would change; write: true writes them (godot_undo takes it back); diff: true shows the changes. C# files (.cs) are formatted by dotnet format with the project's .editorconfig, restricted to the requested files; it needs the .NET SDK (without it the C# files are skipped with that reason). The same promise holds: after formatting, the outline of each C# file (classes, members, signals, methods, calls, every string literal) must be the same as before and, when the project has a .csproj, it must still build; a file that fails either is put back and reported as skipped. A dry run of C# lists the files and how many lines would change (dotnet format --verify-no-changes); the checks and the diff come with write: true.

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": "godot_format"
  }
}

Input Schema

NameRequiredDescriptionDefault
diffNoshow the changes as a unified diff
pathNoproject folder, or a file or folder inside it (relative to the server's folder; default: the current project)
filesNoonly these res:// files or folders (default: every .gd and .cs script, without addons)
writeNowrite the formatted files (default false: list what would change)
include_addonsNoalso format res://addons/

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare the generic safety profile (readOnly=false, destructive=false, idempotent=true); the description goes far beyond that by disclosing the token-equality guard, the skip-with-reason behavior for invalid files (mixed indentation, conflict markers, unclosed brackets), the .NET SDK dependency for C#, and the build/outline check that reverts failing C# files. These are exactly the failure modes an agent needs to anticipate before calling a formatter that mutates files.

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 safety guarantee and the default/list-then-write model are front-loaded, and the C# specifics are separated into their own sentences rather than buried. It is dense and long for a single block, and a bulleted mode summary (default vs write vs diff) would scan faster, but no sentence is filler.

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 tool with no output schema, five optional parameters, and file-mutating behavior, the description covers what gets reported (files that would change, skip reasons, diffs) and the failure paths per language. It does not describe the shape of the returned result (e.g. how skipped files and reasons are returned), which is the main remaining gap.

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 the baseline is 3; the description still adds semantics the schema lacks, notably that `diff` and the C# verification checks only materialize together with `write: true`, and that a C# dry run reports line counts via `--verify-no-changes`. `include_addons` and the `path` scoping detail are left to the schema, which already documents them.

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 opens with a specific verb+resource ('Formats GDScript to the official style guide') and then covers the second resource (C# via `dotnet format`), so an agent knows exactly what the tool does and that it spans two languages. The concrete style rules (tabs, trailing spaces, operator spacing, blank lines around functions) make it distinguishable from generic editing or checking siblings.

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

Usage Guidelines4/5

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

It states the default mode explicitly ('Default: list the files that would change; write: true writes them') and points to `godot_undo` as the reversal path, which is real usage guidance. It does not name when to prefer this over adjacent verification tools like `godot_check` or `godot_fix`, so it stops short of full when/when-not routing.

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