Skip to main content
Glama

activate_loyalty_program

Activate an inactive loyalty program by generating calldata to unpause utility and enable token minting for a specified contract address.

Instructions

Get activation calldata (unpauseUtility + enableMinting) for an inactive program

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_addressYesToken contract address (0x...)

Implementation Reference

  • The handler function for activate_loyalty_program, which checks the status of a loyalty program and returns the necessary transaction calldata to activate it.
    handler: async ({ token_address }: any) => {
      const err = authGuard(["mint", "create_program"]);
      if (err) return T(err);
      const d = db();
      const { data: prog } = await d.from("loyalty_programs").select("id,name,symbol,status").eq("token_address", token_address.toLowerCase()).eq("merchant_address", agent.ownerAddress).single();
      if (!prog) return T('{"error":"Program not found"}');
      if (prog.status === "active") return T(JSON.stringify({ message: "Already active", program: prog }));
      return T(JSON.stringify({ message: "Execute 2 transactions in order, then call update_program_status to set status to 'active'.", transactions: [
        { step: 1, description: "Unpause utility", contract_call: { to: token_address, function: "unpauseUtility()", calldata: encodeNoArgCalldata(SELECTORS.unpauseUtility), chain: "Base (8453)", builder_code: BUILDER_CODE } },
        { step: 2, description: "Enable minting", contract_call: { to: token_address, function: "enableMinting()", calldata: encodeNoArgCalldata(SELECTORS.enableMinting), chain: "Base (8453)", builder_code: BUILDER_CODE } },
      ] }));
    },
  • Registration of the activate_loyalty_program tool, including its description and input schema.
    mcpServer.tool("activate_loyalty_program", {
      description: "Get activation calldata (unpauseUtility + enableMinting) for an inactive program",
      inputSchema: { type: "object" as const, properties: { token_address: { type: "string", description: "Token contract address (0x...)" } }, required: ["token_address"] },
      handler: async ({ token_address }: any) => {
        const err = authGuard(["mint", "create_program"]);
        if (err) return T(err);
        const d = db();
        const { data: prog } = await d.from("loyalty_programs").select("id,name,symbol,status").eq("token_address", token_address.toLowerCase()).eq("merchant_address", agent.ownerAddress).single();
        if (!prog) return T('{"error":"Program not found"}');
        if (prog.status === "active") return T(JSON.stringify({ message: "Already active", program: prog }));
        return T(JSON.stringify({ message: "Execute 2 transactions in order, then call update_program_status to set status to 'active'.", transactions: [
          { step: 1, description: "Unpause utility", contract_call: { to: token_address, function: "unpauseUtility()", calldata: encodeNoArgCalldata(SELECTORS.unpauseUtility), chain: "Base (8453)", builder_code: BUILDER_CODE } },
          { step: 2, description: "Enable minting", contract_call: { to: token_address, function: "enableMinting()", calldata: encodeNoArgCalldata(SELECTORS.enableMinting), chain: "Base (8453)", builder_code: BUILDER_CODE } },
        ] }));
      },
    });
Behavior3/5

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

Without annotations, the description carries the burden of explaining behavior. It successfully clarifies that this returns calldata (transaction data) rather than executing the activation itself, and discloses the specific operations involved. However, it omits safety considerations, error conditions (e.g., already active programs), or authentication requirements.

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, efficient sentence with high information density. The parenthetical technical details (unpauseUtility + enableMinting) are precisely placed to clarify the calldata content without verbosity. 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 low complexity (1 param, no nesting) and no output schema, the description adequately explains the return value (calldata) and the target state. It meets the minimum requirements for this tool's complexity level, though annotations or error conditions would improve it further.

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?

With 100% schema coverage, the baseline is 3. The description adds implicit context that token_address refers to an inactive program's contract, but does not elaborate on parameter format beyond the schema's '0x...' notation or provide examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'Gets activation calldata' using specific technical terms (unpauseUtility + enableMinting) and specifies the target resource (inactive program). However, it does not explicitly differentiate from the sibling tool update_program_status, which could create selection ambiguity.

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?

It implies preconditions by specifying 'for an inactive program,' but provides no explicit guidance on when to use this versus update_program_status or other sibling tools, and does not state what happens if the program is already active.

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