Skip to main content
Glama

list_rewards

Retrieve available rewards for a loyalty program by providing the token contract address to view program benefits.

Instructions

List rewards for a loyalty program by token_address

Input Schema

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

Implementation Reference

  • Tool registration and handler implementation for "list_rewards" within the loyalty MCP server.
    mcpServer.tool("list_rewards", {
      description: "List rewards for a loyalty program by token_address",
      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(["read"]);
        if (err) return T(err);
        const { data, error } = await db().from("rewards").select("id,name,description,cost,is_active,created_at").eq("token_address", token_address.toLowerCase()).eq("merchant_address", agent.ownerAddress);
        if (error) return T(JSON.stringify({ error: error.message }));
        return T(JSON.stringify({ rewards: data || [] }));

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