MCPcopy Create free account
hub / github.com/astercloud/aster / RemoveTool

Method RemoveTool

pkg/agent/tool_manager.go:267–284  ·  view source on GitHub ↗

RemoveTool 移除工具

(name string)

Source from the content-addressed store, hash-verified

265
266// RemoveTool 移除工具
267func (tm *ToolManager) RemoveTool(name string) error {
268 tm.mu.Lock()
269 defer tm.mu.Unlock()
270
271 // 不能移除核心工具
272 if tm.isCoreToolLocked(name) {
273 return fmt.Errorf("cannot remove core tool: %s", name)
274 }
275
276 // 从索引中移除
277 tm.index.RemoveTool(name)
278
279 // 从活跃和延迟列表中移除
280 delete(tm.activeTools, name)
281 delete(tm.deferredTools, name)
282
283 return nil
284}
285
286// GetIndex 获取工具索引
287func (tm *ToolManager) GetIndex() *search.ToolIndex {

Callers

nothing calls this directly

Calls 2

isCoreToolLockedMethod · 0.95
deleteFunction · 0.85

Tested by

no test coverage detected