get_best_deals
Analyze order items to identify top 5 highest-value promotions, with validation rules showing what is needed to qualify. Helps optimize cart value through targeted recommendations.
Instructions
Find top 5 best deal promotions for customer's order with validation analysis.
Analyzes order items against available promotions to identify highest-value deals. Returns promotions with validation rules - some may be partially valid, requiring additional items or changes to qualify for the discount.
Use Case: Upselling and cross-selling optimization
Identify best promotions for current cart
Determine what customer needs to add/change for qualification
Optimize cart value through targeted recommendations
Important: This tool is specialized for order-based promotion analysis. Do not combine with 'qualifications' tool as they serve different purposes.
Parameters: Parameters:
customer: 🔴 MANDATORY - Customer identification and profile data. This parameter is REQUIRED for every call.
order: 🔴 MANDATORY - Order with items list for promotion matching and analysis. This parameter is REQUIRED for every call.
Order Item Configuration: Each item can be specified in multiple ways:
By Product ID (most precise): {"product_id": "prod_abc123", "price": 2000, "quantity": 1}
By Source ID (requires related_object): {"source_id": "special-meal", "related_object": "product", "price": 3000, "quantity": 1}
Generic with metadata (for product collection matching): {"quantity": 2, "product": {"metadata": {"category": "Electronics"}}}
Price-less items (uses catalog price): {"source_id": "drink", "related_object": "product", "quantity": 1}
Pricing Rules:
All prices in cents (2000 = $20.00, 150 = $1.50)
Items without price use product catalog pricing
Quantity must be positive integer
Examples:
get_best_deals( customer={"id": "cust_abc123"}, order={ "items": [ {"product_id": "prod_112e92ce9a7cf5b1d8", "price": 2000, "quantity": 1}, {"source_id": "special-meal", "related_object": "product", "price": 3000, "quantity": 1} ] } )
Example of invalid usage:
get_best_deals()
Returns: JSON array of up to 5 promotion objects, each containing:
id: Promotion identifier
result: Qualification status (APPLICABLE, PARTIALLY_APPLICABLE, etc.)
is_applicable: Boolean indicating if given incentive meets all validation rules
redeemable_details: Promotion information (banner, description, campaign)
validation_rules: Array of validation requirements with status
resolved_order: Order with calculated totals and promotion effects if incentive is applicable
Each validation rule includes:
validation_rules_definition: Rule logic and requirements
validation_status: Current compliance status
validation_omitted_sub_rules: Missing requirements for qualification
See "Validation Rules Structure" section in server instructions for detailed rule format documentation
Raises:
ToolError: If customer missing required fields or order structure invalid
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order | Yes | ||
| customer | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |