{"record":{"id":"0a01afe3689470e2","repo":"agentscope-ai/agentscope","slug":"toolgroupinactiveerror-the-tool-tool-name-in","errorCode":null,"errorMessage":"ToolGroupInactiveError: The tool '{tool_name}' in group '{all_tools[tool_name].group}' is currently inactive. You should first activate the group by calling the '{self.builtin_meta_tool.tool.name}' tool.","messagePattern":"ToolGroupInactiveError: The tool '(.+?)' in group '(.+?)' is currently inactive\\. You should first activate the group by calling the '(.+?)' tool\\.","errorType":"exception","errorClass":"ToolGroupInactiveError","httpStatus":null,"severity":"error","filePath":"src/agentscope/tool/_toolkit.py","lineNumber":584,"sourceCode":"        Returns:\n            `ToolBase`:\n                If the tool is available, return the corresponding ToolBase\n                object. Otherwise, raise the agent-oriented exception with the\n                error message.\n        \"\"\"\n        tools = await self._get_available_tools(activated_groups)\n        if tool_name not in tools:\n            # The dict above is already filtered to the basic + activated\n            # groups, so a tool from an inactive group is missing from it.\n            # Look the name up across all registered groups to distinguish\n            # \"inactive\" from \"doesn't exist\" - the same fallback call_tool\n            # performs - so the agent gets the activation hint instead of a\n            # misleading not-found error.\n            all_tools = await self._get_available_tools(\n                [_.name for _ in self.tool_groups],\n            )\n            if tool_name in all_tools:\n                raise ToolGroupInactiveError(\n                    f\"ToolGroupInactiveError: The tool '{tool_name}' in \"\n                    f\"group '{all_tools[tool_name].group}' is currently \"\n                    f\"inactive. You should first activate the group by \"\n                    f\"calling the \"\n                    f\"'{self.builtin_meta_tool.tool.name}' tool.\",\n                )\n            raise ToolNotFoundError(\n                f\"ToolNotFoundError: The tool named '{tool_name}' doesn't \"\n                f\"exist.\",\n            )\n\n        return tools[tool_name].tool\n\n    async def get_tool(self, name: str) -> ToolBase | None:\n        \"\"\"Get tool instance by its name.\n\n        Args:\n            name (`str`):","sourceCodeStart":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/agentscope-ai/agentscope/blob/e90f1c7592896cc95f6e5ee506194f533378247d/src/agentscope/tool/_toolkit.py#L566-L602","documentation":"Toolkit.check_tool_available raises ToolGroupInactiveError when the requested tool exists but lives in a tool group that is currently inactive (not activated). The message tells the LLM/agent to activate the group first via the built-in meta tool instead of treating it as a missing tool.","triggerScenarios":"The agent calls a tool whose group has not been activated yet; check_tool_available looks the name up across all (including inactive) groups, finds it, and raises this hint error.","commonSituations":"Agents with lazy/on-demand group activation calling a tool before invoking the activation meta tool; tests exercising inactive-group behavior; forgetting the activation step in a scripted tool sequence.","solutions":["Have the agent call the built-in meta tool (named in the error message) to activate the group before calling the tool","If the tool should always be available, configure its group to be active by default / remove it from lazy activation","Catch ToolGroupInactiveError in your orchestration layer and re-prompt the model with the activation hint"],"exampleFix":"# before\nresult = await toolkit.call_tool('search_docs', {...})  # group inactive\n# after\nawait toolkit.call_tool(meta_tool_name, {'action': 'activate', 'group': 'search'})\nresult = await toolkit.call_tool('search_docs', {...})","handlingStrategy":"try-catch","validationCode":"active = await toolkit._get_available_tools([g.name for g in toolkit.tool_groups if g.is_active])\nif tool_name not in active:\n    # activate group or pick another tool","typeGuard":null,"tryCatchPattern":"try:\n    tool = await toolkit.check_tool_available(name)\nexcept ToolGroupInactiveError as e:\n    # instruct the model to call the activation meta tool, then retry\n    await activate_group(meta_tool_name, group)","preventionTips":["Mark frequently used groups as active by default","Feed the activation hint from the error message back to the agent"],"tags":["toolkit","inactive-group","agent","activation"],"backgroundTag":"resource-not-activated","analyzedSha":"e90f1c7592896cc95f6e5ee506194f533378247d","analyzedAt":"2026-08-28T18:24:12.087Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}