MCPcopy Create free account
hub / github.com/AI45Lab/Code / register_builtin

Method register_builtin

core/src/tools/registry.rs:61–68  ·  view source on GitHub ↗

Register a builtin tool (cannot be overridden by dynamic tools)

(&self, tool: Arc<dyn Tool>)

Source from the content-addressed store, hash-verified

59
60 /// Register a builtin tool (cannot be overridden by dynamic tools)
61 pub fn register_builtin(&self, tool: Arc<dyn Tool>) {
62 let name = tool.name().to_string();
63 let mut tools = self.tools.write().unwrap();
64 let mut builtins = self.builtins.write().unwrap();
65 tracing::debug!("Registering builtin tool: {}", name);
66 tools.insert(name.clone(), tool);
67 builtins.insert(name);
68 }
69
70 /// Register a tool
71 ///

Calls 4

writeMethod · 0.80
nameMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45