{"record":{"id":"46b63f52b058c391","repo":"multica-ai/multica","slug":"server-id-must-not-be-empty","errorCode":null,"errorMessage":"server ID must not be empty","messagePattern":"server ID must not be empty","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_workspace.go","lineNumber":671,"sourceCode":"\t\treturn err\n\t}\n\n\tctx, cancel := cli.APIContext(context.Background())\n\tdefer cancel()\n\n\tvar server workspaceMcpServer\n\tbody := map[string]any{\"name\": serverName, \"config\": entry}\n\tif err := client.PostJSON(ctx, \"/api/workspaces/\"+wsID+\"/mcp-servers\", body, &server); err != nil {\n\t\treturn fmt.Errorf(\"add workspace mcp server: %w\", err)\n\t}\n\n\treturn printWorkspaceMcpServers(cmd, []workspaceMcpServer{server})\n}\n\nfunc runWorkspaceMcpUpdate(cmd *cobra.Command, args []string) error {\n\tserverID := strings.TrimSpace(args[0])\n\tif serverID == \"\" {\n\t\treturn fmt.Errorf(\"server ID must not be empty\")\n\t}\n\twsID, err := resolveWorkspaceArg(cmd, args[1:])\n\tif err != nil {\n\t\treturn err\n\t}\n\tif wsID == \"\" {\n\t\treturn fmt.Errorf(\"workspace ID is required: pass an id/slug/prefix as argument or set MULTICA_WORKSPACE_ID\")\n\t}\n\n\tbody := map[string]any{}\n\tif cmd.Flags().Changed(\"name\") {\n\t\tname, _ := cmd.Flags().GetString(\"name\")\n\t\tbody[\"name\"] = strings.TrimSpace(name)\n\t}\n\tentry, ok, err := resolveMcpJSONObject(cmd, \"server-config\", false)\n\tif err != nil {\n\t\treturn err\n\t}","sourceCodeStart":653,"sourceCodeEnd":689,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_workspace.go#L653-L689","documentation":"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.","triggerScenarios":"Running `multica workspace mcp update \"\" <ws> --name newname` or passing a whitespace-only first argument.","commonSituations":"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`.","solutions":["Get the real ID from `multica workspace mcp list <ws>` (ID column)","Re-run: `multica workspace mcp update <server-id> <ws> --name newname`","In scripts, fail fast when the variable is empty: `: \"${SERVER_ID:?}\""],"exampleFix":"# before\nmultica workspace mcp update \"$NAME\" acme --name renamed\n\n# after\nmultica workspace mcp list acme   # note ID, e.g. 17\nmultica workspace mcp update 17 acme --name renamed","handlingStrategy":"validation","validationCode":"serverID := strings.TrimSpace(args[0])\nif serverID == \"\" {\n    return errors.New(\"server ID must not be empty\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always take the ID from `mcp list` output, not from memory of the name","Fail fast in scripts with `: \"${SERVER_ID:?}\"","Remember update/remove key on ID, not name"],"tags":["cli","validation","mcp","arguments"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}