diff --git a/vllm/tool_parsers/minimax_m2_tool_parser.py b/vllm/tool_parsers/minimax_m2_tool_parser.py index eb5c46c32..fd8a5f9f2 100644 --- a/vllm/tool_parsers/minimax_m2_tool_parser.py +++ b/vllm/tool_parsers/minimax_m2_tool_parser.py @@ -217,16 +217,13 @@ class MinimaxM2ToolParser(ToolParser): Returns: The converted value """ - if value.lower() == "null": + # Check if the VALUE itself indicates null (not just if null is allowed) + if value.lower() in ("null", "none", "nil"): return None # Normalize types normalized_types = [t.lower() for t in param_types] - # Try null first if it's in the list - if "null" in normalized_types or value.lower() in ("null", "none", "nil"): - return None - # Try each type in order of preference (most specific first, string as fallback) # Priority: integer > number > boolean > object > array > string type_priority = [