Skip to main content
Glama

Run Godot headless

godot_cli
Destructive

Run Godot 4 headlessly to import assets, smoke-test scenes, export presets, and execute GDScript from the command line without opening a window.

Instructions

Run the Godot 4 engine from the command line with --headless (dummy renderer, no window ever appears) on a text project (project.godot, .tscn, .tres, .gd). Pass projectPath (the folder with project.godot). Common: args ["--import"] imports assets and generates .import/.uid files (Godot 4.3+; older: ["--editor", "--quit"]); args ["--quit-after", "120"] smoke-tests the main scene for 120 frames; args ["--export-release", "Web", "/abs/out/index.html"] exports a preset from export_presets.cfg (export templates for the exact version must be installed); args ["--version"]. Run GDScript with code or scriptPath: code without an extends line is wrapped as a SceneTree script that quits when done; a full script must extend SceneTree or MainLoop and call quit(). Script and engine errors (ERROR:, SCRIPT ERROR:) are collected and fail the call, since Godot often exits 0 after them. Headless renders no frames: for screenshots export to Web and capture in headless Chromium. Refuses the project manager and window-only flags; allowWindow: true lifts that for Movie Maker (--write-movie) captures, only when the user has agreed to a window.

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_cli"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoGodot arguments, e.g. ["--import"] or ["--export-release", "Web", "/abs/path/index.html"]
codeNoGDScript to run (with --script). Without `extends`, it is wrapped in a SceneTree script that quits when done
userArgsNoArguments for the script, read with OS.get_cmdline_user_args()
scriptPathNoA .gd file to run instead of code: absolute path or res:// path
allowWindowNoRun without --headless. Only for Movie Maker captures the user explicitly agreed to
projectPathNoFolder containing project.godot, usually the job's game/ folder
failOnErrorsNoTreat ERROR / SCRIPT ERROR lines in the output as failure
timeoutMinutesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.7.1

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations, it discloses critical behavior: no window ever appears in headless mode, script errors are collected and fail the call even when Godot exits 0, code without `extends` is wrapped in a SceneTree script, and the project manager or window-only flags are refused. These are exactly the operational details an agent needs before invoking a destructive command-line runner.

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 description is front-loaded with the core action and then uses a 'Common:' list to organize invocation patterns. It is dense and long, but nearly every clause carries operational information rather than filler.

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

Completeness5/5

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

For a complex CLI wrapper with no output schema, the description covers the important behavioral gaps: error handling, headless limitations, export prerequisites, script wrapping, and the narrow windowed-mode exception. An agent has enough information to select and invoke the tool correctly.

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 high at 88%, so the baseline is 3, but the description adds concrete examples for `args` and explains how `code` and `scriptPath` differ in execution behavior. It adds meaningful semantics beyond the schema, though it does not elaborate on `userArgs`, `failOnErrors`, or `timeoutMinutes`.

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 and resource: 'Run the Godot 4 engine from the command line with --headless'. It immediately clarifies the execution mode, renderer behavior, and project type, so an agent cannot confuse it with a generic shell or unrelated creative tool.

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

Usage Guidelines5/5

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

It gives explicit when-to-use guidance for the major modes: '--import', '--quit-after', '--export-release', '--version', and running GDScript via code or scriptPath. It also states when not to use windowed mode ('allowWindow: true ... only when the user has agreed to a window') and redirects screenshot workflows to Web export plus headless Chromium.

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