MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / loadTool

Function loadTool

internal/desktop/tool_service.go:115–128  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

113}
114
115func loadTool(name string) (tools.Tool, error) {
116 registry, err := tools.LoadDefault()
117 if err != nil {
118 return tools.Tool{}, wrapError("TOOL_REGISTRY_LOAD_FAILED", err)
119 }
120 tool, ok := registry.Get(name)
121 if !ok {
122 if byCommand, found := registry.ByCLICommand(name); found {
123 return byCommand, nil
124 }
125 return tools.Tool{}, NewError("TOOL_NOT_FOUND", "tool not found", map[string]string{"name": name})
126 }
127 return tool, nil
128}
129
130func toolDTO(tool tools.Tool) ToolDTO {
131 installed, version := tools.Detect(tool)

Callers 5

ListProvidersForToolMethod · 0.85
DryRunMethod · 0.85
ApplyConfigMethod · 0.85
InstallMethod · 0.85
UninstallMethod · 0.85

Calls 5

LoadDefaultFunction · 0.92
wrapErrorFunction · 0.85
NewErrorFunction · 0.85
ByCLICommandMethod · 0.80
GetMethod · 0.45

Tested by

no test coverage detected