Skip to content

Commit 4f2ff21

Browse files
committed
[Audit v2 #365] WIP checkpoint: enrich error-code vocabulary
Ship-ready checkpoint at 47% reduction (471 → 250 INVALID_PARAMS sites in handlers). Awaiting maintainer feedback on whether to stretch semantics for the remaining 250 (mostly RESOURCE_NOT_FOUND-shaped and WRONG_TYPE-shaped catch-alls that don't fit the 4 mandated codes) or ship as-is. Added 4 new codes to both files: - NODE_NOT_FOUND - PROPERTY_NOT_ON_CLASS - VALUE_OUT_OF_RANGE - MISSING_REQUIRED_PARAM Migrations applied: - MISSING_REQUIRED_PARAM (~100 sites): 'Missing required param: X', 'commands[N] missing field', 'Each keyframe must have field', 'Every layout node requires a type'. - NODE_NOT_FOUND (~35 sites): McpScenePath.format_node_error/ format_parent_error helpers, 'Source node not found', 'Target not found', '<role> node not found', 'Autoload X not found'. - PROPERTY_NOT_ON_CLASS (~15 sites): McpPropertyErrors.build_message uses, 'Property X not present/found on Y', 'Signal X not found on Y', 'Method X not found on Y', 'Shader uniform X not declared on shader', 'Slot X not supported on Y'. - VALUE_OUT_OF_RANGE (~25 sites): 'X must be > 0', 'Index N out of range', 'pass must be 1..4', 'Invalid <enum>. Valid: ...', 'Unknown <enum>. Valid: ...', 'Unsupported event_type'. Parity test (existing) still green; GDScript parse scan clean. Tests + count-regression test + per-code handler tests still TODO.
1 parent 01d35ad commit 4f2ff21

28 files changed

Lines changed: 230 additions & 214 deletions

plugin/addons/godot_ai/handlers/animation_handler.gd

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func create_player(params: Dictionary) -> Dictionary:
5858
if not parent_path.is_empty():
5959
parent = McpScenePath.resolve(parent_path, scene_root)
6060
if parent == null:
61-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, McpScenePath.format_parent_error(parent_path, scene_root))
61+
return McpErrorCodes.make(McpErrorCodes.NODE_NOT_FOUND, McpScenePath.format_parent_error(parent_path, scene_root))
6262

6363
var player := AnimationPlayer.new()
6464
if not node_name.is_empty():
@@ -97,14 +97,14 @@ func create_animation(params: Dictionary) -> Dictionary:
9797
var loop_mode_str: String = params.get("loop_mode", "none")
9898

9999
if player_path.is_empty():
100-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
100+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
101101
if anim_name.is_empty():
102-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: name")
102+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: name")
103103
if length <= 0.0:
104-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "length must be > 0 (got %s)" % length)
104+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "length must be > 0 (got %s)" % length)
105105

106106
if not _LOOP_MODES.has(loop_mode_str):
107-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
107+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE,
108108
"Invalid loop_mode '%s'. Valid: %s" % [loop_mode_str, ", ".join(_LOOP_MODES.keys())])
109109

110110
var resolved := _resolve_player(player_path, true)
@@ -158,9 +158,9 @@ func delete_animation(params: Dictionary) -> Dictionary:
158158
var anim_name: String = params.get("animation_name", "")
159159

160160
if player_path.is_empty():
161-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
161+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
162162
if anim_name.is_empty():
163-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: animation_name")
163+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: animation_name")
164164

165165
var resolved := _resolve_player(player_path)
166166
if resolved.has("error"):
@@ -210,17 +210,17 @@ func add_property_track(params: Dictionary) -> Dictionary:
210210
var interp_str: String = params.get("interpolation", "linear")
211211

212212
if player_path.is_empty():
213-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
213+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
214214
if anim_name.is_empty():
215-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: animation_name")
215+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: animation_name")
216216
if track_path.is_empty():
217217
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
218218
"Missing required param: track_path (format: 'NodeName:property', e.g. 'Panel:modulate')")
219219
if not track_path.contains(":"):
220220
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
221221
"track_path must include ':property' suffix (e.g. 'Panel:modulate', '.:position')")
222222
if not _INTERP_MODES.has(interp_str):
223-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
223+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE,
224224
"Invalid interpolation '%s'. Valid: %s" % [interp_str, ", ".join(_INTERP_MODES.keys())])
225225
if typeof(keyframes) != TYPE_ARRAY or keyframes.is_empty():
226226
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "keyframes must be a non-empty array")
@@ -247,9 +247,9 @@ func add_property_track(params: Dictionary) -> Dictionary:
247247
if typeof(kf) != TYPE_DICTIONARY:
248248
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Each keyframe must be a dictionary")
249249
if not "time" in kf:
250-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Each keyframe must have a 'time' field")
250+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Each keyframe must have a 'time' field")
251251
if not "value" in kf:
252-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Each keyframe must have a 'value' field")
252+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Each keyframe must have a 'value' field")
253253
var coerce_result := AnimationValues.coerce_with_context(kf.get("value"), ctx)
254254
if coerce_result.has("error"):
255255
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, coerce_result.error)
@@ -309,11 +309,11 @@ func add_method_track(params: Dictionary) -> Dictionary:
309309
var keyframes = params.get("keyframes", [])
310310

311311
if player_path.is_empty():
312-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
312+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
313313
if anim_name.is_empty():
314-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: animation_name")
314+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: animation_name")
315315
if target_path.is_empty():
316-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: target_node_path")
316+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: target_node_path")
317317
if target_path.contains(":"):
318318
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
319319
"target_node_path is a bare NodePath without ':property' (got '%s'). " % target_path +
@@ -325,9 +325,9 @@ func add_method_track(params: Dictionary) -> Dictionary:
325325
if typeof(kf) != TYPE_DICTIONARY:
326326
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Each keyframe must be a dictionary")
327327
if not "time" in kf:
328-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Each keyframe must have a 'time' field")
328+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Each keyframe must have a 'time' field")
329329
if not "method" in kf:
330-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Each keyframe must have a 'method' field")
330+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Each keyframe must have a 'method' field")
331331
var method_field = kf.get("method")
332332
if typeof(method_field) != TYPE_STRING or (method_field as String).is_empty():
333333
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'method' must be a non-empty string")
@@ -391,7 +391,7 @@ func set_autoplay(params: Dictionary) -> Dictionary:
391391
var anim_name: String = params.get("animation_name", "")
392392

393393
if player_path.is_empty():
394-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
394+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
395395

396396
var resolved := _resolve_player(player_path)
397397
if resolved.has("error"):
@@ -400,7 +400,7 @@ func set_autoplay(params: Dictionary) -> Dictionary:
400400

401401
# Allow empty string to clear autoplay; otherwise validate the name exists.
402402
if not anim_name.is_empty() and not player.has_animation(anim_name):
403-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
403+
return McpErrorCodes.make(McpErrorCodes.PROPERTY_NOT_ON_CLASS,
404404
"Animation '%s' not found on player at %s" % [anim_name, player_path])
405405

406406
var old_autoplay: String = player.autoplay
@@ -430,15 +430,15 @@ func play(params: Dictionary) -> Dictionary:
430430
var anim_name: String = params.get("animation_name", "")
431431

432432
if player_path.is_empty():
433-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
433+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
434434

435435
var resolved := _resolve_player(player_path)
436436
if resolved.has("error"):
437437
return resolved
438438
var player: AnimationPlayer = resolved.player
439439

440440
if not anim_name.is_empty() and not player.has_animation(anim_name):
441-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
441+
return McpErrorCodes.make(McpErrorCodes.PROPERTY_NOT_ON_CLASS,
442442
"Animation '%s' not found on player at %s" % [anim_name, player_path])
443443

444444
player.play(anim_name)
@@ -461,7 +461,7 @@ func stop(params: Dictionary) -> Dictionary:
461461
var player_path: String = params.get("player_path", "")
462462

463463
if player_path.is_empty():
464-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
464+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
465465

466466
var resolved := _resolve_player(player_path)
467467
if resolved.has("error"):
@@ -490,13 +490,13 @@ func create_simple(params: Dictionary) -> Dictionary:
490490
var loop_mode_str: String = params.get("loop_mode", "none")
491491

492492
if player_path.is_empty():
493-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
493+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
494494
if anim_name.is_empty():
495-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: name")
495+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: name")
496496
if typeof(tweens) != TYPE_ARRAY or tweens.is_empty():
497497
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "tweens must be a non-empty array")
498498
if not _LOOP_MODES.has(loop_mode_str):
499-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
499+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE,
500500
"Invalid loop_mode '%s'. Valid: %s" % [loop_mode_str, ", ".join(_LOOP_MODES.keys())])
501501

502502
# Validate all tween specs before touching the scene.
@@ -506,10 +506,10 @@ func create_simple(params: Dictionary) -> Dictionary:
506506
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Each tween spec must be a dictionary")
507507
for field in ["target", "property", "from", "to", "duration"]:
508508
if not field in spec:
509-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
509+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM,
510510
"Each tween spec must have '%s'" % field)
511511
if float(spec.get("duration", 0.0)) <= 0.0:
512-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
512+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE,
513513
"tween 'duration' must be > 0")
514514
var dup_key: String = str(spec.target) + ":" + str(spec.property)
515515
if seen_paths.has(dup_key):
@@ -525,7 +525,7 @@ func create_simple(params: Dictionary) -> Dictionary:
525525
if has_length:
526526
computed_length = float(params.get("length"))
527527
if computed_length <= 0.0:
528-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
528+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE,
529529
"'length' must be > 0 when provided (got %s)" % str(params.get("length")))
530530
else:
531531
for spec in tweens:
@@ -732,7 +732,7 @@ func _resolve_player(player_path: String, create_if_missing: bool = false) -> Di
732732
var node := McpScenePath.resolve(player_path, scene_root)
733733
if node == null:
734734
if not create_if_missing:
735-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, McpScenePath.format_node_error(player_path, scene_root))
735+
return McpErrorCodes.make(McpErrorCodes.NODE_NOT_FOUND, McpScenePath.format_node_error(player_path, scene_root))
736736
return _instantiate_player(player_path, scene_root)
737737
if not node is AnimationPlayer:
738738
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
@@ -814,7 +814,7 @@ func _resolve_or_create_player(player_path: String) -> Dictionary:
814814
else:
815815
parent = McpScenePath.resolve(parent_path, scene_root)
816816
if parent == null:
817-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
817+
return McpErrorCodes.make(McpErrorCodes.NODE_NOT_FOUND,
818818
"Node not found: %s (and its parent %s also does not exist — create the parent first)" %
819819
[player_path, parent_path])
820820
var new_player := AnimationPlayer.new()
@@ -834,7 +834,7 @@ func _resolve_player_read(player_path: String) -> Dictionary:
834834
return McpErrorCodes.make(McpErrorCodes.EDITOR_NOT_READY, "No scene open")
835835
var node := McpScenePath.resolve(player_path, scene_root)
836836
if node == null:
837-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, McpScenePath.format_node_error(player_path, scene_root))
837+
return McpErrorCodes.make(McpErrorCodes.NODE_NOT_FOUND, McpScenePath.format_node_error(player_path, scene_root))
838838
if not node is AnimationPlayer:
839839
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
840840
"Node at %s is not an AnimationPlayer (got %s)" % [player_path, node.get_class()])
@@ -846,7 +846,7 @@ func _resolve_player_read(player_path: String) -> Dictionary:
846846
## as returned by `list_animations` for non-default libraries.
847847
func _resolve_animation(player: AnimationPlayer, anim_name: String) -> Dictionary:
848848
if not player.has_animation(anim_name):
849-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
849+
return McpErrorCodes.make(McpErrorCodes.PROPERTY_NOT_ON_CLASS,
850850
"Animation '%s' not found on player. Available: %s" % [
851851
anim_name,
852852
", ".join(Array(player.get_animation_list()))

plugin/addons/godot_ai/handlers/animation_presets.gd

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ func preset_fade(params: Dictionary) -> Dictionary:
4343
var overwrite: bool = params.get("overwrite", false)
4444

4545
if player_path.is_empty():
46-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
46+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
4747
if target_path.is_empty():
48-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: target_path")
48+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: target_path")
4949
if mode != "in" and mode != "out":
50-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
50+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE,
5151
"Invalid mode '%s'. Valid: 'in', 'out'" % mode)
5252
if duration <= 0.0:
53-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'duration' must be > 0")
53+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'duration' must be > 0")
5454

5555
var handler = _h()
5656
if handler == null:
@@ -138,17 +138,17 @@ func preset_slide(params: Dictionary) -> Dictionary:
138138
var overwrite: bool = params.get("overwrite", false)
139139

140140
if player_path.is_empty():
141-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
141+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
142142
if target_path.is_empty():
143-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: target_path")
143+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: target_path")
144144
if not ["left", "right", "up", "down"].has(direction):
145-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
145+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE,
146146
"Invalid direction '%s'. Valid: 'left', 'right', 'up', 'down'" % direction)
147147
if mode != "in" and mode != "out":
148-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS,
148+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE,
149149
"Invalid mode '%s'. Valid: 'in', 'out'" % mode)
150150
if duration <= 0.0:
151-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'duration' must be > 0")
151+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'duration' must be > 0")
152152

153153
var handler = _h()
154154
if handler == null:
@@ -174,7 +174,7 @@ func preset_slide(params: Dictionary) -> Dictionary:
174174
var default_distance: float = 1.0 if kind == "3d" else 100.0
175175
var distance: float = float(params.get("distance", default_distance))
176176
if distance == 0.0:
177-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'distance' must be non-zero")
177+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'distance' must be non-zero")
178178

179179
var offset: Variant = _direction_offset(kind, direction, distance)
180180
var current_pos: Variant = target.position
@@ -242,13 +242,13 @@ func preset_shake(params: Dictionary) -> Dictionary:
242242
var overwrite: bool = params.get("overwrite", false)
243243

244244
if player_path.is_empty():
245-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
245+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
246246
if target_path.is_empty():
247-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: target_path")
247+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: target_path")
248248
if duration <= 0.0:
249-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'duration' must be > 0")
249+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'duration' must be > 0")
250250
if frequency <= 0.0:
251-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'frequency' must be > 0")
251+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'frequency' must be > 0")
252252

253253
var handler = _h()
254254
if handler == null:
@@ -273,7 +273,7 @@ func preset_shake(params: Dictionary) -> Dictionary:
273273
var default_intensity: float = 0.1 if kind == "3d" else 10.0
274274
var intensity: float = float(params.get("intensity", default_intensity))
275275
if intensity <= 0.0:
276-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'intensity' must be > 0")
276+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'intensity' must be > 0")
277277

278278
if anim_name.is_empty():
279279
anim_name = "shake"
@@ -354,15 +354,15 @@ func preset_pulse(params: Dictionary) -> Dictionary:
354354
var overwrite: bool = params.get("overwrite", false)
355355

356356
if player_path.is_empty():
357-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: player_path")
357+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: player_path")
358358
if target_path.is_empty():
359-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "Missing required param: target_path")
359+
return McpErrorCodes.make(McpErrorCodes.MISSING_REQUIRED_PARAM, "Missing required param: target_path")
360360
if duration <= 0.0:
361-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'duration' must be > 0")
361+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'duration' must be > 0")
362362
if from_scale <= 0.0:
363-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'from_scale' must be > 0")
363+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'from_scale' must be > 0")
364364
if to_scale <= 0.0:
365-
return McpErrorCodes.make(McpErrorCodes.INVALID_PARAMS, "'to_scale' must be > 0")
365+
return McpErrorCodes.make(McpErrorCodes.VALUE_OUT_OF_RANGE, "'to_scale' must be > 0")
366366

367367
var handler = _h()
368368
if handler == null:

0 commit comments

Comments
 (0)