We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee54acb commit 5e0953dCopy full SHA for 5e0953d
src/mcp/server/fastmcp/tools/base.py
@@ -1,6 +1,7 @@
1
from __future__ import annotations as _annotations
2
3
import functools
4
+import httpx
5
import inspect
6
from collections.abc import Callable
7
from functools import cached_property
@@ -106,6 +107,12 @@ async def run(
106
107
result = self.fn_metadata.convert_result(result)
108
109
return result
110
+ except httpx.HTTPStatusException as e:
111
+ try:
112
+ error_detail = e.response.json()
113
+ except:
114
+ error_detail = e.response.text
115
+ raise ToolError(f"Error executing tool {self.name}: [{e.response.status_code}] {error_detail}")
116
except Exception as e:
117
raise ToolError(f"Error executing tool {self.name}: {e}") from e
118
0 commit comments