Skip to main content
Glama
code-rabi

Mews MCP

by code-rabi

getAllLoyaltyMemberships

Retrieve all loyalty memberships from Mews hospitality platform with optional filters for IDs, activity states, dates, and pagination support.

Instructions

Returns all loyalty memberships of the enterprise, optionally filtered by specific loyalty membership identifiers, activity states, or other filter parameters. Note this operation uses Pagination and supports Portfolio Access Tokens.

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 membership was created (max length 3 months)
UpdatedUtcNoThe time interval during which the membership was last updated (max length 3 months)
LoyaltyMembershipIdsNoUnique identifiers of Loyalty memberships.
AccountIdsNoUnique identifiers of accounts (for example Customers or Companies) the membership is associated with.
LoyaltyProgramIdsNoUnique identifiers of Loyalty programs.
MembershipStatesNoStates of the loyalty memberships.
ActivityStatesNoWhether to return only active, only deleted or both records.
CodesNoList of loyalty membership codes, such as identification numbers printed on loyalty cards visible to the customer.
ProviderMembershipIdsNoList of unique loyalty membership identifiers assigned and managed by the external loyalty provider's system.
LimitationYesLimitation on the quantity of data returned

Implementation Reference

  • The execute method implementing the core logic of the getAllLoyaltyMemberships tool, which prepares request data with default Limitation and calls mewsRequest to the loyaltyMemberships endpoint.
    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/loyaltyMemberships/getAll', requestData);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • Input schema defining parameters for filtering and paginating loyalty memberships, including ChainIds, date ranges, IDs, states, and required 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 membership 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 membership was last updated (max length 3 months)'
        },
        LoyaltyMembershipIds: {
          type: 'array',
          items: { type: 'string' },
          description: 'Unique identifiers of Loyalty memberships.',
          maxItems: 1000
        },
        AccountIds: {
          type: 'array',
          items: { type: 'string' },
          description: 'Unique identifiers of accounts (for example Customers or Companies) the membership is associated with.',
          maxItems: 1000
        },
        LoyaltyProgramIds: {
          type: 'array',
          items: { type: 'string' },
          description: 'Unique identifiers of Loyalty programs.',
          maxItems: 1000
        },
        MembershipStates: {
          type: 'array',
          items: { type: 'string' },
          description: 'States of the loyalty memberships.'
        },
        ActivityStates: {
          type: 'array',
          items: { type: 'string' },
          description: 'Whether to return only active, only deleted or both records.'
        },
        Codes: {
          type: 'array',
          items: { type: 'string' },
          description: 'List of loyalty membership codes, such as identification numbers printed on loyalty cards visible to the customer.',
          maxItems: 1000
        },
        ProviderMembershipIds: {
          type: 'array',
          items: { type: 'string' },
          description: 'List of unique loyalty membership identifiers assigned and managed by the external loyalty provider\'s system.',
          maxItems: 1000
        },
        Limitation: {
          type: 'object',
          properties: {
            Count: { type: 'number', description: 'Maximum number of loyalty memberships to return' },
            Cursor: { type: 'string', description: 'Pagination cursor for next page' }
          },
          description: 'Limitation on the quantity of data returned'
        }
      },
      required: ['Limitation'],
      additionalProperties: false
    },
  • Registration of the getAllLoyaltyMembershipsTool in the allTools array, which is used for toolMap and MCP server registration.
    export const allTools: Tool[] = [
      // Account tools
      getAllAddressesTool,
      addAddressesTool,
      
      // Customer tools
      getAllCustomersTool,
      addCustomerTool,
      updateCustomersTool,
      deleteCustomersTool,
      mergeCustomersTool,
      
      // Company tools
      getAllCompaniesTool,
      addCompanyTool,
      updateCompaniesTool,
      deleteCompaniesTool,
      
      // Reservation tools
      getAllReservationsTool,
      addReservationTool,
      updateReservationsTool,
      cancelReservationsTool,
      
      // Configuration tools
      getConfigurationTool,
      getAllCountriesTool,
      getAllCurrenciesTool,
      getAllTaxEnvironmentsTool,
      getAllTaxationsTool,
      getAllLanguagesTool,
      getLanguageTextsTool,
      
      // Finance tools
      getAllBillsTool,
      getAllAccountingItemsTool,
      addAccountingItemsTool,
      
      // Payment tools
      addPaymentTool,
      chargeCreditCardTool,
      getAllPaymentsTool,
      
      // Services tools
      getAllServicesTool,
      getAllSpacesTool,
      getAllSpaceCategoriesTool,
      
      // Account Notes tools
      getAllAccountNotesTool,
      addAccountNotesTool,
      
      // Rates tools
      getAllRatesTool,
      getRatePricingTool,
      
      // Export tools
      exportAccountingItemsTool,
      exportReservationsTool,
      
      // Availability tools
      getAllAvailabilityBlocksTool,
      
      // Voucher tools
      addVouchersTool,
      
      // Task tools
      getAllTasksTool,
      addTaskTool,
      
      // Loyalty tools
      getAllLoyaltyMembershipsTool,
      addLoyaltyMembershipsTool,
      updateLoyaltyMembershipsTool,
      deleteLoyaltyMembershipsTool,
      getAllLoyaltyProgramsTool,
      addLoyaltyProgramsTool,
      updateLoyaltyProgramsTool,
      deleteLoyaltyProgramsTool,
      getAllLoyaltyTiersTool,
      addLoyaltyTiersTool,
      updateLoyaltyTiersTool,
      deleteLoyaltyTiersTool,
    ];
  • Import statement that brings the tool into the index for registration.
    import { getAllLoyaltyMembershipsTool } from './loyalty/getAllLoyaltyMemberships.js';
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It adds valuable context beyond basic functionality: it explicitly mentions pagination ('Note this operation uses Pagination') and authentication requirements ('supports Portfolio Access Tokens'), which are critical for correct usage. However, it does not detail rate limits, error conditions, or response format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose in the first sentence, followed by two concise sentences that add critical behavioral context (pagination and authentication). Every sentence earns its place with no wasted words, making it appropriately sized and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (11 parameters, no output schema, no annotations), the description is reasonably complete. It covers the purpose, key behavioral traits (pagination, authentication), and hints at filtering capabilities. However, without an output schema, it does not explain return values or structure, leaving a gap in full context for the agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, so the schema already documents all 11 parameters thoroughly. The description adds minimal value by mentioning filtering by 'loyalty membership identifiers, activity states, or other filter parameters', but does not provide additional syntax, format, or usage details beyond what the schema provides. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Returns') and resource ('all loyalty memberships of the enterprise'), and distinguishes it from siblings by specifying it's a 'getAll' operation for loyalty memberships, unlike 'addLoyaltyMemberships', 'deleteLoyaltyMemberships', or 'updateLoyaltyMemberships' which are mutation tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage through optional filtering parameters (e.g., 'optionally filtered by specific loyalty membership identifiers, activity states, or other filter parameters'), but does not explicitly state when to use this tool versus alternatives like 'getAllLoyaltyPrograms' or 'getAllLoyaltyTiers', nor does it provide exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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