MCPcopy
hub / github.com/docker/docker-agent / CreateTool

Method CreateTool

pkg/teamloader/registry.go:44–54  ·  view source on GitHub ↗

CreateTool creates a toolset using the registered creator for the given type.

(ctx context.Context, toolset latest.Toolset, parentDir string, runConfig *config.RuntimeConfig, agentName string)

Source from the content-addressed store, hash-verified

42
43// CreateTool creates a toolset using the registered creator for the given type.
44func (r *toolsetRegistry) CreateTool(ctx context.Context, toolset latest.Toolset, parentDir string, runConfig *config.RuntimeConfig, agentName string) (tools.ToolSet, error) {
45 creator, ok := r.creators[toolset.Type]
46 if !ok {
47 return nil, fmt.Errorf("unknown toolset type: %s", toolset.Type)
48 }
49 ts, err := creator(ctx, toolset, parentDir, runConfig, agentName)
50 if err != nil {
51 return nil, err
52 }
53 return tools.WithName(ts, cmp.Or(toolset.Name, toolset.Type)), nil
54}

Callers

nothing calls this directly

Calls 1

WithNameFunction · 0.92

Tested by

no test coverage detected