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

Function toolNameMatchesAny

pkg/runtime/loop.go:1245–1255  ·  view source on GitHub ↗

toolNameMatchesAny reports whether name matches any of the patterns. Each pattern is tried as a filepath.Match glob; a malformed pattern falls back to an exact string comparison.

(name string, patterns []string)

Source from the content-addressed store, hash-verified

1243// pattern is tried as a filepath.Match glob; a malformed pattern falls back
1244// to an exact string comparison.
1245func toolNameMatchesAny(name string, patterns []string) bool {
1246 for _, p := range patterns {
1247 if p == name {
1248 return true
1249 }
1250 if ok, err := filepath.Match(p, name); err == nil && ok {
1251 return true
1252 }
1253 }
1254 return false
1255}
1256
1257// skillSubSessionTools augments the agent's tools for a fork-mode skill
1258// sub-session: it applies the skill's allowed-tools allow-list to the

Callers 2

filterAllowedToolsFunction · 0.85
TestToolNameMatchesAnyFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestToolNameMatchesAnyFunction · 0.68