Skip to main content
Glama

transfer_loyalty_tokens

Transfer loyalty tokens between wallets by generating calldata for on-chain loyalty programs on Base L2.

Instructions

Get calldata to transfer loyalty tokens between wallets

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_addressYesToken contract address (0x...)
toYesRecipient wallet (0x...)
amountYesTokens to transfer

Implementation Reference

  • The handler function that executes the transfer_loyalty_tokens logic, including authentication, input validation, program verification, and calldata generation.
    handler: async ({ token_address, to, amount }: any) => {
      const err = authGuard(["mint"]);
      if (err) return T(err);
      if (!/^0x[a-fA-F0-9]{40}$/.test(to)) return T('{"error":"Invalid recipient address"}');
      const d = db();
      const { data: prog } = await d.from("loyalty_programs").select("id,name,status").eq("token_address", token_address.toLowerCase()).eq("merchant_address", agent.ownerAddress).single();
      if (!prog) return T('{"error":"Program not found or not owned by you"}');
      if (prog.status !== "active") return T(JSON.stringify({ error: `Program is ${prog.status}` }));
      return T(JSON.stringify({ contract_call: { to: token_address, function: "transfer(address,uint256)", args: [to, amount], calldata: encodeTransferCalldata(to, amount), chain: "Base (8453)", builder_code: BUILDER_CODE } }));
    },
  • The registration of the transfer_loyalty_tokens tool with its description and input schema.
    mcpServer.tool("transfer_loyalty_tokens", {
      description: "Get calldata to transfer loyalty tokens between wallets",
      inputSchema: { type: "object" as const, properties: { token_address: { type: "string", description: "Token contract address (0x...)" }, to: { type: "string", description: "Recipient wallet (0x...)" }, amount: { type: "number", description: "Tokens to transfer" } }, required: ["token_address", "to", "amount"] },
      handler: async ({ token_address, to, amount }: any) => {
        const err = authGuard(["mint"]);
        if (err) return T(err);
        if (!/^0x[a-fA-F0-9]{40}$/.test(to)) return T('{"error":"Invalid recipient address"}');
        const d = db();
        const { data: prog } = await d.from("loyalty_programs").select("id,name,status").eq("token_address", token_address.toLowerCase()).eq("merchant_address", agent.ownerAddress).single();
        if (!prog) return T('{"error":"Program not found or not owned by you"}');
        if (prog.status !== "active") return T(JSON.stringify({ error: `Program is ${prog.status}` }));
        return T(JSON.stringify({ contract_call: { to: token_address, function: "transfer(address,uint256)", args: [to, amount], calldata: encodeTransferCalldata(to, amount), chain: "Base (8453)", builder_code: BUILDER_CODE } }));
      },
    });
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Get calldata' implies a read-only/preparation operation, the description fails to specify the return format (hex string, JSON object), whether validation occurs (balance checks), or any rate limiting concerns.

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 a single, efficient sentence with no redundant words. It front-loads the action ('Get calldata') and maintains focus. However, it may be overly terse given the complexity of blockchain transaction preparation, lacking a second sentence to clarify the output or next steps.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool generating blockchain transaction data, the description omits crucial context: the nature of the returned calldata, whether it includes gas estimates, and how to use the result. With no output schema and no annotations, the description should compensate by explaining the transaction preparation workflow, which it does not.

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?

The input schema has 100% description coverage with clear Ethereum address formats and amount specification. The description adds minimal semantic value beyond the schema, merely contextualizing that the transfer occurs 'between wallets', which aligns with the 'to' parameter. Baseline 3 is appropriate given comprehensive schema documentation.

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 specifies the action ('Get calldata'), resource ('loyalty tokens'), and operation ('transfer between wallets'). It implicitly distinguishes from execution-style transfers by specifying 'Get calldata', though it doesn't explicitly contrast with sibling tools like 'mint_loyalty_tokens'.

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?

The description provides no guidance on when to use this tool versus alternatives, nor does it explain the critical workflow that this generates unsigned transaction data requiring separate signing and submission. No prerequisites or exclusion criteria are mentioned.

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