Skip to content

Commit 61dbc7e

Browse files
committed
update usage for --json flag
- include note section where we mention the precedence
1 parent 86c4867 commit 61dbc7e

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

cmd/src/mcp.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ func mcpUsage() {
3030
fmt.Println(" src mcp <tool-name> schema View the input/output schema of a tool")
3131
fmt.Println(" src mcp <tool-name> <flags> Invoke a tool with the given flags")
3232
fmt.Println(" src mcp <tool-name> -h List the available flags of a tool")
33+
fmt.Println("\nCOMMON FLAGS:")
34+
fmt.Println(" --json '{...}' Provide all tool arguments as a JSON object (recommended for agents)")
35+
fmt.Println("\nNOTE:")
36+
fmt.Println(" When both --json and explicit flags are provided, values from --json take precedence.")
37+
fmt.Println("\nEXAMPLE:")
38+
fmt.Println(" src mcp <tool-name> --json '{\"arg1\": \"value1\", \"arg2\": \"value2\"}'")
3339
}
3440

3541
func mcpMain(args []string) error {

internal/mcp/mcp_args.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func BuildArgFlagSet(tool *ToolDef) (*flag.FlagSet, map[string]any, error) {
9393
}
9494
}
9595

96-
flagVars["json"] = fs.String("json", "", "provide all arguments as an json object")
96+
flagVars["json"] = fs.String("json", "", "provide all arguments as a JSON object")
9797

9898
return fs, flagVars, nil
9999
}

0 commit comments

Comments
 (0)