File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22from pydantic import AnyUrl
33
44from mcp .server .fastmcp import FastMCP
5+ from mcp .shared .exceptions import McpError
56from mcp .shared .memory import (
67 create_connected_server_and_client_session as client_session ,
78)
@@ -57,10 +58,10 @@ def get_user_profile_missing(user_id: str) -> str:
5758 assert result_list [0 ].mime_type == "text/plain"
5859
5960 # Verify invalid parameters raise error
60- with pytest .raises (ValueError , match = "Unknown resource" ):
61+ with pytest .raises (McpError , match = "Unknown resource" ):
6162 await mcp .read_resource ("resource://users/123/posts" ) # Missing post_id
6263
63- with pytest .raises (ValueError , match = "Unknown resource" ):
64+ with pytest .raises (McpError , match = "Unknown resource" ):
6465 await mcp .read_resource ("resource://users/123/posts/456/extra" ) # Extra path component
6566
6667
You can’t perform that action at this time.
0 commit comments