Skip to content

Commit ff86c75

Browse files
fix: update logging function parameters to align with MCP spec
1 parent e9a65a5 commit ff86c75

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/client/test_logging_callback.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ async def test_tool_with_log_extra(
5151
"""Send a log notification to the client with extra fields."""
5252
await ctx.log(
5353
level=level,
54-
data={
55-
"message": message,
54+
message=message,
55+
logger_name=logger,
56+
extra={
5657
"extra_string": extra_string,
5758
"extra_dict": extra_dict,
5859
},
59-
logger_name=logger,
6060
)
6161
return True
6262

tests/server/mcpserver/test_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,9 +1072,9 @@ async def logging_tool(msg: str, ctx: Context) -> str:
10721072
@pytest.mark.anyio
10731073
async def test_context_logging_with_structured_data(self):
10741074
"""Test that context logging accepts structured data per MCP spec (issue #397)."""
1075-
mcp = FastMCP()
1075+
mcp = MCPServer()
10761076

1077-
async def structured_logging_tool(msg: str, ctx: Context[ServerSession, None]) -> str:
1077+
async def structured_logging_tool(msg: str, ctx: Context) -> str:
10781078
# Test with dictionary
10791079
await ctx.info({"status": "success", "message": msg, "count": 42})
10801080
# Test with list

0 commit comments

Comments
 (0)