Skip to main content
Glama

Check a discount (free)

insumer_check_discount
Read-onlyIdempotent

Calculate a wallet's merchant discount from on-chain balances and return tier and discount percentage per token, not raw balance amounts.

Instructions

Calculate discount for a wallet at a merchant. Checks on-chain balances and returns tier and discount percentage per token, never raw balance amounts. Free: does not consume credits. Takes an EVM, Solana or XRPL wallet. An rpc_failure error (503) means a read did not complete: retry, and never treat it as not eligible. The check carries no proof of wallet control, so totalDiscount is what an unproven wallet gets; walletTerms gives the store's terms, and discountIfProven (when present) is what signing would get.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
walletNoEVM wallet address (0x...)
merchantYesMerchant ID
xrplWalletNoXRPL wallet address (r-address)
solanaWalletNoSolana wallet address (base58)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okNotrue when the API call succeeded
dataNoThe endpoint's payload: a signed attestation, trust profile, discount, merchant or token records
keysNoJWKS entries (insumer_jwks)
metaNoResponse metadata such as version and timestamp
errorNoError details when ok is false
itemsNoThe result when the endpoint returns a JSON array
messageNoA plain-text result (insumer_setup), or a message from the API

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.17.1
    • removedInput schema / properties / stellarWallet
      Removed value: -{
      -  "description": "Stellar wallet address (G-prefixed)",
      -  "pattern": "^G[A-Z2-7]{55}$",
      -  "type": "string"
      -}
    • removedInput schema / properties / suiWallet
      Removed value: -{
      -  "description": "Sui wallet address (0x + 64 hex)",
      -  "pattern": "^0x[0-9a-fA-F]{64}$",
      -  "type": "string"
      -}
    • removedInput schema / properties / tronWallet
      Removed value: -{
      -  "description": "Tron wallet address (T-prefixed)",
      -  "pattern": "^T[1-9A-HJ-NP-Za-km-z]{33}$",
      -  "type": "string"
      -}
  2. Changed10 schema fields changedv1.16.0
    • addedInput schema / properties / merchant / maxLength
      Added value: +100
    • addedInput schema / properties / merchant / minLength
      Added value: +1
    • addedInput schema / properties / merchant / pattern
      Added value: +"^[a-zA-Z0-9_-]+$"
    • addedInput schema / properties / solanaWallet / pattern
      Added value: +"^[1-9A-HJ-NP-Za-km-z]{32,44}$"
    • addedInput schema / properties / stellarWallet
      Added value: +{
      +  "description": "Stellar wallet address (G-prefixed)",
      +  "pattern": "^G[A-Z2-7]{55}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / suiWallet
      Added value: +{
      +  "description": "Sui wallet address (0x + 64 hex)",
      +  "pattern": "^0x[0-9a-fA-F]{64}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / tronWallet
      Added value: +{
      +  "description": "Tron wallet address (T-prefixed)",
      +  "pattern": "^T[1-9A-HJ-NP-Za-km-z]{33}$",
      +  "type": "string"
      +}
    • addedInput schema / properties / wallet / pattern
      Added value: +"^0x[0-9a-fA-F]{40}$"
    • addedInput schema / properties / xrplWallet / pattern
      Added value: +"^r[1-9A-HJ-NP-Za-km-z]{24,34}$"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "data": {
      +      "description": "The endpoint's payload: a signed attestation, trust profile, discount, merchant or token records"
      +    },
      +    "error": {
      +      "description": "Error details when ok is false"
      +    },
      +    "items": {
      +      "description": "The result when the endpoint returns a JSON array",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "keys": {
      +      "description": "JWKS entries (insumer_jwks)",
      +      "items": {},
      +      "type": "array"
      +    },
      +    "message": {
      +      "description": "A plain-text result (insumer_setup), or a message from the API"
      +    },
      +    "meta": {
      +      "description": "Response metadata such as version and timestamp"
      +    },
      +    "ok": {
      +      "description": "true when the API call succeeded",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Addedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover read-only/idempotent/non-destructive, and the description adds substantial context beyond them: it never returns raw balances, consumes no credits, exposes totalDiscount vs discountIfProven, and clarifies that no proof of wallet control is carried. The 503 retry semantics are a genuinely useful behavioral disclosure.

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?

Front-loaded with purpose and cost, then error semantics, then the discount-field caveats. Dense but each sentence carries information; the discountIfProven/walletTerms sentence is somewhat packed but still earns its place.

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?

With an output schema present and full annotation coverage, the description supplies the remaining interpretive context an agent needs — cost model, error retry rule, unproven-wallet caveat — so nothing material is missing 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 meaning by stating the wallet input may be EVM, Solana, or XRPL — clarifying that the three wallet-typed properties are mutually exclusive chain alternatives rather than additive inputs.

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?

Specific verb+resource+scope: 'Calculate discount for a wallet at a merchant,' with the chain coverage and the free/no-credit trait stated. It is clearly distinguishable from siblings like insumer_wallet_trust or insumer_attest, which do not compute merchant discounts.

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?

Gives clear operating context: it is free, accepts EVM/Solana/XRPL wallets, and that a 503 rpc_failure means retry rather than treat as ineligible. It does not, however, state when to prefer this over a sibling such as insumer_wallet_trust or insumer_attest.

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