Skip to main content
Glama

insumer_configure_nfts

Define up to 4 NFT collections that grant customers discount percentages (1-50%) at your merchant. Specify collection name, contract address, chain (EVM, Solana, XRPL, Bitcoin), and optional XRPL taxon. Owner-only action.

Instructions

Configure NFT collections that grant discounts at the merchant. Max 4 collections. Owner only.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesMerchant ID
nftCollectionsYesNFT collection configurations (0-4)

Implementation Reference

  • NftCollectionSchema: Zod schema defining the shape of each NFT collection configuration item (name, contractAddress, taxon, chainId, discount).
    const NftCollectionSchema = z.object({
      name: z.string().max(50).describe("NFT collection name"),
      contractAddress: z.string().describe("NFT contract address. For XRPL: use r-address of the NFT issuer."),
      taxon: z.number().int().optional().describe("XRPL NFT taxon for filtering by collection. Optional, XRPL only."),
      chainId: OnboardingChainId,
      discount: z.number().int().min(1).max(50).describe("Discount percentage (1-50)"),
    });
  • src/index.ts:564-584 (registration)
    Tool registration via server.tool(...) for "insumer_configure_nfts" with schema (id + nftCollections array of NftCollectionSchema, max 4) and async handler.
    server.tool(
      "insumer_configure_nfts",
      "Configure NFT collections that grant discounts at the merchant. Max 4 collections. Owner only.",
      {
        id: z.string().describe("Merchant ID"),
        nftCollections: z
          .array(NftCollectionSchema)
          .min(0)
          .max(4)
          .describe("NFT collection configurations (0-4)"),
      },
      async (args) => {
        const { id, ...body } = args;
        const result = await apiCall(
          "PUT",
          `/merchants/${encodeURIComponent(id)}/nfts`,
          body
        );
        return formatResult(result);
      }
    );
  • Handler function: destructures args to extract 'id', sends PUT request to /merchants/{id}/nfts with the rest as body, then formats the result.
    async (args) => {
      const { id, ...body } = args;
      const result = await apiCall(
        "PUT",
        `/merchants/${encodeURIComponent(id)}/nfts`,
        body
      );
      return formatResult(result);
    }
  • apiCall helper: generic HTTP request function that adds API key header and returns JSON result with ok/data/error/meta.
    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;
      }>;
    }
  • formatResult helper: wraps API response into MCP content result format, setting isError flag if not ok.
    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,
      };
    }
Behavior3/5

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

With no annotations, the description carries the burden of behavioral disclosure. It adds constraints (max 4, owner only) but does not explain side effects like replacing existing collections, immediate effect, or error handling. Partial but not comprehensive.

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?

The description is very concise (one sentence plus a phrase) and front-loads the main purpose. Every sentence is useful, though a slightly more structured format (e.g., listing restrictions) could improve readability.

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?

Given no output schema and no annotations, the description covers the tool's core function and key constraints but omits details like whether the configuration is additive or replacements, and what the return value indicates. Adequate but not 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 description coverage is 100% (both 'id' and 'nftCollections' have descriptions). The tool description adds no additional meaning beyond the schema, so a baseline of 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?

The description clearly states the tool configures NFT collections for discounts, specifying the maximum of 4 collections and owner-only restriction. This distinguishes it from sibling tools like insumer_configure_tokens or insumer_check_discount.

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' as a usage restriction, but does not explicitly state when to use this tool versus alternatives (e.g., when to use insumer_configure_tokens for token-based discounts). Usage context is implied but not detailed.

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