Skip to main content
Glama
code-rabi

Mews MCP

by code-rabi

addLoyaltyMemberships

Create new loyalty memberships in the Mews hospitality system to manage customer reward programs and track points.

Instructions

Adds new loyalty memberships to the system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ChainIdNoUnique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.
LoyaltyMembershipsYesArray of loyalty membership objects to create

Implementation Reference

  • The execute handler function sends the input arguments to the Mews API endpoint '/api/connector/v1/loyaltyMemberships/add' via mewsRequest utility and returns the formatted JSON response.
    async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> {
      const result = await mewsRequest(config, '/api/connector/v1/loyaltyMemberships/add', args);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • Input schema defining the structure for ChainId (optional) and LoyaltyMemberships array (required, up to 1000 items), each with required AccountId and LoyaltyProgramId, and optional other properties.
    inputSchema: {
      type: 'object',
      properties: {
        ChainId: {
          type: 'string',
          description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.'
        },
        LoyaltyMemberships: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              AccountId: { type: 'string', description: 'Unique identifier of the account (Customer or Company)' },
              LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' },
              State: { type: 'string', description: 'State of the loyalty membership' },
              IsPrimary: { type: 'boolean', description: 'Whether this is the primary loyalty membership for the account' },
              Code: { type: 'string', description: 'Code of the loyalty membership' },
              ProviderMembershipId: { type: 'string', description: 'Loyalty membership identifier assigned by external provider', maxLength: 100 },
              Points: { type: 'number', description: 'The loyalty points the account has in this membership' },
              ExpirationDate: { type: 'string', description: 'Expiration date of the loyalty membership in UTC timezone in ISO 8601 format' },
              Url: { type: 'string', description: 'URL of the loyalty membership' },
              LoyaltyTierId: { type: 'string', description: 'Unique identifier of the loyalty tier' }
            },
            required: ['AccountId', 'LoyaltyProgramId'],
            additionalProperties: false
          },
          description: 'Array of loyalty membership objects to create',
          maxItems: 1000
        }
      },
      required: ['LoyaltyMemberships'],
      additionalProperties: false
    },
  • Registers the addLoyaltyMembershipsTool in the central allTools array exported for use in the MCP server.
    // Loyalty tools
    getAllLoyaltyMembershipsTool,
    addLoyaltyMembershipsTool,
  • Imports the addLoyaltyMembershipsTool from its implementation file.
    import { addLoyaltyMembershipsTool } from './loyalty/addLoyaltyMemberships.js';
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. While 'Adds' implies a write operation, the description doesn't cover critical aspects like required permissions, whether this is idempotent, rate limits, error handling, or what happens on success (e.g., returns created IDs). This leaves significant gaps for an agent to understand how to use the tool safely and effectively.

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, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence contributes directly to understanding the tool's purpose.

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 complexity of adding multiple loyalty memberships with nested objects, no annotations, and no output schema, the description is insufficient. It doesn't address behavioral traits, error conditions, or what the tool returns, leaving the agent with incomplete context for a write operation that could have significant side effects.

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?

Schema description coverage is 100%, so the schema fully documents both parameters (ChainId and LoyaltyMemberships array). The description adds no additional parameter semantics beyond what's in the schema, such as explaining relationships between fields or usage examples. This meets the baseline for high schema coverage but doesn't enhance understanding.

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 ('Adds') and resource ('new loyalty memberships to the system'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'updateLoyaltyMemberships' or 'deleteLoyaltyMemberships', but the verb 'Adds' implies creation rather than modification or removal.

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 provides no guidance on when to use this tool versus alternatives like 'updateLoyaltyMemberships' or 'deleteLoyaltyMemberships'. It also doesn't mention prerequisites, such as needing existing accounts or loyalty programs, which are implied by the required parameters but not stated explicitly in the description.

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