sipeed/picoclaw · error
missing value for %s
Error message
missing value for %s
What it means
`picoclaw mcp add` parses its arguments manually (not via cobra) so that everything after the server command can be forwarded to it. When --transport/-t appears as the final token with nothing following, the parser has no value to consume and returns this error before any config work starts.
Source
Thrown at cmd/picoclaw/internal/mcp/add.go:112
switch {
case arg == "--help" || arg == "-h":
return addOptions{}, "", "", nil, true, nil
case arg == "--":
if i+1 < len(args) {
explicitCommand = append(explicitCommand, args[i+1:]...)
}
i = len(args)
case arg == "--force" || arg == "-f":
opts.Force = true
case arg == "--deferred":
t := true
opts.Deferred = &t
case arg == "--no-deferred":
f := false
opts.Deferred = &f
case arg == "--transport" || arg == "-t":
if i+1 >= len(args) {
return addOptions{}, "", "", nil, false, fmt.Errorf("missing value for %s", arg)
}
i++
opts.Transport = args[i]
case strings.HasPrefix(arg, "--transport="):
opts.Transport = strings.TrimPrefix(arg, "--transport=")
case arg == "--env" || arg == "-e":
if i+1 >= len(args) {
return addOptions{}, "", "", nil, false, fmt.Errorf("missing value for %s", arg)
}
i++
opts.Env = append(opts.Env, args[i])
case arg == "--env-file":
if i+1 >= len(args) {
return addOptions{}, "", "", nil, false, fmt.Errorf("missing value for %s", arg)
}
i++
opts.EnvFile = args[i]
case strings.HasPrefix(arg, "--env="):View on GitHub (pinned to 49183d7e8d)
Solutions
- Supply the value: `--transport http` or use the explicit form `--transport=http`
- Quote script expansions so the token survives: `--transport "$TRANSPORT"`
- Guard scripts: skip the flag when the variable is empty
Example fix
# before picoclaw mcp add myapi https://example.com/mcp --transport # after picoclaw mcp add myapi https://example.com/mcp --transport=http
Defensive patterns
Strategy: validation
Validate before calling
# prefer = forms so a missing value is a shell syntax error, not a runtime one picoclaw mcp add name url --transport=http
Type guard
func hasFlagValue(args []string, names ...string) bool {
for i, a := range args {
for _, n := range names {
if a == n {
return i+1 < len(args)
}
}
}
return true
} Prevention
- Use --flag=value instead of --flag value in generated commands
- Quote variable expansions so tokens never disappear
- Assemble long mcp add commands in an array, not string interpolation
When it happens
Trigger: `picoclaw mcp add name url --transport` or `... -t` as the last argument; also when a script passes an empty unquoted variable so the value token disappears.
Common situations: Truncated shell line; quoting mistake; conditional flag assembly in scripts with an unset variable.
Related errors
- the --no-truncate option can only be used in conjunction wit
- usage: picoclaw mcp add [flags] <name> <command-or-url> [arg
- %s transport does not accept command arguments
- --header can only be used with http or sse transport
- either --every or --cron must be specified
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/3f64734f25b3151e.
Report an issue: GitHub.