getAllLoyaltyTiers
Retrieve all loyalty tiers from Mews hospitality platform, with options to filter by identifiers, programs, activity states, or date ranges for targeted data access.
Instructions
Returns all loyalty tiers of the enterprise, optionally filtered by specific loyalty tier identifiers or other filter parameters.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ChainIds | No | Unique identifiers of the chain. If not specified, the operation returns data for all chains within scope of the Access Token. | |
| CreatedUtc | No | The time interval during which the tier was created (max length 3 months) | |
| UpdatedUtc | No | The time interval during which the tier was last updated (max length 3 months) | |
| LoyaltyTierIds | No | Unique identifiers of Loyalty tiers. | |
| LoyaltyProgramIds | No | Unique identifiers of Loyalty programs. | |
| ActivityStates | No | Whether to return only active, only deleted or both records. | |
| Names | No | Names of the loyalty tiers. | |
| Limitation | No | Limitation on the quantity of data returned |
Implementation Reference
- The async execute function that implements the core tool logic: defaults Limitation.Count to 100, spreads input args, calls mewsRequest to the loyaltyTiers/getAll endpoint, and returns formatted JSON result.async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const inputArgs = args as Record<string, unknown>; // Ensure required parameters have defaults const requestData: Record<string, unknown> = { Limitation: { Count: 100 }, ...inputArgs }; const result = await mewsRequest(config, '/api/connector/v1/loyaltyTiers/getAll', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Defines the input schema including optional filters like ChainIds, date ranges, IDs, states, names, and pagination Limitation.inputSchema: { type: 'object', properties: { ChainIds: { type: 'array', items: { type: 'string' }, description: 'Unique identifiers of the chain. If not specified, the operation returns data for all chains within scope of the Access Token.', maxItems: 1000 }, CreatedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of creation date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of creation date range (ISO 8601)' } }, description: 'The time interval during which the tier was created (max length 3 months)' }, UpdatedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of update date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of update date range (ISO 8601)' } }, description: 'The time interval during which the tier was last updated (max length 3 months)' }, LoyaltyTierIds: { type: 'array', items: { type: 'string' }, description: 'Unique identifiers of Loyalty tiers.', maxItems: 1000 }, LoyaltyProgramIds: { type: 'array', items: { type: 'string' }, description: 'Unique identifiers of Loyalty programs.', maxItems: 1000 }, ActivityStates: { type: 'array', items: { type: 'string' }, description: 'Whether to return only active, only deleted or both records.' }, Names: { type: 'array', items: { type: 'string' }, description: 'Names of the loyalty tiers.', maxItems: 1000 }, Limitation: { type: 'object', properties: { Count: { type: 'number', description: 'Maximum number of loyalty tiers to return' }, Cursor: { type: 'string', description: 'Pagination cursor for next page' } }, description: 'Limitation on the quantity of data returned' } }, additionalProperties: false },
- src/tools/index.ts:81-81 (registration)Imports the getAllLoyaltyTiersTool from its implementation file.import { getAllLoyaltyTiersTool } from './loyalty/getAllLoyaltyTiers.js';
- src/tools/index.ts:166-166 (registration)Includes the tool in the allTools array, which is exported as the registry of all available tools.getAllLoyaltyTiersTool,