File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -521,11 +521,11 @@ async def test_context_logging(self):
521
521
"""Test that context logging methods work."""
522
522
mcp = FastMCP ()
523
523
524
- def logging_tool (msg : str , ctx : Context ) -> str :
525
- ctx .debug ("Debug message" )
526
- ctx .info ("Info message" )
527
- ctx .warning ("Warning message" )
528
- ctx .error ("Error message" )
524
+ async def logging_tool (msg : str , ctx : Context ) -> str :
525
+ await ctx .debug ("Debug message" )
526
+ await ctx .info ("Info message" )
527
+ await ctx .warning ("Warning message" )
528
+ await ctx .error ("Error message" )
529
529
return f"Logged messages for { msg } "
530
530
531
531
mcp .add_tool (logging_tool )
@@ -563,8 +563,8 @@ def test_resource() -> str:
563
563
564
564
@mcp .tool ()
565
565
async def tool_with_resource (ctx : Context ) -> str :
566
- data = await ctx .read_resource ("test://data" )
567
- return f"Read resource: { data } "
566
+ data , mime_type = await ctx .read_resource ("test://data" )
567
+ return f"Read resource: { data } with mime type { mime_type } "
568
568
569
569
async with client_session (mcp ._mcp_server ) as client :
570
570
result = await client .call_tool ("tool_with_resource" , {})
You can’t perform that action at this time.
0 commit comments