Skip to content

Commit d02304d

Browse files
authored
Improve error logging for missing tools
Log available tools when a specified tool is not found.
1 parent d63c899 commit d02304d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

astrbot/core/agent/runners/tool_loop_agent_runner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,16 +738,18 @@ def _append_tool_call_result(tool_call_id: str, content: str) -> None:
738738
# in 'skills_like' mode, raw.func_tool is light schema, does not have handler
739739
# so we need to get the tool from the raw tool set
740740
func_tool = self._skill_like_raw_tool_set.get_tool(func_tool_name)
741+
available_tools = self._skill_like_raw_tool_set.names()
741742
else:
742743
func_tool = req.func_tool.get_tool(func_tool_name)
744+
available_tools = req.func_tool.names()
743745

744746
logger.info(f"使用工具:{func_tool_name},参数:{func_tool_args}")
745747

746748
if not func_tool:
747749
logger.warning(f"未找到指定的工具: {func_tool_name},将跳过。")
748750
_append_tool_call_result(
749751
func_tool_id,
750-
f"error: Tool {func_tool_name} not found.",
752+
f"error: Tool {func_tool_name} not found. Available tools are: {', '.join(available_tools)}",
751753
)
752754
continue
753755

0 commit comments

Comments
 (0)