{"record":{"id":"92f81f8ef6fc53b8","repo":"hiyouga/LlamaFactory","slug":"tool-utils-name-not-found","errorCode":null,"errorMessage":"Tool utils `{name}` not found.","messagePattern":"Tool utils `(.+?)` not found\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/llamafactory/data/tool_utils.py","lineNumber":904,"sourceCode":"    \"gemma4\": Gemma4ToolUtils(),\n    \"glm4\": GLM4ToolUtils(),\n    \"llama3\": Llama3ToolUtils(),\n    \"lfm2\": LFM2ToolUtils(),\n    \"minimax1\": MiniMaxM1ToolUtils(),\n    \"minimax2\": MiniMaxM2ToolUtils(),\n    \"mistral\": MistralToolUtils(),\n    \"qwen\": QwenToolUtils(),\n    \"qwen3_5\": Qwen35ToolUtils(),\n    \"glm4_moe\": GLM4MOEToolUtils(),\n    \"seed_oss\": SeedToolUtils(),\n    \"ling\": LingToolUtils(),\n}\n\n\ndef get_tool_utils(name: str) -> \"ToolUtils\":\n    tool_utils = TOOLS.get(name, None)\n    if tool_utils is None:\n        raise ValueError(f\"Tool utils `{name}` not found.\")\n\n    return tool_utils\n","sourceCodeStart":886,"sourceCodeEnd":907,"githubUrl":"https://github.com/hiyouga/LlamaFactory/blob/f28afaf6355af515454dfb16c97d728307c93897/src/llamafactory/data/tool_utils.py#L886-L907","documentation":"get_tool_utils maps a tool_format name to a ToolUtils instance via the TOOLS registry dict. An unknown name raises ValueError('Tool utils `name` not found.'). This happens when tool_format in DataArguments or dataset_info.json does not match a registry key.","triggerScenarios":"Setting tool_format: <name> to a typo'd or version-removed key (e.g. 'glm4' vs 'glm4_moe', 'react' variants); referencing a custom tool format registered in another process; keys renamed across LlamaFactory versions.","commonSituations":"Upgrading LlamaFactory where tool format names changed; hand-writing dataset_info.json tool_format values from memory; community configs referencing formats that no longer exist.","solutions":["List valid keys: python -c \"from llamafactory.data.tool_utils import TOOLS; print(sorted(TOOLS))\" and use an exact key.","Fix the typo in tool_format (config YAML or dataset_info.json).","If a format was removed in an upgrade, migrate to its renamed successor (see the repo's tool_utils registry)."],"exampleFix":"# before\n\"tool_format\": \"glm4moe\"\n\n# after\n\"tool_format\": \"glm4_moe\"","handlingStrategy":"validation","validationCode":"from llamafactory.data.tool_utils import TOOLS\n\nassert my_tool_format in TOOLS, f\"{my_tool_format} not in {sorted(TOOLS)}\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy tool_format keys from TOOLS in tool_utils.py (or print sorted(TOOLS)).","Treat config renames as breaking changes when upgrading LlamaFactory; re-check tool_format keys."],"tags":["tools","config","typo"],"backgroundTag":null,"analyzedSha":"f28afaf6355af515454dfb16c97d728307c93897","analyzedAt":"2026-08-14T21:57:28.298Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}