MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / require

Method require

atomic-agent/src/hooks/mod.rs:341–346  ·  view source on GitHub ↗

Look up an agent adapter by name, returning an error if not found. This is a convenience method for CLI commands that need to validate the agent name and produce a helpful error message.

(&self, name: &str)

Source from the content-addressed store, hash-verified

339 /// This is a convenience method for CLI commands that need to validate
340 /// the agent name and produce a helpful error message.
341 pub fn require(&self, name: &str) -> AgentResult<&dyn AgentHook> {
342 self.get(name).ok_or_else(|| AgentError::AgentNotFound {
343 name: name.to_string(),
344 available: self.list().to_vec().join(", "),
345 })
346 }
347
348 /// Returns a list of all registered agent names, sorted alphabetically.
349 ///

Calls 2

getMethod · 0.65
listMethod · 0.45