Skip to main content
Glama

Get Case

pega.get_case

Fetch 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

TableJSON Schema
NameRequiredDescriptionDefault
caseIdYesUnique case identifier/handle to retrieve.
viewTypeNoOptional upstream view selector. Can be scalar or list depending on API behavior.
pageNameNoOptional page/view name. Provide this together with viewType.
originChannelNoOptional channel hint, for example Web or Mobile.

Implementation Reference

  • 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
      });
    }
  • 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
        });
      }
    });
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, description carries full burden and successfully discloses success/failure response structures and the dependency constraint between pageName and viewType. Lacks auth or rate limit details but covers the essential behavioral contract.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense, mechanical structure with minimal waste. Each sentence delivers distinct value: purpose, parameter requirements, constraints, and return formats. 'Use this tool to' is slight filler but overall efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Comprehensive for a read operation with no output schema: documents return structure, error format, and input constraints. Sibling differentiation would strengthen it, but technically sufficient for invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, establishing baseline 3. Description adds value by documenting the cross-parameter constraint (pageName requires viewType) and explicitly labeling optionality, which aids agent reasoning beyond raw schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear verb ('fetch') and resource ('case'), with scope ('one case') that implicitly distinguishes from sibling 'get_cases'. However, lacks explicit differentiation from 'get_case_views' or 'get_case_actions'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Documents cross-parameter constraint ('pageName requires viewType') and required vs optional inputs, which are critical for correct invocation. However, misses explicit guidance on when to use this singular fetch vs 'get_cases' (list) or vs view-specific siblings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/amirmcs/Pega-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server