(ctx: ServerRequestContext, params: types.CallToolRequestParams)
| 29 | return types.ListToolsResult(tools=[types.Tool(name="show_roots", input_schema={"type": "object"})]) |
| 30 | |
| 31 | async def call_tool(ctx: ServerRequestContext, params: types.CallToolRequestParams) -> CallToolResult: |
| 32 | assert params.name == "show_roots" |
| 33 | result = await ctx.session.list_roots() # pyright: ignore[reportDeprecated] |
| 34 | lines = [f"{root.uri} name={root.name}" for root in result.roots] |
| 35 | return CallToolResult(content=[TextContent(text="\n".join(lines))]) |
| 36 | |
| 37 | server = Server("rooted", on_list_tools=list_tools, on_call_tool=call_tool) |
| 38 |
nothing calls this directly
no test coverage detected