You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing constructors for Root and ListRootsResult after #[non_exhaustive] in 1.x #734
Root and ListRootsResult were made #[non_exhaustive] in 1.x but no constructors were added, making it impossible to implement ClientHandler::list_roots without going through serde_json::from_value:
// This no longer compileslet root = Root{uri:"file:///project".into(),name:None};// Current workaroundlet root:Root = serde_json::from_value(json!({"uri":"file:///project"})).unwrap();
Same for ListRootsResult: the only way to return a non-empty result from list_roots is to deserialize it.
Most types affected by the #[non_exhaustive] change got ::new() + builder methods (e.g. CallToolRequestParams, ServerInfo). These two seem to have been missed, likely because the library's own code only deserializes them (roots flow from client to server over the wire).
Would be great to have something like:
Root::new(uri:implInto<String>)// name defaults to NoneListRootsResult::new(roots:Vec<Root>)
Activity
DaleSeo commentedon Mar 9, 2026
Hi @ianlet, we'll fix this in PR #739. Thanks for pointing this!