Skip to main content
Glama

insumer_check_discount

Calculate discount tier and percentage for a wallet at a merchant by verifying on-chain token balances across EVM, Solana, and XRPL. Returns per-token discount without exposing exact balances.

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.

Input Schema

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

Implementation Reference

  • src/index.ts:418-441 (registration)
    Registration of the 'insumer_check_discount' MCP tool using server.tool() with name, description, Zod schema (merchant, wallet, solanaWallet, xrplWallet), and handler.
    server.tool(
      "insumer_check_discount",
      "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.",
      {
        merchant: z.string().describe("Merchant ID"),
        wallet: z.string().optional().describe("EVM wallet address (0x...)"),
        solanaWallet: z.string().optional().describe("Solana wallet address (base58)"),
        xrplWallet: z.string().optional().describe("XRPL wallet address (r-address)"),
      },
      async (args) => {
        const params = new URLSearchParams();
        params.set("merchant", args.merchant);
        if (args.wallet) params.set("wallet", args.wallet);
        if (args.solanaWallet) params.set("solanaWallet", args.solanaWallet);
        if (args.xrplWallet) params.set("xrplWallet", args.xrplWallet);
        const url = `${API_BASE}/discount/check?${params.toString()}`;
        const res = await fetch(url, {
          method: "GET",
          headers: { "Accept": "application/json" },
        });
        const result = await res.json() as { ok: boolean; data?: unknown; error?: unknown; meta?: unknown };
        return formatResult(result);
      }
    );
  • Handler function that constructs a URL with query params (merchant, wallet, solanaWallet, xrplWallet) and calls the GET /discount/check API endpoint, returning the formatted result.
    async (args) => {
      const params = new URLSearchParams();
      params.set("merchant", args.merchant);
      if (args.wallet) params.set("wallet", args.wallet);
      if (args.solanaWallet) params.set("solanaWallet", args.solanaWallet);
      if (args.xrplWallet) params.set("xrplWallet", args.xrplWallet);
      const url = `${API_BASE}/discount/check?${params.toString()}`;
      const res = await fetch(url, {
        method: "GET",
        headers: { "Accept": "application/json" },
      });
      const result = await res.json() as { ok: boolean; data?: unknown; error?: unknown; meta?: unknown };
      return formatResult(result);
    }
  • Input schema using Zod: merchant (required string), wallet (optional EVM address), solanaWallet (optional Solana address), xrplWallet (optional XRPL address).
    {
      merchant: z.string().describe("Merchant ID"),
      wallet: z.string().optional().describe("EVM wallet address (0x...)"),
      solanaWallet: z.string().optional().describe("Solana wallet address (base58)"),
      xrplWallet: z.string().optional().describe("XRPL wallet address (r-address)"),
    },
Behavior3/5

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

With no annotations, the description provides some behavioral traits: it checks on-chain balances, never returns raw amounts, and is free (no credit consumption). However, it does not disclose side effects, error handling, rate limits, or what happens if a wallet is not found. The transparency is moderate but not insufficient.

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?

Three concise sentences with key information front-loaded. Each sentence adds value: purpose, behavioral constraint, cost. No redundant or missing critical info. Could be slightly more structured but efficient overall.

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

Completeness3/5

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

For a tool with 4 parameters and no output schema, the description explains what the tool does and what it returns (tier and discount percentage per token), but lacks return format details, edge cases (e.g., no wallet provided), and examples. It is adequate but not fully complete.

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

Parameters3/5

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

Schema coverage is 100% and already describes each parameter (merchant ID, wallet addresses). The description adds minimal extra meaning beyond 'checks on-chain balances', but does not clarify which wallet(s) are expected or if multiple can be provided. It fails to guide parameter selection beyond the schema, so baseline 3 is appropriate.

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?

Description clearly states it calculates discount for a wallet at a merchant by checking on-chain balances, returning tier and discount percentage per token. Distinguished from sibling tools (e.g., insumer_acp_discount, insumer_ucp_discount) by focusing on discount calculation and stating it never returns raw balance amounts.

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?

No explicit guidance on when to use this tool versus alternative discount tools (acp, ucp). Lacks exclusions or prerequisites, such as requiring at least one wallet address. Implied usage is for checking discounts, but context of selection among siblings is missing.

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/douglasborthwick-crypto/mcp-server-insumer'

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