MCPcopy Index your code
hub / github.com/docker/docker-agent / declaredToolNames

Function declaredToolNames

pkg/runtime/runtime.go:951–962  ·  view source on GitHub ↗

declaredToolNames maps each configured toolset's display name to its declared `tools:` allow-list. The key matches the registry's naming (cmp.Or(name, type)) so it lines up with the live toolset's Name. Toolsets with no explicit allow-list (serve all tools) are omitted.

(cfg latest.AgentConfig)

Source from the content-addressed store, hash-verified

949// (cmp.Or(name, type)) so it lines up with the live toolset's Name. Toolsets
950// with no explicit allow-list (serve all tools) are omitted.
951func declaredToolNames(cfg latest.AgentConfig) map[string][]string {
952 m := make(map[string][]string, len(cfg.Toolsets))
953 for i := range cfg.Toolsets {
954 t := cfg.Toolsets[i]
955 key := cmp.Or(t.Name, t.Type)
956 if key == "" || len(t.Tools) == 0 {
957 continue
958 }
959 m[key] = slices.Clone(t.Tools)
960 }
961 return m
962}
963
964// uniqueNames drops empty entries and de-duplicates names. By default it keeps
965// the first-seen order (meaningful for declaration/priority order); when sorted

Callers 1

toolsetDetailsFunction · 0.85

Calls 1

CloneMethod · 0.45

Tested by

no test coverage detected