diff --git a/astrbot/core/sandbox/tools/python.py b/astrbot/core/sandbox/tools/python.py index fe01dc50a..791a7e691 100644 --- a/astrbot/core/sandbox/tools/python.py +++ b/astrbot/core/sandbox/tools/python.py @@ -62,6 +62,11 @@ class PythonTool(FunctionTool): if text: resp.content.append(mcp.types.TextContent(type="text", text=text)) + if not resp.content: + resp.content.append( + mcp.types.TextContent(type="text", text="No output.") + ) + return resp except Exception as e: