{"record":{"id":"e5d2123c35791112","repo":"crewAIInc/crewAI","slug":"failed-to-load-tool-pack-e-s","errorCode":null,"errorMessage":"Failed to load Tool Pack: {e!s}","messagePattern":"Failed to load Tool Pack: (.+?)","errorType":"exception","errorClass":"MergeAgentHandlerToolError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/merge_agent_handler_tool/merge_agent_handler_tool.py","lineNumber":348,"sourceCode":"                if not tool_name:\n                    continue\n\n                tool = cls.from_tool_name(\n                    tool_name=tool_name,\n                    tool_pack_id=tool_pack_id,\n                    registered_user_id=registered_user_id,\n                    base_url=base_url,\n                    **kwargs,\n                )\n                tools.append(tool)\n\n            return tools\n\n        except MergeAgentHandlerToolError:\n            raise\n        except Exception as e:\n            logger.error(f\"Failed to create tools from Tool Pack: {e!s}\")\n            raise MergeAgentHandlerToolError(f\"Failed to load Tool Pack: {e!s}\") from e\n","sourceCodeStart":330,"sourceCodeEnd":349,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/merge_agent_handler_tool/merge_agent_handler_tool.py#L330-L349","documentation":"Catch-all in the Tool Pack loader: after filtering and constructing MergeAgentHandlerTool instances for each discovered tool, any non-MergeAgentHandlerToolError exception is wrapped as 'Failed to load Tool Pack: ...' with the cause chained. This guards the loop that maps tools/list results into tool instances, so failures usually come from unexpected tool metadata shapes or constructor validation.","triggerScenarios":"A tool in the pack has no 'name' or missing fields the constructor needs (e.g. building args_schema from a tool without inputSchema); tool_names filter containing names causing downstream KeyErrors; pydantic validation rejecting a field during cls(...) construction.","commonSituations":"A pack containing tools with unusual metadata (function tools with no schema); stale pack version whose entries changed shape; requesting tool_names that mismatch casing.","solutions":["Read e.__cause__ / the 'Failed to create tools from Tool Pack' log line to identify the offending tool","Load without the tool_names filter to see whether one specific tool breaks the batch, then select the ones you need","Retry with names copied verbatim from tools/list output (case-sensitive)","If one tool's missing inputSchema is the cause, exclude it and construct that tool manually"],"exampleFix":"# before\nTOOLS = MergeAgentHandlerTool.from_tool_name(\"a\", PID, UID, tool_names=[\"A\", \"B\"])\n# Failed to load Tool Pack: KeyError ...\n\n# after\nTOOLS = MergeAgentHandlerTool.from_tool_name(\"a\", PID, UID)  # load all\nwanted = {t.tool_name for t in TOOLS}\nassert {\"A\", \"B\"} <= wanted, f\"available: {sorted(wanted)}\"","handlingStrategy":"fallback","validationCode":"def pack_tools_are_wellformed(tools_payload: list[dict]) -> bool:\n    return all(t.get(\"name\") for t in tools_payload)","typeGuard":null,"tryCatchPattern":"try:\n    TOOLS = MergeAgentHandlerTool.from_tool_name(name, PID, UID)\nexcept MergeAgentHandlerToolError as e:\n    if \"Failed to load Tool Pack\" in str(e):\n        TOOLS = MergeAgentHandlerTool.from_tool_name(name, PID, UID)  # no filter, isolate bad tool\n    raise","preventionTips":["Load the full pack first, then filter, so one bad tool does not block all","Log the chained cause to identify which tool entry broke","Version-lock tool packs in production"],"tags":["merge","tool-discovery","error-handling","crewai-tools"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}