updateLoyaltyPrograms
Modify loyalty program details like names, descriptions, status, and external identifiers in the Mews hospitality platform to maintain accurate guest rewards systems.
Instructions
Updates information about the specified loyalty programs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ChainId | No | Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise. | |
| LoyaltyProgramUpdates | Yes | Loyalty programs to be updated |
Implementation Reference
- The execute handler function that performs the core logic: calls mewsRequest to the /api/connector/v1/loyaltyPrograms/update endpoint with provided arguments and returns the JSON-formatted result.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const result = await mewsRequest(config, '/api/connector/v1/loyaltyPrograms/update', args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- The inputSchema defining the parameters for the tool: optional ChainId and required array of LoyaltyProgramUpdates, each with LoyaltyProgramId and optional updates to Name, Description, ExternalIdentifier, IsActive.inputSchema: { type: 'object', properties: { ChainId: { type: 'string', description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.' }, LoyaltyProgramUpdates: { type: 'array', items: { type: 'object', properties: { LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' }, Name: { type: 'object', properties: { Value: { type: 'string', description: 'Name of the loyalty program' } }, description: 'Name of the loyalty program (or null if the name should not be updated)' }, Description: { type: 'object', properties: { Value: { type: 'string', description: 'Description of the loyalty program' } }, description: 'Description of the loyalty program (or null if the description should not be updated)' }, ExternalIdentifier: { type: 'object', properties: { Value: { type: 'string', description: 'External identifier of the loyalty program' } }, description: 'External identifier of the loyalty program (or null if the identifier should not be updated)' }, IsActive: { type: 'object', properties: { Value: { type: 'boolean', description: 'Whether the loyalty program is active' } }, description: 'Whether the loyalty program is active (or null if the status should not be updated)' } }, required: ['LoyaltyProgramId'], additionalProperties: false }, description: 'Loyalty programs to be updated', maxItems: 1000 } }, required: ['LoyaltyProgramUpdates'], additionalProperties: false },
- src/tools/index.ts:79-79 (registration)Import statement that brings the updateLoyaltyProgramsTool into the index file.import { updateLoyaltyProgramsTool } from './loyalty/updateLoyaltyPrograms.js';
- src/tools/index.ts:164-164 (registration)Registration of the tool in the allTools array, which is used to populate the toolMap and expose all tools.updateLoyaltyProgramsTool,
- The complete exported tool object definition, serving as the primary handler implementation.export const updateLoyaltyProgramsTool: Tool = { name: 'updateLoyaltyPrograms', description: 'Updates information about the specified loyalty programs', inputSchema: { type: 'object', properties: { ChainId: { type: 'string', description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.' }, LoyaltyProgramUpdates: { type: 'array', items: { type: 'object', properties: { LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' }, Name: { type: 'object', properties: { Value: { type: 'string', description: 'Name of the loyalty program' } }, description: 'Name of the loyalty program (or null if the name should not be updated)' }, Description: { type: 'object', properties: { Value: { type: 'string', description: 'Description of the loyalty program' } }, description: 'Description of the loyalty program (or null if the description should not be updated)' }, ExternalIdentifier: { type: 'object', properties: { Value: { type: 'string', description: 'External identifier of the loyalty program' } }, description: 'External identifier of the loyalty program (or null if the identifier should not be updated)' }, IsActive: { type: 'object', properties: { Value: { type: 'boolean', description: 'Whether the loyalty program is active' } }, description: 'Whether the loyalty program is active (or null if the status should not be updated)' } }, required: ['LoyaltyProgramId'], additionalProperties: false }, description: 'Loyalty programs to be updated', maxItems: 1000 } }, required: ['LoyaltyProgramUpdates'], additionalProperties: false }, async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const result = await mewsRequest(config, '/api/connector/v1/loyaltyPrograms/update', args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } };