|
6 | 6 | as ``transports/test_streamable_http.py::test_unrelated_server_messages_arrive_on_the_standalone_stream``. |
7 | 7 | The collector still records every message it receives, so the snapshot also proves nothing else |
8 | 8 | was delivered. |
| 9 | +
|
| 10 | +The servers register the parent capability (resources/prompts) so that part of the spec's |
| 11 | +precondition holds, but the ``listChanged`` sub-capability stays ``False``: ``NotificationOptions`` |
| 12 | +is not threaded through any of the suite's connection paths. The tests therefore rely on the |
| 13 | +recorded ``lifecycle:capability:server-not-advertised`` divergence and will need updating |
| 14 | +alongside the fix that introduces capability gating. |
9 | 15 | """ |
10 | 16 |
|
11 | 17 | import anyio |
@@ -78,7 +84,13 @@ async def call_tool(ctx: ServerRequestContext, params: types.CallToolRequestPara |
78 | 84 | await ctx.session.send_resource_list_changed() |
79 | 85 | return CallToolResult(content=[TextContent(text="mounted")]) |
80 | 86 |
|
81 | | - server = Server("registry", on_list_tools=list_tools, on_call_tool=call_tool) |
| 87 | + async def list_resources( |
| 88 | + ctx: ServerRequestContext, params: types.PaginatedRequestParams | None |
| 89 | + ) -> types.ListResourcesResult: |
| 90 | + """Registered so the resources capability is advertised; the client never lists resources.""" |
| 91 | + raise NotImplementedError |
| 92 | + |
| 93 | + server = Server("registry", on_list_tools=list_tools, on_call_tool=call_tool, on_list_resources=list_resources) |
82 | 94 |
|
83 | 95 | async with connect(server, message_handler=collect) as client: |
84 | 96 | await client.call_tool("mount", {}) |
@@ -108,7 +120,13 @@ async def call_tool(ctx: ServerRequestContext, params: types.CallToolRequestPara |
108 | 120 | await ctx.session.send_prompt_list_changed() |
109 | 121 | return CallToolResult(content=[TextContent(text="learned")]) |
110 | 122 |
|
111 | | - server = Server("registry", on_list_tools=list_tools, on_call_tool=call_tool) |
| 123 | + async def list_prompts( |
| 124 | + ctx: ServerRequestContext, params: types.PaginatedRequestParams | None |
| 125 | + ) -> types.ListPromptsResult: |
| 126 | + """Registered so the prompts capability is advertised; the client never lists prompts.""" |
| 127 | + raise NotImplementedError |
| 128 | + |
| 129 | + server = Server("registry", on_list_tools=list_tools, on_call_tool=call_tool, on_list_prompts=list_prompts) |
112 | 130 |
|
113 | 131 | async with connect(server, message_handler=collect) as client: |
114 | 132 | await client.call_tool("learn", {}) |
|
0 commit comments