(ctx: ServerRequestContext, params: CallToolRequestParams)
| 39 | |
| 40 | |
| 41 | async def call_tool(ctx: ServerRequestContext, params: CallToolRequestParams) -> CallToolResult: |
| 42 | assert params.name == "echo" |
| 43 | assert params.arguments is not None |
| 44 | text = params.arguments["text"] |
| 45 | with warnings.catch_warnings(): |
| 46 | warnings.simplefilter("ignore", MCPDeprecationWarning) |
| 47 | await ctx.session.send_log_message(level="info", data=f"echoing {text}", logger="echo") # pyright: ignore[reportDeprecated] |
| 48 | return CallToolResult(content=[TextContent(text=text)]) |
| 49 | |
| 50 | |
| 51 | async def set_logging_level(ctx: ServerRequestContext, params: SetLevelRequestParams) -> EmptyResult: |
nothing calls this directly
no test coverage detected