Send a log notification to the client.
(
message: str, level: Literal["debug", "info", "warning", "error"], logger: str, ctx: Context
)
| 34 | # Create a function that can send a log notification |
| 35 | @server.tool("test_tool_with_log") |
| 36 | async def test_tool_with_log( |
| 37 | message: str, level: Literal["debug", "info", "warning", "error"], logger: str, ctx: Context |
| 38 | ) -> bool: |
| 39 | """Send a log notification to the client.""" |
| 40 | await ctx.log(level=level, data=message, logger_name=logger) # pyright: ignore[reportDeprecated] |
| 41 | return True |
| 42 | |
| 43 | @server.tool("test_tool_with_log_dict") |
| 44 | async def test_tool_with_log_dict( |