Skip to content

Errors & recovery ​

Errors are structured data an agent can act on. Never a stack trace, never silent, and every failure names a fix.

The error-code enum ​

The ErrorCode enum (mcp_server/models/envelope.py) has sixteen members. Ten can cross the bridge from the addon:

CodeMeaningTypical cause
PRECONDITION_FAILEDa required state is missingno scene open, missing confirm, toolset version gate
RESOURCE_NOT_FOUNDa node/scene/script/resource path does not existtypo'd path; use get_scene_tree / get_filesystem_tree first
VALIDATION_ERRORparameters are malformed or refusedunknown ProjectSettings key, dimension mismatch, bad enum value
BRIDGE_DISCONNECTEDGodot is not reachableeditor closed / addon disabled / bridge URL wrong
TIMEOUTthe request outlived its timeout (may carry a readiness reason)a capture that never landed; a stalled editor
INTERNAL_ERRORa handler failed without producing a responsea GDScript error inside the addon (see the editor's Output panel)
APPROVAL_DENIEDthe human declined an approvaln/a — retry with different intent
PEER_REPLACEDa server notice to the editor that a second editor took over the bridge (not a tool failure)two editors pointed at one server; the replaced dock shows purple and stops reconnecting (#593)
UNSUPPORTEDthe capability exists but this Godot version cannot provide itpaused-frame stack/eval not exposed to debugger plugins on 4.7 (#677); upgrade or use a supported path
RESPONSE_TOO_LARGEan addon reply exceeded the outbound buffer and was droppedan oversized payload from the editor; narrow the request (#647)

Six are server-side decisions that never reach the bridge (the server rejects before dispatching, or bounds the payload locally):

CodeMeaningTypical cause
PARAM_ERRORa path parameter rejected server-side before the bridge calla script/resource path that isn't res://-contained (res://../…, res:///abs)
OUTPUT_LIMITa result payload would exceed the 25k character capan oversized snapshot_subtree — narrow with max_depth
DOWNLOAD_FAILEDfetching a remote asset faileda bad URL, an HTTP error status, or a transport failure in import_asset
UNDECLARED_PARAMETERan argument the tool does not declare (#757)the hint lists the accepted names; next_call renames a near-miss
CONSENT_MISMATCHa destructive call’s consent token is missing, expired, replayed, or bound to different args (#759)call godot_describe_tool with the exact args, then pass its token as consent
EDITOR_BUSYa mutating call was refused because the editor is importing, showing a modal, or busy (#762)wait for the editor to finish, then retry; godot_health_check shows editor_status

The recovery table ​

Error / symptomFix
unknown toolthe toolset isn't enabled → godot_enable_toolset(...); or you mixed a server-side tool with an editor tool
[required=active_scene]godot_scene_edit_open_scene(path) or create_scene
[required=confirm]destructive call → dry_run first, then confirm=True (or consent when approval is configured)
[required=consent]call godot_describe_tool(tool, args) and pass its token as consent
[required=editor_ready]the editor is importing/modal/busy — retry when godot_health_check reports ready
[required=bridge_connected]open Godot with the addon; check the status dock
[required=runtime_probe]register MCPRuntimeProbe as an autoload
[required=play_session]godot_runtime_play_scene(scene_path=…) before inspecting or injecting input
[required=game_not_breaked]the game is frozen at a debugger break → godot_debugger_continue_execution
[required=godot_version]the toolset needs Godot 4.4+ → upgrade the editor
[required=godot_bin]install Godot or set GODOT_MCP_GODOT_BIN (or GODOT_BIN on CI)
[required=project_dir]set GODOT_MCP_PROJECT_DIR or open the project in Godot
[required=toolset]godot_enable_toolset(category=…) for the tool you are calling
[required=human_approval]configure GODOT_MCP_APPROVAL_WEBHOOK or approve the call in the client
VALIDATION_ERROR: Unknown ProjectSettings key … did you mean …use the suggested key (e.g. application/run/main_scene, not application/config/main_scene)
persisted: false + hintact on the hint (e.g. godot_scene_edit_set_editable_children) or retarget
rescan_pending: truere-run the parse check once; the editor's scan hadn't flushed
NON-ZERO EXIT on a real crashread errors[] from the run; fix and re-verify
RUN TIMED OUTif the game never self-quits, pass expected_timeout=true to godot_debug_workflow

Design rules ​

  1. Failures are data. {ok: false, error, hint} crosses the envelope; the server shapes the same structure into a ToolError for the client.
  2. hint is for recovery — written for an agent with no human in the loop. A hint that restates the code is a bug.
  3. Preconditions carry required — the machine-checkable name of what to satisfy. Errors may also carry next_call (a fully-formed follow-up call) in the result's structuredContent so recovery is executable, not prose (#757).
  4. No partial success. A result never reads as success when the effect half-failed: aborted_at, undoable, persisted, and rescan_pending exist so the agent never has to guess.
  5. No invented codes. Clients match on the enum; a new code is an additive contract change.

The envelope-level rules are pinned by contract tests against a fake addon peer — a shape change without a contract-test update is a drift bug.

208 tools · 29 categories · contract version 1