Skip to main content
Glama

addLoyaltyTiers

Create new loyalty tiers in Mews to structure customer reward programs with defined levels, benefits, and point requirements.

Instructions

Adds new loyalty tiers to the system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ChainIdNoUnique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.
LoyaltyTiersYesArray of loyalty tier objects to create

Implementation Reference

  • The execute function of the addLoyaltyTiersTool that performs the HTTP request to the /api/connector/v1/loyaltyTiers/add endpoint.
    async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const result = await mewsRequest(config, '/api/connector/v1/loyaltyTiers/add', args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • The inputSchema defining the parameters for adding loyalty tiers, including optional ChainId and required array of LoyaltyTiers.
    inputSchema: { type: 'object', properties: { ChainId: { type: 'string', description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.' }, LoyaltyTiers: { type: 'array', items: { type: 'object', properties: { LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' }, Name: { type: 'string', description: 'Name of the loyalty tier' }, Description: { type: 'string', description: 'Description of the loyalty tier' }, Level: { type: 'number', description: 'Level of the loyalty tier (lower numbers = lower tiers)' }, MinimumPointsRequired: { type: 'number', description: 'Minimum points required to reach this tier' }, BenefitDescription: { type: 'string', description: 'Description of the benefits for this tier' }, IsActive: { type: 'boolean', description: 'Whether the loyalty tier is active' } }, required: ['LoyaltyProgramId', 'Name'], additionalProperties: false }, description: 'Array of loyalty tier objects to create', maxItems: 1000 } }, required: ['LoyaltyTiers'], additionalProperties: false },
  • Import of the addLoyaltyTiersTool.
    import { addLoyaltyTiersTool } from './loyalty/addLoyaltyTiers.js';
  • Inclusion of addLoyaltyTiersTool in the allTools array for registration.
    addLoyaltyTiersTool,
  • Full tool definition including name, description, schema, and handler.
    export const addLoyaltyTiersTool: Tool = { name: 'addLoyaltyTiers', description: 'Adds new loyalty tiers to the system', inputSchema: { type: 'object', properties: { ChainId: { type: 'string', description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.' }, LoyaltyTiers: { type: 'array', items: { type: 'object', properties: { LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' }, Name: { type: 'string', description: 'Name of the loyalty tier' }, Description: { type: 'string', description: 'Description of the loyalty tier' }, Level: { type: 'number', description: 'Level of the loyalty tier (lower numbers = lower tiers)' }, MinimumPointsRequired: { type: 'number', description: 'Minimum points required to reach this tier' }, BenefitDescription: { type: 'string', description: 'Description of the benefits for this tier' }, IsActive: { type: 'boolean', description: 'Whether the loyalty tier is active' } }, required: ['LoyaltyProgramId', 'Name'], additionalProperties: false }, description: 'Array of loyalty tier objects to create', maxItems: 1000 } }, required: ['LoyaltyTiers'], additionalProperties: false }, async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const result = await mewsRequest(config, '/api/connector/v1/loyaltyTiers/add', args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }

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/code-rabi/mews-mcp'

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