Too few arguments for "…()" call. Expected at least N but received M in Godot 4
The call passes fewer arguments than the function's required parameters. heal(5) on func heal(amount: int, source: String) fails to parse with Too few arguments for "heal()" call. Expected at least 2 but received 1. Pass every required argument, or give the later parameters default values.
AppImage, x86_64. Ubuntu 22.04, Debian 12, Fedora 39 or newer.
Intel or AMD Chromebook, with Linux turned on.
What Godot is checking
When the analyzer knows which function is called, it counts the parameters without a default value and compares them with the arguments. Too few stops the script at load time.
When it cannot know, through an untyped variable, the count is checked at run time instead and the message is Invalid call to function 'heal' in base '…'. Expected 2 argument(s).
More on this: Invalid operands 'String' and 'int' in operator '+' in Godot 4
Reproduce it
A heal(amount, source) function called with one argument.
extends Node
func heal(amount: int, source: String) -> void:
print("healed ", amount, " by ", source)
func _ready() -> void:
heal(5)
What Godot 4.7.2 prints
More on this: PoolStringArray in Godot 4: it is PackedStringArray now
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
SCRIPT ERROR: Parse Error: Too few arguments for "heal()" call. Expected at least 2 but received 1.
at: GDScript::reload (res://answers/too-few-arguments-for-call-expected-at-least/repro.gd:7)
ERROR: Failed to load script "res://answers/too-few-arguments-for-call-expected-at-least/repro.gd" with error "Parse error".
at: load (modules/gdscript/gdscript_resource_format.cpp:46)Fix it
Give the second parameter a default, so both calls work.
extends Node
func heal(amount: int, source: String = "potion") -> void:
print("healed ", amount, " by ", source)
func _ready() -> void:
heal(5)
heal(5, "fountain")
What the fixed script prints
Godot Engine v4.7.2.stable.mono.official.ed1daf0bf - https://godotengine.org
healed 5 by potion
healed 5 by fountainRun this fix with your agent
Flockbay is the Godot editor with an AI agent built in. Paste this into Flockbay's chat, or into Claude Code or Codex connected to Flockbay over MCP: the agent finds the cause in your project, applies the fix, runs the game headless and reads Godot's output to check it.
More on this: Expected indented block after function declaration in Godot 4
My Godot 4 project prints this error: "Parse Error: Too few arguments for "heal()" call. Expected at least 2 but received 1.". Find where it comes from and fix it. The call passes fewer arguments than the function's required parameters. heal(5) on func heal(amount: int, source: String) fails to parse with Too few arguments for "heal()" call. Expected at least 2 but received 1. Pass every required argument, or give the later parameters default values. Then run the game headless and check that Godot's output no longer shows it.Verified on Godot 4.7.2
Both scripts on this page were run headless on Godot 4.7.2 (4.7.2.stable.mono.official.ed1daf0bf) on 18 October 2026, and the output above is what Godot printed, unedited.
Where the check lives in Godot's source: gdscript_analyzer.cpp line 6075, the message.
Questions
- Can default parameters come before required ones?
- No. Once a parameter has a default, every parameter after it needs one too.
- Does this apply to signals I emit?
- Emitting with fewer arguments than the signal declares is not checked at parse time; the connected methods fail when they are called.
Flockbay's agent reads Godot's debugger output and fixes errors like this one in your project, on the official Godot.
Download Flockbay free