systemprompt_provider_contracts/tool/
inventory.rs1use systemprompt_identifiers::McpServerId;
7
8use super::definition::ToolDefinition;
9
10#[derive(Debug, Clone, Default)]
16pub struct ToolInventory {
17 pub tools: Vec<ToolDefinition>,
18 pub failed_servers: Vec<ServerListingFailure>,
19}
20
21#[derive(Debug, Clone)]
22pub struct ServerListingFailure {
23 pub server: McpServerId,
24 pub message: String,
25}
26
27impl ToolInventory {
28 #[must_use]
29 pub const fn complete(tools: Vec<ToolDefinition>) -> Self {
30 Self {
31 tools,
32 failed_servers: Vec::new(),
33 }
34 }
35
36 #[must_use]
37 pub const fn is_complete(&self) -> bool {
38 self.failed_servers.is_empty()
39 }
40}