Skip to main content
Glama
voucherifyio

voucherify-core-mcp

Official
by voucherifyio

estimate_loyalty_points

Estimate the loyalty points a customer will earn for an order based on campaign earning rules. Display estimated point rewards during checkout to motivate purchases.

Instructions

Estimate how many loyalty points a customer will earn for a given order.

CRITICAL: customer and order are ALWAYS required, even when loyalty_card is provided. The loyalty_card only identifies the campaign — it does NOT replace customer or order.

Calculates the estimated number of points a customer will receive in a loyalty campaign based on the campaign's earning rules and the provided order.

Important Limitations:

  • Returns an estimation, not a precise point value

  • Works only for "Order paid" earning rules

  • For campaigns with tiers, mappings, and multiple earning rules, the actual points may differ as the customer may change tiers during final calculation

Use Case: Show loyalty point banners in checkout flows

  • Display estimated points before order placement

  • Motivate customers by showing point rewards for their current cart

  • Combine with get_best_deals for comprehensive loyalty estimations

Campaign Identification (at least one required):

  • loyalty_card: Loyalty card code or voucher ID — resolves the campaign ID only.

  • campaign_id: Direct loyalty campaign ID — use when already known.

  • Both can be provided: the tool verifies the loyalty card belongs to the given campaign.

Parameters:

  • customer: REQUIRED - Customer identification (id or source_id required). Always provide.

  • order: REQUIRED - Order details with source_id for existing orders or amount for estimation. Always provide.

  • loyalty_card: Loyalty card code or voucher ID (at least one of loyalty_card/campaign_id required)

  • campaign_id: Loyalty campaign ID with 'camp_' prefix (at least one of loyalty_card/campaign_id required)

Customer Object Structure: Required (one of):

  • id: Customer ID with 'cust_' prefix (e.g., "cust_abc123")

  • source_id: External customer identifier Optional:

  • metadata: Dict of custom customer attributes

Order Object Structure: Required (one of):

  • source_id: Existing order ID assigned by Voucherify (e.g., "ord_34567890")

  • amount: Total order amount in cents (e.g., 5000 for $50.00) Optional:

  • metadata: Dict of custom order attributes

Pricing Rules:

  • All amounts in cents (5000 = $50.00, 150 = $1.50)

Examples:

  • estimate_loyalty_points( loyalty_card="Loyalty-ZC4Vg", customer={"source_id": "customer123"}, order={"amount": 5000} )

  • estimate_loyalty_points( campaign_id="camp_XXXXXXXXX", customer={"id": "cust_abc123"}, order={"source_id": "ord_34567890"} )

  • estimate_loyalty_points( loyalty_card="Loyalty-ZC4Vg", campaign_id="camp_XXXXXXXXX", customer={"source_id": "customer123"}, order={"amount": 8000, "metadata": {"source": "checkout"}} )

Returns: JSON object containing:

  • campaign: Campaign details (id, name, object)

  • points_estimation: Estimated number of points the customer will earn

Example Response: { "campaign": { "id": "camp_XXXXXXXXX", "name": "Loyalty-campaign", "object": "campaign" }, "points_estimation": 51 }

Error Cases:

  • 400: Campaign doesn't allow auto-join for non-members, inactive campaign, inactive loyalty card, or missing customer/order objects

  • 404: Campaign ID or loyalty card not found

Raises:

  • ToolError: If parameters invalid, campaign not found, or customer not eligible

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderYes
customerYes
campaign_idNo
loyalty_cardNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

The description fully discloses behavioral traits: it returns an estimation, not precise; only works for 'Order paid' earning rules; limitations about tiers; error cases (400, 404). No annotations are present, so the description carries the full burden and does so thoroughly.

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

Conciseness5/5

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

The description is well-structured with sections (Critical, Limitations, Use Case, Parameters, Examples, Returns, Errors), front-loaded with purpose and critical notes. Every sentence adds value, and the length is appropriate for the complexity.

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

Completeness5/5

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

The description covers all necessary context: purpose, limitations, parameter details, examples, error cases, and response format. Despite having an output schema, the description enhances understanding. No gaps remain for an agent to use the tool correctly.

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%, but the description explains all parameters in detail, including object structures, required fields, examples, and the relationship between loyalty_card and campaign_id. It fully compensates for the lack of schema descriptions.

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

Purpose5/5

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

The description clearly states the tool estimates loyalty points for a given order, distinguishing from siblings by mentioning 'Combine with get_best_deals for comprehensive loyalty estimations.'

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

Usage Guidelines5/5

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

Explicit use cases (checkout flows, before order placement) and limitations (estimation only, works only for 'Order paid' earning rules) are provided, along with when not to use and alternative tool suggestions.

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/voucherifyio/core-mcp'

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