sipeed/picoclaw · warning
server name is required
Error message
server name is required
What it means
ListMCPTools trims whitespace from the server-name argument and rejects an empty result. The MCP tool-listing command needs a concrete server name to look up in cfg.Tools.MCP.Servers, so a blank or whitespace-only name is refused before any resolution happens.
Source
Thrown at pkg/agent/agent_command.go:188
Connected: isConnected,
ToolCount: toolCount,
})
}
sort.Slice(servers, func(i, j int) bool {
return strings.ToLower(servers[i].Name) < strings.ToLower(servers[j].Name)
})
return servers
},
ListMCPTools: func(ctx context.Context, serverName string) ([]commands.MCPToolInfo, error) {
if cfg == nil {
return nil, fmt.Errorf("command unavailable: config not loaded")
}
serverName = strings.TrimSpace(serverName)
if serverName == "" {
return nil, fmt.Errorf("server name is required")
}
resolvedName := ""
var serverCfg config.MCPServerConfig
for name, candidate := range cfg.Tools.MCP.Servers {
if strings.EqualFold(name, serverName) {
resolvedName = name
serverCfg = candidate
break
}
}
if resolvedName == "" {
return nil, fmt.Errorf("MCP server '%s' is not configured", serverName)
}
if !serverCfg.Enabled {
return nil, fmt.Errorf("MCP server '%s' is configured but disabled", resolvedName)
}
if !cfg.Tools.IsToolEnabled("mcp") {View on GitHub (pinned to 49183d7e8d)
Solutions
- Provide the server name exactly as configured, e.g. /mcp tools clawhub
- List configured servers first via the ListMCPServers hook (/mcp list) and pick a name
- In generated invocations, guard template variables: only render the command when the name is non-empty
Example fix
# before /mcp tools "" # after /mcp tools clawhub
Defensive patterns
Strategy: validation
Validate before calling
if strings.TrimSpace(serverName) == "" {
return fmt.Errorf("provide a server name, e.g. /mcp tools clawhub")
} Prevention
- Require a non-empty argument in command parsers before dispatch
- Default template variables to a known server name or skip the call
When it happens
Trigger: Calling the slash command with no argument or only spaces (e.g. `/mcp tools " "`), or programmatically passing "" / "\t" to the ListMCPTools hook.
Common situations: User omits the server argument; templating code substitutes an empty variable into the command; argument parsing drops the name (unquoted shell expansion of an unset var).
Related errors
- ${label} must be a JSON object.
- ${label}.${key} must be a string.
- MCP discovery requires at least one search method (BM25 or r
- MCP server names must be unique. Duplicates: ${duplicateName
- MCP server ${server.name} requires a URL.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/92bb4847b5e5c109.
Report an issue: GitHub.