Spaces:
Running
Running
Merge pull request #413 from jbkoh/exception-logging-for-tools
Browse files
src/fastmcp/tools/tool.py
CHANGED
|
@@ -143,6 +143,7 @@ class Tool(BaseModel):
|
|
| 143 |
|
| 144 |
return _convert_to_content(result, serializer=self.serializer)
|
| 145 |
except Exception as e:
|
|
|
|
| 146 |
raise ToolError(f"Error executing tool {self.name}: {e}") from e
|
| 147 |
|
| 148 |
def to_mcp_tool(self, **overrides: Any) -> MCPTool:
|
|
|
|
| 143 |
|
| 144 |
return _convert_to_content(result, serializer=self.serializer)
|
| 145 |
except Exception as e:
|
| 146 |
+
logger.exception(f"Tool {self.name} failed")
|
| 147 |
raise ToolError(f"Error executing tool {self.name}: {e}") from e
|
| 148 |
|
| 149 |
def to_mcp_tool(self, **overrides: Any) -> MCPTool:
|