MCPcopy Create free account
hub / github.com/github/gh-aw / stripSidecarFields

Function stripSidecarFields

pkg/workflow/samples_validation.go:335–344  ·  view source on GitHub ↗

stripSidecarFields returns a shallow copy of sample with sidecar keys removed. The original map is never modified, even when no sidecars are configured — callers may mutate the returned map without affecting the caller's input.

(sample map[string]any, sidecars map[string]bool)

Source from the content-addressed store, hash-verified

333// The original map is never modified, even when no sidecars are configured —
334// callers may mutate the returned map without affecting the caller's input.
335func stripSidecarFields(sample map[string]any, sidecars map[string]bool) map[string]any {
336 out := make(map[string]any, len(sample))
337 for k, v := range sample {
338 if sidecars[k] {
339 continue
340 }
341 out[k] = v
342 }
343 return out
344}
345
346// toolDisplayKey converts a snake_case MCP tool name into the hyphenated YAML
347// frontmatter key (e.g. "create_pull_request" -> "create-pull-request").

Callers 1

validateSamplesForToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected