multica-ai/multica · error

server ID must not be empty

Error message

server ID must not be empty

What it means

Local validation in `multica workspace mcp update`: the first positional argument (the MCP server ID) is empty after trimming whitespace. The command requires the numeric/UUID server ID assigned at registration, not merely the server name.

Source

Thrown at server/cmd/multica/cmd_workspace.go:671

		return err
	}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	var server workspaceMcpServer
	body := map[string]any{"name": serverName, "config": entry}
	if err := client.PostJSON(ctx, "/api/workspaces/"+wsID+"/mcp-servers", body, &server); err != nil {
		return fmt.Errorf("add workspace mcp server: %w", err)
	}

	return printWorkspaceMcpServers(cmd, []workspaceMcpServer{server})
}

func runWorkspaceMcpUpdate(cmd *cobra.Command, args []string) error {
	serverID := strings.TrimSpace(args[0])
	if serverID == "" {
		return fmt.Errorf("server ID must not be empty")
	}
	wsID, err := resolveWorkspaceArg(cmd, args[1:])
	if err != nil {
		return err
	}
	if wsID == "" {
		return fmt.Errorf("workspace ID is required: pass an id/slug/prefix as argument or set MULTICA_WORKSPACE_ID")
	}

	body := map[string]any{}
	if cmd.Flags().Changed("name") {
		name, _ := cmd.Flags().GetString("name")
		body["name"] = strings.TrimSpace(name)
	}
	entry, ok, err := resolveMcpJSONObject(cmd, "server-config", false)
	if err != nil {
		return err
	}

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Get the real ID from `multica workspace mcp list <ws>` (ID column)
  2. Re-run: `multica workspace mcp update <server-id> <ws> --name newname`
  3. In scripts, fail fast when the variable is empty: `: "${SERVER_ID:?}"

Example fix

# before
multica workspace mcp update "$NAME" acme --name renamed

# after
multica workspace mcp list acme   # note ID, e.g. 17
multica workspace mcp update 17 acme --name renamed
Defensive patterns

Strategy: validation

Validate before calling

serverID := strings.TrimSpace(args[0])
if serverID == "" {
    return errors.New("server ID must not be empty")
}

Prevention

When it happens

Trigger: Running `multica workspace mcp update "" <ws> --name newname` or passing a whitespace-only first argument.

Common situations: Scripts passing an unset $SERVER_ID variable; confusing the server's display name with its ID — the update endpoint keys on the ID returned by `mcp list`.

Related errors


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