Skip to main content
Glama
code-rabi

Mews MCP

by code-rabi

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
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 tier was created (max length 3 months)
UpdatedUtcNoThe time interval during which the tier was last updated (max length 3 months)
LoyaltyTierIdsNoUnique identifiers of Loyalty tiers.
LoyaltyProgramIdsNoUnique identifiers of Loyalty programs.
ActivityStatesNoWhether to return only active, only deleted or both records.
NamesNoNames of the loyalty tiers.
LimitationNoLimitation 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
    },
  • Imports the getAllLoyaltyTiersTool from its implementation file.
    import { getAllLoyaltyTiersTool } from './loyalty/getAllLoyaltyTiers.js';
  • Includes the tool in the allTools array, which is exported as the registry of all available tools.
    getAllLoyaltyTiersTool,
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool returns data but does not cover critical aspects like whether it's read-only, requires authentication, has rate limits, pagination behavior (implied by 'Limitation' parameter but not explained), or error handling. This leaves significant gaps for an agent to understand the tool's behavior.

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 a single, efficient sentence that front-loads the core purpose and briefly mentions filtering options. There is no wasted wording, making it appropriately concise and well-structured for quick comprehension.

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

Completeness2/5

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

Given the tool's complexity (8 parameters, nested objects) and lack of annotations and output schema, the description is insufficient. It does not explain return values, pagination, error cases, or behavioral traits, leaving the agent with incomplete context to use the tool effectively despite the detailed input schema.

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 description mentions optional filtering by 'specific loyalty tier identifiers or other filter parameters', which loosely maps to parameters like 'LoyaltyTierIds' but does not add meaningful details beyond the schema. With 100% schema description coverage, the baseline is 3, as the schema already documents all parameters thoroughly, and the description adds minimal extra value.

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

Purpose4/5

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

The description clearly states the action ('Returns') and resource ('all loyalty tiers of the enterprise'), making the purpose evident. However, it does not explicitly differentiate this tool from sibling tools like 'getAllLoyaltyPrograms' or 'getAllLoyaltyMemberships', which reduces the score from a 5.

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

Usage Guidelines2/5

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

The description mentions optional filtering by 'specific loyalty tier identifiers or other filter parameters', providing some implied context for usage. However, it lacks explicit guidance on when to use this tool versus alternatives (e.g., vs. 'getAllLoyaltyPrograms'), prerequisites, or exclusions, resulting in minimal guidance.

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