Scenario Description
Your task is to build a customer support resolution agent using the Claude Agent SDK that handles three critical support categories: product returns, billing disputes, and account issues. The agent leverages MCP tools (get_customer, lookup_order, process_refund, escalate_to_human) to gather information, take action, and make escalation decisions. The goal is to achieve 80%+ first-contact resolution while maintaining clear escalation pathways for issues that require human intervention.
This scenario requires you to design an agentic loop that performs identity verification before allowing refunds, decomposes multi-concern tickets into subtasks, and implements robust handoff protocols when escalating to human agents. You'll need to balance automation with safety—knowing when the agent can confidently resolve an issue versus when domain expertise or policy judgment is required.
The agent must distinguish between return requests (handled via lookup_order and process_refund), billing errors (may need process_refund with dispute context), and account access issues (may not require refunds at all). Each concern may trigger different tool sequences and escalation criteria.
Domains Tested
Key Concepts to Study
Agentic Architecture & Orchestration
- Agentic loop lifecycle: reasoning → tool selection → tool execution → outcome analysis → next step decision
- When and how to recursively invoke agent reasoning for multi-step resolution flows
- Escalation criteria: explicit customer requests, policy gaps, inability to progress, high-stakes financial decisions
- Structured handoff protocols to
escalate_to_humanwith context preservation
Tool Design & MCP Integration
- Prerequisite gates: blocking
process_refunduntilget_customerreturns verified identity - Tool description quality and disambiguation: why
get_customerandlookup_orderneed distinct, unambiguous descriptions - PostToolUse hooks for data normalization (e.g., standardizing refund amounts to currency objects)
- Designing escalation tools to bundle all relevant context for human agents
Context Management & Reliability
- Multi-concern decomposition: identifying return, billing, and account issues within a single ticket
- Maintaining conversation history through multiple tool calls and agentic loops
- Error handling: what to do when
get_customerreturns "not found" orlookup_ordershows a disputed status - Preventing infinite loops: setting max retries for ambiguous cases
Study Tips for This Scenario
-
Map the Tool Dependency Graph: Before designing the agent, sketch out which tools call which, and in what order. Identify the prerequisite gate (get_customer before process_refund). This prevents false positives when the agent might call tools out of sequence.
-
Design Tool Descriptions for Disambiguation: Write detailed, scenario-specific tool descriptions. Don't just say "get customer info"—say "Retrieve customer identity and account status; required before processing refunds." This clarity helps the model select the right tool and understand sequencing.
-
Test Escalation Paths: Create test cases for each escalation criterion (customer request, policy gap, ambiguity). Verify that the agent's escalation messages include enough context for a human to immediately take action without re-querying the system.
-
Use PostToolUse Hooks for Consistency: Practice writing hooks that normalize refund amounts, verify customer state after each tool call, and flag edge cases (e.g., "refund requested but account is suspended"). This reduces downstream errors in the next agent reasoning loop.