Skip to main content
Glama

hac_promotion_scaffold

Scaffold, configure, and publish promotion rules in SAP Commerce Drools Engine to automate cart discounts, free gifts, and threshold-based offers.

Instructions

Scaffolds, configures, and publishes a PromotionSourceRule in the SAP Commerce Drools Rule Engine.

Args: rule_code: Unique code for the promotion rule (e.g. 'promo_summer_sale_100') name: Business title/name of the promotion promo_type: Promotion pattern: - 'ORDER_THRESHOLD_DISCOUNT': Order threshold discount (spend X get fixed discount or percentage off) - 'ORDER_THRESHOLD_FREE_GIFT': Spend X get free gift SKU - 'BUNDLE_FREE_GIFT': Multi-product bundle (A+B+C) gets free gift - 'PRODUCT_DISCOUNT': Specific product percentage or fixed discount - 'POTENTIAL_MESSAGE': Upsell hint when cart has not reached threshold threshold_amount: Minimum cart total threshold (e.g. 500.0) currency: Currency code (e.g. 'USD', 'CNY', 'HKD', 'EUR') discount_amount: Fixed discount amount (e.g. 50.0) discount_percentage: Percentage discount (e.g. 10.0 for 10% off) qualifying_products: List of qualifying product codes (SKUs) gift_product: SKU of the free gift product gift_quantity: Quantity of the free gift product (default 1) target_rule_code: Target rule code to check execution for POTENTIAL_MESSAGE message_fired: User notification message when promotion executes promo_group: Target PromotionGroup identifier (default 'powertoolsPromoGrp') priority: Rule execution priority (default 150) compile_immediately: If True, triggers Drools rules-module compilation immediately (default True) lang: Output language ('zh' for Chinese, 'en' for English)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
langNozh
nameYes
currencyNoUSD
priorityNo
rule_codeYes
promo_typeNoORDER_THRESHOLD_DISCOUNT
descriptionNo
promo_groupNopowertoolsPromoGrp
gift_productNo
gift_quantityNo
message_firedNo
discount_amountNo
target_rule_codeNo
threshold_amountNo
compile_immediatelyNo
discount_percentageNo
qualifying_productsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose a meaningful behavioral trait — compile_immediately 'triggers Drools rules-module compilation immediately' — and 'publishes' signals a mutating write with live side effects. But it omits permissions/auth requirements, reversibility, and whether publishing affects the running storefront, so disclosure is only partial.

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?

The purpose sentence is front-loaded and each parameter line carries distinct, useful information rather than restating the schema. The block is long but most lines earn their place; a few examples (currency codes) are slightly redundant.

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?

For a 17-parameter mutation tool the description is nearly complete for invocation: params are well covered and an output schema exists so return values needn't be explained. It falls short only on usage context, prerequisites, and the blast radius of the publish step, which an agent would need before calling it blindly.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it largely does: it documents 16 of 17 parameters with types, units, examples, and defaults, and crucially defines the promo_type patterns that the schema leaves as an undescribed free string. Only the 'description' parameter is undocumented in the Args list, a minor gap against otherwise excellent compensation.

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?

States a specific set of verbs and a concrete resource: 'Scaffolds, configures, and publishes a PromotionSourceRule in the SAP Commerce Drools Rule Engine.' An agent immediately knows this creates promotion rules. However, it never names or distinguishes itself from the obvious sibling hac_promotion_list, so the differentiation is left to inference.

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

Usage Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance and no mention of alternatives such as hac_promotion_list for reading promotions versus this tool for creating them. The promo_type breakdown explains what each mode does but not when an agent should pick this tool at all, nor any prerequisite (e.g. whether hac_sso_login is required first).

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