> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# parseSolverResponse

```ts theme={null}
function parseSolverResponse(response): SolverResult;
```

Extracts shift assignments from solver response.

Parses role-specific variable names matching the pattern
`assign_role:${memberId}:${patternId}:${roleId}:${day}` and aggregate
assignment variable names matching `assign:${memberId}:${patternId}:${day}`.

## Parameters

<ResponseField name="response" type="{ error?: string; hardConstraintConflicts?: object[]; softConstraintViolations: object[]; solutionInfo?: string; stageResults?: object[]; statistics?: { branches?: number; conflicts?: number; solveTimeMs?: number; }; status: &#x22;OPTIMAL&#x22; | &#x22;FEASIBLE&#x22;; values?: Record\<string, number\>; } | { error?: string; hardConstraintConflicts?: object[]; softConstraintViolations?: object[]; solutionInfo?: string; stageResults?: object[]; statistics?: { branches?: number; conflicts?: number; solveTimeMs?: number; }; status: &#x22;INFEASIBLE&#x22; | &#x22;TIMEOUT&#x22; | &#x22;ERROR&#x22;; values?: Record\<string, number\>; }" required>
  The solver response containing variable values
</ResponseField>

## Returns

[`SolverResult`](./SolverResult)

Parsed schedule result with assignments

The model uses aggregate assignment variables as the canonical shift presence
literals for intervals, objectives, shift-level rules, and skill-only coverage.
Role-specific variables are emitted when the solver also chooses a concrete
role for that shift. When both variable shapes exist for the same member,
pattern, and day, the role-specific assignment is returned so callers can see
the selected role without receiving a duplicate aggregate assignment.

IDs are validated during CP-SAT model compilation to not contain colons,
ensuring unambiguous parsing.

## Example

```typescript theme={null}
const response = await client.solve(request);
const result = parseSolverResponse(response);

if (result.status === "OPTIMAL" || result.status === "FEASIBLE") {
  for (const assignment of result.assignments) {
    console.log(`${assignment.memberId} works ${assignment.shiftPatternId} on ${assignment.day}`);
  }
}
```
