From fe829bdac54cf34af81ce5bf8395c2beed0c973c Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Thu, 7 Aug 2025 12:25:42 -0400 Subject: [PATCH 1/2] fix: correct numeric types in progress notifications The standard specifies that these may be floating-point. --- crates/rmcp/src/model.rs | 4 ++-- crates/rmcp/tests/test_progress_subscriber.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/rmcp/src/model.rs b/crates/rmcp/src/model.rs index 7156ccae..dccfb1b1 100644 --- a/crates/rmcp/src/model.rs +++ b/crates/rmcp/src/model.rs @@ -758,10 +758,10 @@ const_string!(ProgressNotificationMethod = "notifications/progress"); pub struct ProgressNotificationParam { pub progress_token: ProgressToken, /// The progress thus far. This should increase every time progress is made, even if the total is unknown. - pub progress: u32, + pub progress: f64, /// Total number of items to process (or total progress required), if known #[serde(skip_serializing_if = "Option::is_none")] - pub total: Option, + pub total: Option, /// An optional message describing the current progress. #[serde(skip_serializing_if = "Option::is_none")] pub message: Option, diff --git a/crates/rmcp/tests/test_progress_subscriber.rs b/crates/rmcp/tests/test_progress_subscriber.rs index 24576c08..e1e49139 100644 --- a/crates/rmcp/tests/test_progress_subscriber.rs +++ b/crates/rmcp/tests/test_progress_subscriber.rs @@ -69,8 +69,8 @@ impl MyServer { let _ = client .notify_progress(ProgressNotificationParam { progress_token: progress_token.clone(), - progress: step, - total: Some(10), + progress: (step as f64), + total: Some(10.0), message: Some("Some message".into()), }) .await; From fa1b88550d9c09a14aaadf9d25f144bcf55e058c Mon Sep 17 00:00:00 2001 From: Jack Amadeo Date: Thu, 7 Aug 2025 12:53:17 -0400 Subject: [PATCH 2/2] fix: regenerate schemas --- .../client_json_rpc_message_schema.json | 10 ++++------ .../server_json_rpc_message_schema.json | 10 ++++------ .../server_json_rpc_message_schema_current.json | 10 ++++------ 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json index 5dbc97f5..b780d165 100644 --- a/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json +++ b/crates/rmcp/tests/test_message_schema/client_json_rpc_message_schema.json @@ -762,9 +762,8 @@ }, "progress": { "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.", - "type": "integer", - "format": "uint32", - "minimum": 0 + "type": "number", + "format": "double" }, "progressToken": { "$ref": "#/definitions/ProgressToken" @@ -772,11 +771,10 @@ "total": { "description": "Total number of items to process (or total progress required), if known", "type": [ - "integer", + "number", "null" ], - "format": "uint32", - "minimum": 0 + "format": "double" } }, "required": [ diff --git a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json index 09eca257..a0fa15e2 100644 --- a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json +++ b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json @@ -1027,9 +1027,8 @@ }, "progress": { "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.", - "type": "integer", - "format": "uint32", - "minimum": 0 + "type": "number", + "format": "double" }, "progressToken": { "$ref": "#/definitions/ProgressToken" @@ -1037,11 +1036,10 @@ "total": { "description": "Total number of items to process (or total progress required), if known", "type": [ - "integer", + "number", "null" ], - "format": "uint32", - "minimum": 0 + "format": "double" } }, "required": [ diff --git a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json index 09eca257..a0fa15e2 100644 --- a/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json +++ b/crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json @@ -1027,9 +1027,8 @@ }, "progress": { "description": "The progress thus far. This should increase every time progress is made, even if the total is unknown.", - "type": "integer", - "format": "uint32", - "minimum": 0 + "type": "number", + "format": "double" }, "progressToken": { "$ref": "#/definitions/ProgressToken" @@ -1037,11 +1036,10 @@ "total": { "description": "Total number of items to process (or total progress required), if known", "type": [ - "integer", + "number", "null" ], - "format": "uint32", - "minimum": 0 + "format": "double" } }, "required": [