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

Function extractUnknownParams

pkg/cli/mcp_argument_validation.go:117–131  ·  view source on GitHub ↗
(errMsg string)

Source from the content-addressed store, hash-verified

115var quotedStringRE = regexp.MustCompile(`"([^"]+)"`)
116
117func extractUnknownParams(errMsg string) []string {
118 m := additionalPropsRE.FindStringSubmatch(errMsg)
119 if m == nil {
120 return nil
121 }
122 raw := m[1]
123 matches := quotedStringRE.FindAllStringSubmatch(raw, -1)
124 var params []string
125 for _, sm := range matches {
126 if sm[1] != "" {
127 params = append(params, sm[1])
128 }
129 }
130 return params
131}
132
133// buildHelpfulParamError constructs a human-readable error message that:
134// - names each unknown parameter

Calls

no outgoing calls

Tested by 2

TestExtractUnknownParamsFunction · 0.68