Skip to main content
Glama

getAllLoyaltyPrograms

Retrieve all loyalty programs from the Mews hospitality platform. Filter results by identifiers, names, activity states, or creation/update dates to manage customer rewards programs.

Instructions

Returns all loyalty programs of the enterprise, optionally filtered by specific loyalty program identifiers or other filter parameters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ChainIdsNoUnique identifiers of the chain. If not specified, the operation returns data for all chains within scope of the Access Token.
CreatedUtcNoThe time interval during which the program was created (max length 3 months)
UpdatedUtcNoThe time interval during which the program was last updated (max length 3 months)
LoyaltyProgramIdsNoUnique identifiers of Loyalty programs.
ActivityStatesNoWhether to return only active, only deleted or both records.
NamesNoNames of the loyalty programs.
LimitationNoLimitation on the quantity of data returned

Implementation Reference

  • Handler function that executes the tool: defaults Limitation.Count to 100, spreads input args, calls mewsRequest to GET loyalty programs, returns JSON stringified 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/loyaltyPrograms/getAll', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Input schema defining parameters for filtering and paginating loyalty programs query.
    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 program 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 program was last updated (max length 3 months)' }, 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 programs.', maxItems: 1000 }, Limitation: { type: 'object', properties: { Count: { type: 'number', description: 'Maximum number of loyalty programs to return' }, Cursor: { type: 'string', description: 'Pagination cursor for next page' } }, description: 'Limitation on the quantity of data returned' } }, additionalProperties: false },
  • Import statement bringing the tool into the index for registration.
    import { getAllLoyaltyProgramsTool } from './loyalty/getAllLoyaltyPrograms.js';
  • Tool added to the allTools array, which is used to populate toolMap and getToolDefinitions for MCP server registration.
    getAllLoyaltyProgramsTool,

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