Skip to main content
Glama
code-rabi

Mews MCP

by code-rabi

updateLoyaltyMemberships

Modify loyalty membership details including program, status, points, and expiration dates for customer accounts in the Mews hospitality platform.

Instructions

Updates information about the specified loyalty memberships. Note this operation supports Portfolio Access Tokens.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ChainIdNoUnique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.
LoyaltyMembershipUpdatesYesLoyalty memberships to be updated

Implementation Reference

  • The handler function that executes the tool by making an HTTP request to the Mews API endpoint for updating loyalty memberships.
    async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> {
      const result = await mewsRequest(config, '/api/connector/v1/loyaltyMemberships/update', args);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • Input schema defining the structure for updating loyalty memberships, including optional ChainId and required array of updates.
    inputSchema: {
      type: 'object',
      properties: {
        ChainId: {
          type: 'string',
          description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.'
        },
        LoyaltyMembershipUpdates: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              LoyaltyMembershipId: { type: 'string', description: 'Unique identifier of the loyalty membership' },
              LoyaltyProgramId: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'Unique identifier of the loyalty program' }
                },
                description: 'Unique identifier of the loyalty program (or null if the program should not be updated)'
              },
              State: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'State of the loyalty membership' }
                },
                description: 'State of the loyalty membership (or null if the state should not be updated)'
              },
              IsPrimary: {
                type: 'object',
                properties: {
                  Value: { type: 'boolean', description: 'Boolean value defining the primary loyalty membership' }
                },
                description: 'Boolean value defining the primary loyalty membership for the account (or null if the value should not be updated)'
              },
              Code: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'Code of the loyalty membership' }
                },
                description: 'Code of the loyalty membership (or null if the code should not be updated)'
              },
              ProviderMembershipId: {
                type: 'object',
                properties: {
                  Value: { type: 'string', maxLength: 100, description: 'Loyalty membership identifier assigned by external provider' }
                },
                description: 'Loyalty membership identifier assigned by the external loyalty provider\'s system (or null if the value should not be updated)'
              },
              Points: {
                type: 'object',
                properties: {
                  Value: { type: 'number', description: 'The loyalty points the account has' }
                },
                description: 'The loyalty points the account has in the loyalty membership (or null if the points should not be updated)'
              },
              ExpirationDate: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'Expiration date of the loyalty membership in UTC timezone in ISO 8601 format' }
                },
                description: 'Expiration date of the loyalty membership in UTC timezone in ISO 8601 format (or null if the date should not be updated)'
              },
              Url: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'URL of the loyalty membership' }
                },
                description: 'URL of the loyalty membership (or null if the URL should not be updated)'
              },
              LoyaltyTierId: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'Unique identifier of the loyalty tier' }
                },
                description: 'Unique identifier of the loyalty tier (or null if the tier should not be updated)'
              }
            },
            required: ['LoyaltyMembershipId'],
            additionalProperties: false
          },
          description: 'Loyalty memberships to be updated',
          maxItems: 1000
        }
      },
      required: ['LoyaltyMembershipUpdates'],
      additionalProperties: false
    },
  • Import statement for the updateLoyaltyMembershipsTool.
    import { updateLoyaltyMembershipsTool } from './loyalty/updateLoyaltyMemberships.js';
  • Registration of loyalty tools, including updateLoyaltyMembershipsTool, in the allTools array.
    // Loyalty tools
    getAllLoyaltyMembershipsTool,
    addLoyaltyMembershipsTool,
    updateLoyaltyMembershipsTool,
    deleteLoyaltyMembershipsTool,
    getAllLoyaltyProgramsTool,
    addLoyaltyProgramsTool,
    updateLoyaltyProgramsTool,
    deleteLoyaltyProgramsTool,
    getAllLoyaltyTiersTool,
    addLoyaltyTiersTool,
    updateLoyaltyTiersTool,
    deleteLoyaltyTiersTool,
Behavior2/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 states it's an update operation but doesn't cover critical aspects like required permissions, whether changes are reversible, rate limits, error handling, or what the response looks like. The Portfolio Access Token note is helpful but insufficient for a mutation tool.

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

Conciseness4/5

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

The description is brief and to the point with two sentences. The first sentence states the purpose clearly, and the second adds a relevant authentication note. There's no unnecessary verbosity.

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?

For a mutation tool with no annotations and no output schema, the description is inadequate. It doesn't explain what 'updates' entail (e.g., partial vs. full updates), success/failure responses, or important behavioral constraints. The Portfolio Access Token note is the only contextual addition.

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. The description doesn't add any parameter-specific information beyond what's already in the schema descriptions, which is acceptable but not exceptional.

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 ('Updates') and resource ('information about the specified loyalty memberships'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'updateLoyaltyPrograms' or 'updateLoyaltyTiers', which would require 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 'supports Portfolio Access Tokens' but provides no guidance on when to use this tool versus alternatives like 'addLoyaltyMemberships' or 'deleteLoyaltyMemberships'. There's no mention of prerequisites, constraints, or typical use cases.

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