Get Case
pega.get_caseFetch a specific case by its unique identifier to retrieve detailed information, supporting optional view types and channel hints for customized data access.
Instructions
Use this tool to fetch one case by identifier. Required input: caseId. Optional inputs: viewType, pageName, originChannel. Constraint: pageName requires viewType. Returns: { ok: true, data: { case: } } on success. Standard failure format: { ok: false, error: { code, message, suggestion? } }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| caseId | Yes | Unique case identifier/handle to retrieve. | |
| viewType | No | Optional upstream view selector. Can be scalar or list depending on API behavior. | |
| pageName | No | Optional page/view name. Provide this together with viewType. | |
| originChannel | No | Optional channel hint, for example Web or Mobile. |
Implementation Reference
- src/tools/getCase.ts:33-51 (handler)The execute function for 'pega.get_case' which calls PegaClient.getCase.
execute: async ({ pegaClient }, input) => { const found = await pegaClient.getCase(input.caseId, { viewType: input.viewType, pageName: input.pageName, originChannel: input.originChannel }); if (!found) { return notFoundOrForbiddenError(); } const payload = found && typeof found === "object" && "raw" in (found as Record<string, unknown>) ? ((found as { raw?: unknown }).raw ?? found) : found; return toolSuccess({ case: payload }); } - src/tools/getCase.ts:10-52 (registration)Registration of 'pega.get_case' tool definition.
export const getCaseToolDefinition = defineTool({ name: "pega.get_case", title: "Get Case", description: [ "Use this tool to fetch one case by identifier.", "Required input: caseId.", "Optional inputs: viewType, pageName, originChannel.", "Constraint: pageName requires viewType.", "Returns: { ok: true, data: { case: <upstream payload> } } on success." ].join(" "), inputSchema: getCaseSchema, invalidInputMessage: "caseId is required", validateInput: (input) => { if (input.pageName && (input.viewType === undefined || input.viewType === null)) { return { code: "INVALID_INPUT", message: "pageName requires viewType", suggestion: "Provide viewType when pageName is set, or remove pageName." }; } return null; }, execute: async ({ pegaClient }, input) => { const found = await pegaClient.getCase(input.caseId, { viewType: input.viewType, pageName: input.pageName, originChannel: input.originChannel }); if (!found) { return notFoundOrForbiddenError(); } const payload = found && typeof found === "object" && "raw" in (found as Record<string, unknown>) ? ((found as { raw?: unknown }).raw ?? found) : found; return toolSuccess({ case: payload }); } });