multica-ai/multica · error

%s: empty input; pass a JSON object

Error message

%s: empty input; pass a JSON object

What it means

Error "%s: empty input; pass a JSON object" thrown in multica-ai/multica.

Source

Thrown at server/cmd/multica/cmd_agent.go:1329

// UI (mcp-config-tab.tsx). Empty/whitespace input is rejected rather than
// treated as a clear: for the stdin/file channels it almost always signals an
// upstream failure (missing file, unset pipe) rather than a deliberate clear,
// and silently wiping a secret-bearing field is the wrong default.
//
// allowNull controls whether the literal `null` is accepted as the clear
// sentinel. It is not for a single server entry, where removing something has
// its own command and `null` is far more likely to be a mistake.
//
// The payload is treated as secret material (MCP entries routinely carry API
// tokens), so parse errors never wrap the underlying json error, which can
// echo short fragments of malformed input.
func parseMcpJSONObject(flag, raw string, allowNull bool) (json.RawMessage, error) {
	trimmed := strings.TrimSpace(raw)
	if trimmed == "" {
		if allowNull {
			return nil, fmt.Errorf("%s: empty input; pass 'null' to clear or a JSON object to set", flag)
		}
		return nil, fmt.Errorf("%s: empty input; pass a JSON object", flag)
	}
	var probe any
	if err := json.Unmarshal([]byte(trimmed), &probe); err != nil {
		if allowNull {
			return nil, fmt.Errorf("%s must be a valid JSON object, or 'null' to clear", flag)
		}
		return nil, fmt.Errorf("%s must be a valid JSON object", flag)
	}
	if probe == nil {
		if allowNull {
			// null → clear (NULL column server-side; on create it is a no-op).
			return json.RawMessage("null"), nil
		}
		return nil, fmt.Errorf("%s must be a JSON object, not null", flag)
	}
	if _, ok := probe.(map[string]any); !ok {
		if allowNull {
			return nil, fmt.Errorf("%s must be a JSON object, or 'null' to clear", flag)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Provide a non-empty JSON object as input.

When it happens

Trigger: Thrown at server/cmd/multica/cmd_agent.go:1329 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/9bc62ff4c5a9c8a3. Report an issue: GitHub.