Skip to main content
Glama

create_loyalty_program

Deploy a new ERC-20 loyalty token on Base L2 to manage rewards, track balances, and establish program tiers for customer engagement.

Instructions

Get factory calldata to deploy a new ERC-20 loyalty token on Base

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesProgram name
symbolYesToken symbol, 2-5 chars
expiration_daysNoProgram duration in days (default: 365)

Implementation Reference

  • The handler for the create_loyalty_program tool, which validates permissions, prepares program parameters, and generates the necessary calldata for token deployment.
    handler: async ({ name, symbol, expiration_days }: any) => {
      const err = authGuard(["mint", "create_program"]);
      if (err) return T(err);
      const days = expiration_days || 365;
      const sym = symbol.toUpperCase();
      const calldata = encodeCreateLoyaltyTokenCalldata(name, sym, agent.ownerAddress);
      return T(JSON.stringify({ message: "Execute factory tx, then call register_loyalty_program with the deployed token_address.", contract_call: { to: FACTORY_ADDRESS, function: "createLoyaltyToken(string,string,address)", params: [name, sym, agent.ownerAddress], calldata, chain: "Base (8453)", builder_code: BUILDER_CODE }, program_details: { name, symbol: sym, expiration_days: days } }));
    },
  • Registration of the create_loyalty_program tool within the MCP server definition.
    mcpServer.tool("create_loyalty_program", {
      description: "Get factory calldata to deploy a new ERC-20 loyalty token on Base",
      inputSchema: { type: "object" as const, properties: { name: { type: "string", description: "Program name" }, symbol: { type: "string", description: "Token symbol, 2-5 chars" }, expiration_days: { type: "number", description: "Program duration in days (default: 365)" } }, required: ["name", "symbol"] },
      handler: async ({ name, symbol, expiration_days }: any) => {
        const err = authGuard(["mint", "create_program"]);
        if (err) return T(err);
        const days = expiration_days || 365;
        const sym = symbol.toUpperCase();
        const calldata = encodeCreateLoyaltyTokenCalldata(name, sym, agent.ownerAddress);
        return T(JSON.stringify({ message: "Execute factory tx, then call register_loyalty_program with the deployed token_address.", contract_call: { to: FACTORY_ADDRESS, function: "createLoyaltyToken(string,string,address)", params: [name, sym, agent.ownerAddress], calldata, chain: "Base (8453)", builder_code: BUILDER_CODE }, program_details: { name, symbol: sym, expiration_days: days } }));
      },
    });
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses the mechanism (factory calldata) and platform (Base), but lacks details on side effects, authentication requirements, rate limits, or what the tool actually returns (the calldata itself vs a transaction hash).

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?

Single, dense sentence with zero waste. Front-loaded with action ('Get factory calldata'), specifies the domain ('ERC-20 loyalty token'), and platform ('Base'). Every word earns its place.

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 blockchain deployment tool with 100% schema coverage, the description adequately covers the primary purpose. However, lacking an output schema and given the complexity of factory deployment patterns, it should ideally clarify what the caller receives (calldata vs deployed address) and next steps. Sufficient but not comprehensive.

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% with clear descriptions for all 3 parameters (name, symbol, expiration_days). The description provides context that these params are for an ERC-20 loyalty token, but does not add specific syntax or format details beyond what the schema already provides. 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?

Specific verb 'Get factory calldata' combined with clear resource 'ERC-20 loyalty token' and platform 'Base'. Distinguishes from sibling tools like register_loyalty_program or activate_loyalty_program through the specific deployment mechanism.

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 versus siblings like register_loyalty_program or activate_loyalty_program. While 'deploy' implies initial contract creation, the workflow relationship between deploying, registering, and activating is not explained.

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/aspekt19/unboxed-loyalty-spark'

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