Skip to main content
Glama

earn_points

Calculate and mint loyalty tokens based on purchase amount and program's cashback rate, optionally redeeming existing points at checkout (points_to_redeem or redeem_all) to reduce the payable receipt amount before calculating new cashback. Returns a fee-first calls[] bundle (protocol fee mint first, then the customer mint) — submit in order, atomically via EIP-5792 if supported, then call confirm_mint_fee (or POST /agent-api/mint/confirm) with obligation_id, fee_tx_hash, and recipient_tx_hash. Unconfirmed fee obligations block future mints.

Input Schema

NameRequiredDescriptionDefault
redeem_allNoIf true, redeems all available customer loyalty points (up to purchase_amount when positive).
cashback_rateNoOverride cashback rate (%). If omitted, uses the program's default rate.
token_addressYesToken contract address (0x...)
customer_emailNoCustomer email address
purchase_amountYesPurchase amount in currency units (e.g. dollars)
customer_addressYesCustomer wallet (0x...) or email address
points_to_redeemNoOptional integer loyalty points to redeem at the counter to reduce purchase_amount.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / customer_address / description
      Previous value: -"Customer wallet (0x...)"New value: +"Customer wallet (0x...) or email address"
    • addedInput schema / properties / customer_email
      Added value: +{
      +  "description": "Customer email address",
      +  "type": "string"
      +}
    • addedInput schema / properties / points_to_redeem
      Added value: +{
      +  "description": "Optional integer loyalty points to redeem at the counter to reduce purchase_amount.",
      +  "type": "number"
      +}
    • addedInput schema / properties / redeem_all
      Added value: +{
      +  "description": "If true, redeems all available customer loyalty points (up to purchase_amount when positive).",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, it discloses important non-obvious behavior: the return is a fee-first calls[] bundle with protocol fee mint before customer mint, calls must be submitted in order, atomic submission is possible via EIP-5792, and unconfirmed fee obligations block future mints. This gives the agent critical workflow and failure-mode context.

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 dense but front-loaded, starting with the core purpose and redemption behavior, then moving to return shape, submission order, confirmation, and blocking consequences. Every sentence carries operational information with no filler.

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 complex minting workflow with no output schema, the description explains the important return structure and next steps: calls[] ordering, atomic submission, and confirm_mint_fee parameters. It could be slightly clearer about where obligation_id comes from in the returned bundle, but it is largely complete for correct invocation.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds meaningful interaction semantics: redemption reduces the payable receipt amount before new cashback is calculated. It does not add much beyond the schema for token_address, customer_address, or cashback_rate, but the redemption interaction is valuable.

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 states a specific verb and resource: calculate and mint loyalty tokens from purchase amount and cashback rate, with optional redemption of existing points. It also distinguishes the operation by tying it to purchase checkout/cashback calculation rather than generic token minting.

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

Usage Guidelines4/5

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

It gives clear operational context: use points_to_redeem or redeem_all to reduce the payable receipt amount before calculating new cashback, then submit the returned calls in order and confirm via confirm_mint_fee. It does not explicitly compare this tool against siblings such as mint_loyalty_tokens, so it lacks full alternative-selection guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources