diff --git a/crates/rmcp/src/model.rs b/crates/rmcp/src/model.rs index 2a79dc74..24752f49 100644 --- a/crates/rmcp/src/model.rs +++ b/crates/rmcp/src/model.rs @@ -2378,6 +2378,20 @@ pub struct Root { pub name: Option, } +impl Root { + pub fn new(uri: impl Into) -> Self { + Self { + uri: uri.into(), + name: None, + } + } + + pub fn with_name(mut self, name: impl Into) -> Self { + self.name = Some(name.into()); + self + } +} + const_string!(ListRootsRequestMethod = "roots/list"); pub type ListRootsRequest = RequestNoParam; @@ -2389,6 +2403,12 @@ pub struct ListRootsResult { pub roots: Vec, } +impl ListRootsResult { + pub fn new(roots: Vec) -> Self { + Self { roots } + } +} + const_string!(RootsListChangedNotificationMethod = "notifications/roots/list_changed"); pub type RootsListChangedNotification = NotificationNoParam;