E-commerce Orchestration Skill
Overview
This skill demonstrates Pattern 2: Multi-MCP Orchestration by coordinating between two MCP servers:
- task-tracker: Manages order/return tasks and workflows
- business-rules: Provides e-commerce policies (return windows, shipping costs, discounts)
When This Skill Activates
Claude automatically uses this skill when you mention:
Return Processing:
- Processing/handling a return request
- Checking return eligibility or policies
- Customer wants to return an item
- Return evaluation or assessment
- Refund calculations or decisions
Order Processing:
- Creating or processing an order
- Applying discounts or loyalty benefits
- Calculating shipping costs
- Order fulfillment
- New customer orders or bulk orders
Policy Inquiries:
- Shipping costs for an order
- Return windows or policies
- Discount eligibility
- Restocking fees
- Business rules or policies
Multi-Server Workflows
Return Request Workflow
When processing a customer return:
Orchestration Steps:
- Create return task (task-tracker:
create_task)
- Title: "Return: [Item] - [Price/Details]"
- Status: "pending"
- Include item category, purchase date, condition in description
- Check return policy (business-rules:
check_return_policy)
- Parameters: category (clothing/electronics/books/food), days_since_purchase, opened (true/false)
- Evaluate eligibility based on policy result
- If eligible: calculate refund amount (original_price - restocking_fee if applied)
- If ineligible: note reason (outside return window, condition issues, etc.)
- Update task (task-tracker:
update_task)
- Add policy decision to task description
- Include refund method and amount
- Status: "in_progress" (ready for fulfillment)
- Route to fulfillment based on eligibility status
Example: "Process a return for a laptop purchased 10 days ago"
- Step 1: Creates task "Return: Laptop - Opened - 10 days"
- Step 2: Checks policy: electronics = 14 days, opened = 15% fee
- Step 3: Evaluates: Eligible (within 14-day window), refund = original × 0.85
- Step 4: Updates task: "✓ ELIGIBLE - 15% restocking fee applies"
- Step 5: Ready for fulfillment team to process
Order Processing Workflow
When creating a new order:
Orchestration Steps:
- Calculate discounts (business-rules:
calculate_discount)
- Parameters: customer_status (new/existing), loyalty_tier (bronze/silver/gold), num_items
- Result: discount percentage to apply
- Calculate shipping (business-rules:
calculate_shipping_cost)
- Parameters: order_total (after discount), shipping_type (standard/expedited/express)
- Result: shipping cost for the selected method
- Create order task (task-tracker:
create_task)
- Title: "Order fulfillment - [Customer] - $[Total]"
- Status: "pending"
- Include itemized breakdown in description
- Update task (task-tracker:
update_task) with final pricing
- Subtotal, discount amount, shipping cost, estimated tax, final total
- Include delivery timeline based on shipping type
- Route to fulfillment center based on order size/priority
Example: "Create an order for a new customer buying 12 items totaling $85"
- Step 1: Calculates discounts: 10% new customer + 10% bulk (capped at 25%) = $21.25 discount
- Step 2: Calculates shipping: Free standard (order $63.75 > $50)
- Step 3: Creates task "Order fulfillment - New Customer - $63.75"
- Step 4: Updates task with breakdown: Subtotal $85 - Discount $21.25 - Shipping $0 = Total $63.75 + tax
- Step 5: Routes to fulfillment for processing
Complex Scenario: Return Evaluation
Scenario: "Evaluate a return for 3 opened books and 1 unopened laptop purchased 20 days ago for $500 each"
Orchestration Steps:
- Create multi-item return task (task-tracker:
create_task)
- Title: "Return evaluation - 4 items - 20 days"
- Description: List each item with category, condition, original price
- Check each item's policy (business-rules:
check_return_policy × 4 calls)
- Books: category=books, days=20, opened=true
- Laptop: category=electronics, days=20, opened=false
- Aggregate results for each item
- Update task (task-tracker:
update_task) with itemized decision
- Calculate total refund and route for processing
Evaluation Results:
Books (3×):
- Step 2: books policy = 60-day window, no restocking fee
- Result: ✓ ELIGIBLE (within 60 days), full refund = $100 each × 3 = $300
Laptop:
- Step 2: electronics policy = 14-day window, 15% fee if opened
- Result: ✗ OUTSIDE WINDOW (20 days > 14 days), ineligible - cannot process
Total Return: $300 only (books eligible, laptop denied)
Note: This example shows how the skill evaluates each item independently and provides itemized refund decisions.
Available Operations
From task-tracker MCP:
create_task - Create order/return task with metadata
update_task - Update task status, add notes
filter_tasks - Find tasks by priority, status, project
list_tasks - List pending/completed tasks
get_task_statistics - Get completion rates, metrics
From business-rules MCP:
check_return_policy - Validate return eligibility
calculate_shipping_cost - Get shipping costs by order amount
calculate_discount - Apply customer/order discounts
get_all_policies - View all business rules
Best Practices
- Always check rules first: Before creating tasks, validate using business-rules to provide accurate information
- Embed results in tasks: Include policy decisions and calculations in task descriptions for auditing
- Use specific categories: Use exact category names (electronics, clothing, books, food) for accurate policies
- Consider customer context: Loyalty tier, purchase history affect discounts and eligibility
- Chain operations: Discount → Shipping → Task creation creates complete order workflows
- Document decisions: When rules block actions, clearly state why in task notes
Example Prompts
Return Processing
- "Process a return for clothing purchased 20 days ago, unopened"
- "Evaluate return for opened electronics purchased 5 days ago"
- "Check if customer can return books purchased 45 days ago"
Order Creation
- "Create an order for a new customer buying 8 items for $65"
- "Create an order for a gold loyalty member buying 3 items for $120"
- "Process an order for 25 bulk items totaling $500 with standard shipping"
Policy Inquiries
- "What's our shipping cost for a $75 order?"
- "What discounts apply for a silver member buying 12 items?"
- "How long can customers return clothing?"
Integration Example
User: "I need to process a return for a dress. Customer bought it 20 days ago for $45, and it's unworn."
Steps:
1. task-tracker: Create task "Return: Dress - $45 - Unworn"
2. business-rules: check_return_policy("clothing", 20, opened=false)
→ {eligible: true, days_remaining: 10, restocking_fee: 0%, refund_method: "original_payment"}
3. task-tracker: Update task with "✓ ELIGIBLE - Full refund $45 via original payment method"
4. Result: Task ready for fulfillment, customer gets full refund
Token Efficiency Note
This pattern (Pattern 2) uses 2 MCP servers, which increases token usage compared to Pattern 1:
- Pattern 1 (single server): ~600-1000 tokens
- Pattern 2 (multi-server): ~1000-1500 tokens
The additional tokens are worth it because:
- Business rules are independently versioned and managed
- Rule changes don't require server restarts
- Clear separation of concerns (tasks vs. policies)
- Demonstrates real-world orchestration patterns
Implementation Requirements
This skill requires:
- task-tracker MCP server - For creating and updating return/order tasks
- business-rules MCP server - For checking policies and calculating costs/discounts
When the skill activates, it orchestrates calls to both MCP servers in sequence:
- Create/query task-tracker to initialize tasks
- Call business-rules to validate against policies
- Update task-tracker with results and decisions
- Route to appropriate fulfillment/processing workflow
Both MCP servers must be registered and running for this skill to function properly.
See Also
1---2name: ecommerce-orchestration3description: Manage e-commerce orders and returns using task management and business rules together. Use for order processing, returns, shipping calculations, and discount applications.4---5
6# E-commerce Orchestration Skill
7
8## Overview
9
10This skill demonstrates **Pattern 2: Multi-MCP Orchestration** by coordinating between two MCP servers:
11
121. **task-tracker**: Manages order/return tasks and workflows
132. **business-rules**: Provides e-commerce policies (return windows, shipping costs, discounts)
14
15## When This Skill Activates
16
17Claude automatically uses this skill when you mention:
18
19**Return Processing:**
20- Processing/handling a return request
21- Checking return eligibility or policies
22- Customer wants to return an item
23- Return evaluation or assessment
24- Refund calculations or decisions
25
26**Order Processing:**
27- Creating or processing an order
28- Applying discounts or loyalty benefits
29- Calculating shipping costs
30- Order fulfillment
31- New customer orders or bulk orders
32
33**Policy Inquiries:**
34- Shipping costs for an order
35- Return windows or policies
36- Discount eligibility
37- Restocking fees
38- Business rules or policies
39
40## Multi-Server Workflows
41
42### Return Request Workflow
43
44When processing a customer return:
45
46**Orchestration Steps:**
471. **Create return task** (task-tracker: `create_task`)
48 - Title: "Return: [Item] - [Price/Details]"
49 - Status: "pending"
50 - Include item category, purchase date, condition in description
512. **Check return policy** (business-rules: `check_return_policy`)
52 - Parameters: category (clothing/electronics/books/food), days_since_purchase, opened (true/false)
533. **Evaluate eligibility** based on policy result
54 - If eligible: calculate refund amount (original_price - restocking_fee if applied)
55 - If ineligible: note reason (outside return window, condition issues, etc.)
564. **Update task** (task-tracker: `update_task`)
57 - Add policy decision to task description
58 - Include refund method and amount
59 - Status: "in_progress" (ready for fulfillment)
605. **Route to fulfillment** based on eligibility status
61
62**Example**: "Process a return for a laptop purchased 10 days ago"
63- Step 1: Creates task "Return: Laptop - Opened - 10 days"
64- Step 2: Checks policy: electronics = 14 days, opened = 15% fee
65- Step 3: Evaluates: Eligible (within 14-day window), refund = original × 0.85
66- Step 4: Updates task: "✓ ELIGIBLE - 15% restocking fee applies"
67- Step 5: Ready for fulfillment team to process
68
69### Order Processing Workflow
70
71When creating a new order:
72
73**Orchestration Steps:**
741. **Calculate discounts** (business-rules: `calculate_discount`)
75 - Parameters: customer_status (new/existing), loyalty_tier (bronze/silver/gold), num_items
76 - Result: discount percentage to apply
772. **Calculate shipping** (business-rules: `calculate_shipping_cost`)
78 - Parameters: order_total (after discount), shipping_type (standard/expedited/express)
79 - Result: shipping cost for the selected method
803. **Create order task** (task-tracker: `create_task`)
81 - Title: "Order fulfillment - [Customer] - $[Total]"
82 - Status: "pending"
83 - Include itemized breakdown in description
844. **Update task** (task-tracker: `update_task`) with final pricing
85 - Subtotal, discount amount, shipping cost, estimated tax, final total
86 - Include delivery timeline based on shipping type
875. **Route to fulfillment center** based on order size/priority
88
89**Example**: "Create an order for a new customer buying 12 items totaling $85"
90- Step 1: Calculates discounts: 10% new customer + 10% bulk (capped at 25%) = $21.25 discount
91- Step 2: Calculates shipping: Free standard (order $63.75 > $50)
92- Step 3: Creates task "Order fulfillment - New Customer - $63.75"
93- Step 4: Updates task with breakdown: Subtotal $85 - Discount $21.25 - Shipping $0 = Total $63.75 + tax
94- Step 5: Routes to fulfillment for processing
95
96### Complex Scenario: Return Evaluation
97
98Scenario: "Evaluate a return for 3 opened books and 1 unopened laptop purchased 20 days ago for $500 each"
99
100**Orchestration Steps:**
1011. **Create multi-item return task** (task-tracker: `create_task`)
102 - Title: "Return evaluation - 4 items - 20 days"
103 - Description: List each item with category, condition, original price
1042. **Check each item's policy** (business-rules: `check_return_policy` × 4 calls)
105 - Books: category=books, days=20, opened=true
106 - Laptop: category=electronics, days=20, opened=false
1073. **Aggregate results** for each item
1084. **Update task** (task-tracker: `update_task`) with itemized decision
1095. **Calculate total refund** and route for processing
110
111**Evaluation Results:**
112
113**Books (3×)**:
114- Step 2: books policy = 60-day window, no restocking fee
115- Result: ✓ ELIGIBLE (within 60 days), full refund = $100 each × 3 = $300
116
117**Laptop**:
118- Step 2: electronics policy = 14-day window, 15% fee if opened
119- Result: ✗ OUTSIDE WINDOW (20 days > 14 days), ineligible - cannot process
120
121**Total Return**: $300 only (books eligible, laptop denied)
122
123**Note**: This example shows how the skill evaluates each item independently and provides itemized refund decisions.
124
125## Available Operations
126
127### From task-tracker MCP:
128- `create_task` - Create order/return task with metadata
129- `update_task` - Update task status, add notes
130- `filter_tasks` - Find tasks by priority, status, project
131- `list_tasks` - List pending/completed tasks
132- `get_task_statistics` - Get completion rates, metrics
133
134### From business-rules MCP:
135- `check_return_policy` - Validate return eligibility
136- `calculate_shipping_cost` - Get shipping costs by order amount
137- `calculate_discount` - Apply customer/order discounts
138- `get_all_policies` - View all business rules
139
140## Best Practices
141
1421. **Always check rules first**: Before creating tasks, validate using business-rules to provide accurate information
1432. **Embed results in tasks**: Include policy decisions and calculations in task descriptions for auditing
1443. **Use specific categories**: Use exact category names (electronics, clothing, books, food) for accurate policies
1454. **Consider customer context**: Loyalty tier, purchase history affect discounts and eligibility
1465. **Chain operations**: Discount → Shipping → Task creation creates complete order workflows
1476. **Document decisions**: When rules block actions, clearly state why in task notes
148
149## Example Prompts
150
151### Return Processing
152- "Process a return for clothing purchased 20 days ago, unopened"
153- "Evaluate return for opened electronics purchased 5 days ago"
154- "Check if customer can return books purchased 45 days ago"
155
156### Order Creation
157- "Create an order for a new customer buying 8 items for $65"
158- "Create an order for a gold loyalty member buying 3 items for $120"
159- "Process an order for 25 bulk items totaling $500 with standard shipping"
160
161### Policy Inquiries
162- "What's our shipping cost for a $75 order?"
163- "What discounts apply for a silver member buying 12 items?"
164- "How long can customers return clothing?"
165
166## Integration Example
167
168```
169User: "I need to process a return for a dress. Customer bought it 20 days ago for $45, and it's unworn."
170
171Steps:
1721. task-tracker: Create task "Return: Dress - $45 - Unworn"
1732. business-rules: check_return_policy("clothing", 20, opened=false)
174 → {eligible: true, days_remaining: 10, restocking_fee: 0%, refund_method: "original_payment"}
1753. task-tracker: Update task with "✓ ELIGIBLE - Full refund $45 via original payment method"
1764. Result: Task ready for fulfillment, customer gets full refund
177```
178
179## Token Efficiency Note
180
181This pattern (Pattern 2) uses 2 MCP servers, which increases token usage compared to Pattern 1:
182- **Pattern 1** (single server): ~600-1000 tokens
183- **Pattern 2** (multi-server): ~1000-1500 tokens
184
185The additional tokens are worth it because:
186- Business rules are independently versioned and managed
187- Rule changes don't require server restarts
188- Clear separation of concerns (tasks vs. policies)
189- Demonstrates real-world orchestration patterns
190
191## Implementation Requirements
192
193This skill requires:
194- **task-tracker MCP server** - For creating and updating return/order tasks
195- **business-rules MCP server** - For checking policies and calculating costs/discounts
196
197When the skill activates, it orchestrates calls to both MCP servers in sequence:
1981. Create/query task-tracker to initialize tasks
1992. Call business-rules to validate against policies
2003. Update task-tracker with results and decisions
2014. Route to appropriate fulfillment/processing workflow
202
203Both MCP servers must be registered and running for this skill to function properly.
204
205## See Also
206
207- [PATTERNS_CATALOG.md](../../docs/PATTERNS_CATALOG.md) - Pattern 2 detailed documentation
208- [PATTERN_2_IMPLEMENTATION.md](../../docs/PATTERN_2_IMPLEMENTATION.md) - Implementation details