From 6a19688cf31fedfa38fba94f32450c89ab2f3328 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Fri, 14 Aug 2026 04:14:48 +0900 Subject: [PATCH] [Doc] Add prompts/resources list-changed notification examples to README.md ## Motivation and Context The SDK tiering system (SEP-1730) requires Tier 1 SDKs to document all non-experimental features with examples. The 2026-08-14 documentation coverage audit found the last two example gaps: the Notifications section documents `notify_prompts_list_changed` and `notify_resources_list_changed` in prose, but only `notify_tools_list_changed` appeared in a code example, leaving the prompts and resources variants PARTIAL. The Usage Example in the notifications chapter now defines a prompt and a resource and broadcasts the matching list-changed notification for each, alongside the existing tools example. The block signatures mirror the canonical `define_prompt` / `define_resource` examples earlier in the README.md. ## How Has This Been Tested? Documentation-only change. The snippet was verified end to end against the current public API: both definitions serve `prompts/get` / `resources/read` responses and all three notify calls run without error. ## Breaking Changes None. This only extends a code example in README.md. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 20b3143f..0a3e5d89 100644 --- a/README.md +++ b/README.md @@ -2226,6 +2226,18 @@ transport = MCP::Server::Transports::StreamableHTTPTransport.new(server) # When tools change, notify clients server.define_tool(name: "new_tool") { |**args| { result: "ok" } } server.notify_tools_list_changed + +# When prompts change, notify clients +server.define_prompt(name: "new_prompt") do |args, server_context:| + MCP::Prompt::Result.new(messages: []) +end +server.notify_prompts_list_changed + +# When resources change, notify clients +server.define_resource(uri: "resource://new", name: "new_resource", mime_type: "text/plain") do + [MCP::Resource::TextContents.new(uri: "resource://new", mime_type: "text/plain", text: "contents")] +end +server.notify_resources_list_changed ``` You can use Stateless Streamable HTTP, where notifications are not supported and all calls are request/response interactions.