addLoyaltyPrograms
Create new loyalty programs in the Mews hospitality system to reward customer engagement and manage program details like names, descriptions, and activation status.
Instructions
Adds new loyalty programs to the system
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ChainId | No | Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise. | |
| LoyaltyPrograms | Yes | Array of loyalty program objects to create |
Implementation Reference
- The async execute function that implements the core logic of the addLoyaltyPrograms tool by calling the Mews API endpoint to add loyalty programs.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const result = await mewsRequest(config, '/api/connector/v1/loyaltyPrograms/add', args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- The inputSchema defining the parameters for the tool: optional ChainId and required LoyaltyPrograms array with up to 1000 items.inputSchema: { type: 'object', properties: { ChainId: { type: 'string', description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.' }, LoyaltyPrograms: { type: 'array', items: { type: 'object', properties: { Name: { type: 'string', description: 'Name of the loyalty program' }, Description: { type: 'string', description: 'Description of the loyalty program' }, ExternalIdentifier: { type: 'string', description: 'External identifier of the loyalty program' }, IsActive: { type: 'boolean', description: 'Whether the loyalty program is active' } }, required: ['Name'], additionalProperties: false }, description: 'Array of loyalty program objects to create', maxItems: 1000 } }, required: ['LoyaltyPrograms'], additionalProperties: false },
- src/tools/index.ts:78-78 (registration)Import of the addLoyaltyProgramsTool from its implementation file.import { addLoyaltyProgramsTool } from './loyalty/addLoyaltyPrograms.js';
- src/tools/index.ts:163-163 (registration)Inclusion of addLoyaltyProgramsTool in the allTools array, registering it for use in the MCP server.addLoyaltyProgramsTool,