Skip to main content
Glama

insumer_configure_tokens

Set discount tiers for own and partner tokens. Define up to 8 tokens with balance thresholds and discount percentages to enable token-based pricing for merchants. Owner access required.

Instructions

Configure merchant token discount tiers. Set own token and/or partner tokens. Max 8 tokens total. Owner only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesMerchant ID
ownTokenNoMerchant's own token configuration, or null to remove
partnerTokensNoPartner token configurations

Implementation Reference

  • TokenConfigSchema – defines the input schema for token configuration (symbol, chainId, contractAddress, decimals, currency, tiers). Used by the insumer_configure_tokens tool.
    const TokenConfigSchema = z.object({
      symbol: z.string().max(10).describe("Token symbol, e.g. 'UNI'"),
      chainId: OnboardingChainId,
      contractAddress: z.string().describe("Token contract address. For XRPL: use r-address issuer for trust line tokens, or 'native' for XRP."),
      decimals: z.number().int().min(0).max(18).optional().describe("Token decimals (0-18, default 18)"),
      currency: z.string().optional().describe("XRPL trust line currency code (e.g. 'RLUSD', 'USDC', or 'USD'). Required for XRPL trust line tokens. Standard codes ≤ 3 chars; longer names like 'RLUSD' are auto hex-encoded by the API."),
      tiers: z.array(TierSchema).min(1).max(4).describe("1-4 discount tiers"),
    });
  • TierSchema – defines a discount tier (name, threshold, discount). Nested inside TokenConfigSchema.
    const TierSchema = z.object({
      name: z.string().max(30).describe("Tier name, e.g. 'Gold', 'Silver'"),
      threshold: z.number().positive().describe("Minimum token balance for this tier"),
      discount: z.number().int().min(1).max(50).describe("Discount percentage (1-50)"),
    });
  • src/index.ts:540-562 (registration)
    Registration of the 'insumer_configure_tokens' tool on the MCP server via server.tool(), including the description, input schema, and handler callback.
    server.tool(
      "insumer_configure_tokens",
      "Configure merchant token discount tiers. Set own token and/or partner tokens. Max 8 tokens total. Owner only.",
      {
        id: z.string().describe("Merchant ID"),
        ownToken: TokenConfigSchema.nullable()
          .optional()
          .describe("Merchant's own token configuration, or null to remove"),
        partnerTokens: z
          .array(TokenConfigSchema)
          .optional()
          .describe("Partner token configurations"),
      },
      async (args) => {
        const { id, ...body } = args;
        const result = await apiCall(
          "PUT",
          `/merchants/${encodeURIComponent(id)}/tokens`,
          body
        );
        return formatResult(result);
      }
    );
  • Handler function executed when the tool is called. Extracts 'id' and remaining body, then makes a PUT API call to /merchants/{id}/tokens and formats the result.
    async (args) => {
      const { id, ...body } = args;
      const result = await apiCall(
        "PUT",
        `/merchants/${encodeURIComponent(id)}/tokens`,
        body
      );
      return formatResult(result);
    }
  • apiCall – shared HTTP helper used by the handler to make authenticated API requests.
    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;
      }>;
    }
Behavior3/5

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

No annotations provided, so description carries the burden. It discloses ownership requirement and token limit, but lacks details on side effects (overwrites or appends), validation behavior, or error handling.

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?

Two sentences, front-loaded with the core action and constraints, no wasted words.

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?

Given the complex nested schema, the description covers the high-level purpose and key constraints. It lacks detail on return values or error conditions, but the schema is rich enough to compensate.

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% with detailed descriptions. The description adds value by stating 'Max 8 tokens total' (a constraint not in schema) and 'Owner only' (authorization context).

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 action (configure), the resource (merchant token discount tiers), and key constraints (max 8 tokens, owner only). It distinguishes itself from sibling tools like configure_nfts or configure_settings.

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

Usage Guidelines3/5

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

The description mentions 'Owner only' indicating who should use it, but doesn't provide explicit guidance on when to use this tool versus alternatives or when not to use it.

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