Skip to content

Commit 45c2804

Browse files
committed
fix: support spaces and quote in shell params
1 parent 84dca51 commit 45c2804

File tree

6 files changed

+542
-221
lines changed

6 files changed

+542
-221
lines changed

cmd/mcptools/commands/call.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func CallCmd() *cobra.Command {
4545
i += 2
4646
case (cmdArgs[i] == FlagParams || cmdArgs[i] == FlagParamsShort) && i+1 < len(cmdArgs):
4747
ParamsString = cmdArgs[i+1]
48+
fmt.Fprintf(os.Stderr, "ParamsString: %#v\n", ParamsString)
4849
i += 2
4950
case !entityExtracted:
5051
entityName = cmdArgs[i]
@@ -101,6 +102,7 @@ func CallCmd() *cobra.Command {
101102

102103
switch entityType {
103104
case EntityTypeTool:
105+
fmt.Fprintf(os.Stderr, "params: %#v\n", params)
104106
resp, execErr = mcpClient.CallTool(entityName, params)
105107
case EntityTypeRes:
106108
resp, execErr = mcpClient.ReadResource(entityName)

cmd/mcptools/commands/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ const (
2727
var (
2828
// FormatOption is the format option for the command, valid values are "table", "json", and
2929
// "pretty".
30-
FormatOption string
30+
// Default is "table".
31+
FormatOption = "table"
3132
// ParamsString is the params for the command.
3233
ParamsString string
3334
)

0 commit comments

Comments
 (0)