Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/mcp/server/mcpserver/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ async def read_resource(
context = Context(mcp_server=self)
try:
resource = await self._resource_manager.get_resource(uri, context)
except ValueError:
raise ResourceError(f"Unknown resource: {uri}")
except ValueError as exc:
raise ResourceError(f"Unknown resource: {uri}") from exc

try:
content = await resource.read()
Expand Down Expand Up @@ -1109,4 +1109,4 @@ async def get_prompt(
)
except Exception as e:
logger.exception(f"Error getting prompt {name}")
raise ValueError(str(e))
raise ValueError(str(e)) from e
Loading