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

Function filterExcludedTools

pkg/runtime/loop.go:1208–1223  ·  view source on GitHub ↗

filterExcludedTools removes tools whose names appear in the excluded list. This is used by skill sub-sessions to prevent recursive run_skill calls.

(agentTools []tools.Tool, excluded []string)

Source from the content-addressed store, hash-verified

1206// filterExcludedTools removes tools whose names appear in the excluded list.
1207// This is used by skill sub-sessions to prevent recursive run_skill calls.
1208func filterExcludedTools(agentTools []tools.Tool, excluded []string) []tools.Tool {
1209 if len(excluded) == 0 {
1210 return agentTools
1211 }
1212 excludeSet := make(map[string]bool, len(excluded))
1213 for _, name := range excluded {
1214 excludeSet[name] = true
1215 }
1216 filtered := make([]tools.Tool, 0, len(agentTools))
1217 for _, t := range agentTools {
1218 if !excludeSet[t.Name] {
1219 filtered = append(filtered, t)
1220 }
1221 }
1222 return filtered
1223}
1224
1225// filterAllowedTools keeps only tools whose names match an entry in allowed
1226// (filepath.Match-style glob, falling back to an exact match). An empty

Callers 3

runStreamLoopMethod · 0.85
reprobeMethod · 0.85
TestFilterExcludedToolsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestFilterExcludedToolsFunction · 0.68