Deprecate roots, sampling, and logging methods per SEP-2577 (#2926)
This commit is contained in:
parent
5734acf18e
commit
4573e4ac33
1 changed files with 206 additions and 123 deletions
|
|
@ -1110,10 +1110,10 @@ class TestContextInjection:
|
|||
mcp = MCPServer()
|
||||
|
||||
async def logging_tool(msg: str, ctx: Context) -> str:
|
||||
await ctx.debug("Debug message")
|
||||
await ctx.info("Info message")
|
||||
await ctx.warning("Warning message")
|
||||
await ctx.error("Error message")
|
||||
await ctx.debug("Debug message") # pyright: ignore[reportDeprecated]
|
||||
await ctx.info("Info message") # pyright: ignore[reportDeprecated]
|
||||
await ctx.warning("Warning message") # pyright: ignore[reportDeprecated]
|
||||
await ctx.error("Error message") # pyright: ignore[reportDeprecated]
|
||||
return f"Logged messages for {msg}"
|
||||
|
||||
mcp.add_tool(logging_tool)
|
||||
|
|
|
|||
Loading…
Reference in a new issue