mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-26 23:44:17 +02:00
chore: unify tool not found error message
This commit is contained in:
parent
d6f7dab9e6
commit
a6b7da4599
2 changed files with 2 additions and 2 deletions
|
|
@ -106,7 +106,7 @@ class ToolManager:
|
|||
if key in self._tools:
|
||||
del self._tools[key]
|
||||
else:
|
||||
raise NotFoundError(f"Tool {key!r} not found.")
|
||||
raise NotFoundError(f"Unknown tool: {key}")
|
||||
|
||||
async def call_tool(
|
||||
self, key: str, arguments: dict[str, Any]
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class TestAddTools:
|
|||
def test_remove_tool_missing_key(self):
|
||||
"""Test removing a tool that does not exist raises NotFoundError."""
|
||||
manager = ToolManager()
|
||||
with pytest.raises(NotFoundError, match="Tool 'missing' not found"):
|
||||
with pytest.raises(NotFoundError, match=f"Unknown tool: {'missing'}"):
|
||||
manager.remove_tool("missing")
|
||||
|
||||
def test_warn_on_duplicate_tools(self, caplog):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue