mur_common/skill/
inventory.rs1use std::sync::Arc;
2
3#[derive(Debug, Clone, Default)]
7pub struct McpInventory {
8 tools: Arc<Vec<String>>,
9}
10
11impl McpInventory {
12 pub fn from_tool_names(tools: Vec<String>) -> Self {
13 Self {
14 tools: Arc::new(tools),
15 }
16 }
17
18 pub fn contains(&self, name: &str) -> bool {
19 self.tools.iter().any(|t| t == name)
20 }
21
22 pub fn iter(&self) -> impl Iterator<Item = &str> {
23 self.tools.iter().map(|s| s.as_str())
24 }
25
26 pub fn is_empty(&self) -> bool {
27 self.tools.is_empty()
28 }
29}