Skip to main content
Glama

insumer_buy_credits

Purchase verification credits using USDC, USDT, or BTC. Supports EVM, Solana, and Bitcoin; volume discounts up to 50% off. Minimum $5. Non-refundable; first purchase registers sender wallet.

Instructions

Buy verification credits with USDC, USDT, or BTC. Volume discounts: $5–$99 = $0.04/call (25 credits/$1), $100–$499 = $0.03 (33/$1, 25% off), $500+ = $0.02 (50/$1, 50% off). Minimum $5. USDC/USDT on EVM and Solana (auto-detected). BTC on Bitcoin (converted to USD at market rate, 1 confirmation required). Crypto sent on unsupported chains cannot be recovered. Non-refundable. First purchase registers the sender wallet to the API key. Subsequent purchases must come from the same sender. To change the registered wallet, set updateWallet to true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txHashYesTransaction hash proving payment
chainIdYesPayment chain: 1, 8453, 137, 42161, 10, 56, 43114, 'solana', or 'bitcoin'. EVM/Solana accept USDC and USDT (auto-detected). Bitcoin accepts BTC (converted to USD at market rate).
amountNoStablecoin amount sent (minimum 5). Not required for BTC.
updateWalletNoSet true to update the registered sender wallet to this transaction's sender

Implementation Reference

  • src/index.ts:472-485 (registration)
    Tool registration for 'insumer_buy_credits' on the MCP server. Accepts txHash, chainId, amount (optional), updateWallet (optional). Calls POST /credits/buy via apiCall helper.
    server.tool(
      "insumer_buy_credits",
      "Buy verification credits with USDC, USDT, or BTC. Volume discounts: $5–$99 = $0.04/call (25 credits/$1), $100–$499 = $0.03 (33/$1, 25% off), $500+ = $0.02 (50/$1, 50% off). Minimum $5. USDC/USDT on EVM and Solana (auto-detected). BTC on Bitcoin (converted to USD at market rate, 1 confirmation required). Crypto sent on unsupported chains cannot be recovered. Non-refundable. First purchase registers the sender wallet to the API key. Subsequent purchases must come from the same sender. To change the registered wallet, set updateWallet to true.",
      {
        txHash: z.string().describe("Transaction hash proving payment"),
        chainId: UsdcChainIdWithBitcoin,
        amount: z.number().min(5).optional().describe("Stablecoin amount sent (minimum 5). Not required for BTC."),
        updateWallet: z.boolean().optional().default(false).describe("Set true to update the registered sender wallet to this transaction's sender"),
      },
      async (args) => {
        const result = await apiCall("POST", "/credits/buy", args);
        return formatResult(result);
      }
    );
  • Handler for 'insumer_buy_credits': sends POST to /credits/buy with args (txHash, chainId, amount, updateWallet) using the authenticated apiCall helper, then formats the response.
    async (args) => {
      const result = await apiCall("POST", "/credits/buy", args);
      return formatResult(result);
    }
  • Input schema for insumer_buy_credits: txHash (string), chainId (UsdcChainIdWithBitcoin union type supporting EVM chain IDs, solana, bitcoin), amount (optional number min 5), updateWallet (optional boolean, default false).
    {
      txHash: z.string().describe("Transaction hash proving payment"),
      chainId: UsdcChainIdWithBitcoin,
      amount: z.number().min(5).optional().describe("Stablecoin amount sent (minimum 5). Not required for BTC."),
      updateWallet: z.boolean().optional().default(false).describe("Set true to update the registered sender wallet to this transaction's sender"),
  • Shared authenticated API helper used by the handler to make the POST /credits/buy request with the API key header.
    async function apiCall(
      method: string,
      path: string,
      body?: Record<string, unknown>
    ): Promise<{ ok: boolean; data?: unknown; error?: unknown; meta?: unknown }> {
      if (!apiKey) {
        return { ok: false, error: "INSUMER_API_KEY is not set. Call the insumer_setup tool to generate a free API key instantly, then add it to your MCP config as INSUMER_API_KEY and restart." };
      }
      const url = `${API_BASE}${path}`;
      const res = await fetch(url, {
        method,
        headers: {
          "Content-Type": "application/json",
          "X-API-Key": apiKey,
        },
        body: body ? JSON.stringify(body) : undefined,
      });
      return res.json() as Promise<{
        ok: boolean;
        data?: unknown;
        error?: unknown;
        meta?: unknown;
      }>;
    }
  • Shared formatResult helper used by the handler to format API responses into MCP content blocks.
    function formatResult(result: {
      ok: boolean;
      data?: unknown;
      error?: unknown;
      meta?: unknown;
    }) {
      if (result.ok) {
        return {
          content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
        };
      }
      return {
        content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
        isError: true,
      };
    }
Behavior5/5

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

With no annotations, the description fully discloses behavioral traits: pricing tiers, minimum amount, crypto types, chains, risk of unrecoverable funds, non-refundable nature, wallet registration, and updateWallet option.

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?

Description is information-dense and well-structured, starting with purpose then details. Slightly long but each sentence adds value. Could be slightly more concise.

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?

Given 4 parameters, no output schema, and no annotations, the description covers all essential aspects: how to use, what happens, risks, and wallet management. It is complete enough for agent decision-making.

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 has 100% coverage, but description adds value beyond schema, e.g., clarifying that amount is not required for BTC, and explaining updateWallet behavior. This enhances parameter understanding.

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 buys verification credits with specific cryptocurrencies. It distinguishes from siblings like 'insumer_buy_key' and 'insumer_buy_merchant_credits' by specifying 'verification credits'.

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?

The description provides clear usage context: when to buy credits with crypto, pricing, and wallet registration. It does not explicitly state when not to use or compare to alternatives, but the context is sufficient.

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