We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61dbc7e commit 8b0bec1Copy full SHA for 8b0bec1
cmd/src/mcp.go
@@ -83,14 +83,17 @@ func mcpMain(args []string) error {
83
}
84
mcp.DerefFlagValues(flags, vars)
85
86
+ // arguments provided via a JSON object take precedence over explicit values provided from flags
87
if val, ok := vars["json"]; ok {
88
if jsonVal, ok := val.(string); ok && len(jsonVal) > 0 {
89
m := make(map[string]any)
90
if err := json.Unmarshal([]byte(jsonVal), &m); err != nil {
91
return err
92
93
+ // copy overrides existing keys
94
maps.Copy(vars, m)
95
96
+ // we delete "json" from vars, otherwise it will be sent as a argument to the tool call
97
delete(vars, "json")
98
99
0 commit comments