Skip to main content
Glama
code-rabi

Mews MCP

by code-rabi

updateLoyaltyPrograms

Modify loyalty program details like names, descriptions, status, and external identifiers in the Mews hospitality platform to maintain accurate guest rewards systems.

Instructions

Updates information about the specified loyalty programs

Input Schema

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

Implementation Reference

  • The execute handler function that performs the core logic: calls mewsRequest to the /api/connector/v1/loyaltyPrograms/update endpoint with provided arguments and returns the JSON-formatted result.
    async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> {
      const result = await mewsRequest(config, '/api/connector/v1/loyaltyPrograms/update', args);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • The inputSchema defining the parameters for the tool: optional ChainId and required array of LoyaltyProgramUpdates, each with LoyaltyProgramId and optional updates to Name, Description, ExternalIdentifier, IsActive.
    inputSchema: {
      type: 'object',
      properties: {
        ChainId: {
          type: 'string',
          description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.'
        },
        LoyaltyProgramUpdates: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' },
              Name: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'Name of the loyalty program' }
                },
                description: 'Name of the loyalty program (or null if the name should not be updated)'
              },
              Description: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'Description of the loyalty program' }
                },
                description: 'Description of the loyalty program (or null if the description should not be updated)'
              },
              ExternalIdentifier: {
                type: 'object',
                properties: {
                  Value: { type: 'string', description: 'External identifier of the loyalty program' }
                },
                description: 'External identifier of the loyalty program (or null if the identifier should not be updated)'
              },
              IsActive: {
                type: 'object',
                properties: {
                  Value: { type: 'boolean', description: 'Whether the loyalty program is active' }
                },
                description: 'Whether the loyalty program is active (or null if the status should not be updated)'
              }
            },
            required: ['LoyaltyProgramId'],
            additionalProperties: false
          },
          description: 'Loyalty programs to be updated',
          maxItems: 1000
        }
      },
      required: ['LoyaltyProgramUpdates'],
      additionalProperties: false
    },
  • Import statement that brings the updateLoyaltyProgramsTool into the index file.
    import { updateLoyaltyProgramsTool } from './loyalty/updateLoyaltyPrograms.js';
  • Registration of the tool in the allTools array, which is used to populate the toolMap and expose all tools.
    updateLoyaltyProgramsTool,
  • The complete exported tool object definition, serving as the primary handler implementation.
    export const updateLoyaltyProgramsTool: Tool = {
      name: 'updateLoyaltyPrograms',
      description: 'Updates information about the specified loyalty programs',
      inputSchema: {
        type: 'object',
        properties: {
          ChainId: {
            type: 'string',
            description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.'
          },
          LoyaltyProgramUpdates: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' },
                Name: {
                  type: 'object',
                  properties: {
                    Value: { type: 'string', description: 'Name of the loyalty program' }
                  },
                  description: 'Name of the loyalty program (or null if the name should not be updated)'
                },
                Description: {
                  type: 'object',
                  properties: {
                    Value: { type: 'string', description: 'Description of the loyalty program' }
                  },
                  description: 'Description of the loyalty program (or null if the description should not be updated)'
                },
                ExternalIdentifier: {
                  type: 'object',
                  properties: {
                    Value: { type: 'string', description: 'External identifier of the loyalty program' }
                  },
                  description: 'External identifier of the loyalty program (or null if the identifier should not be updated)'
                },
                IsActive: {
                  type: 'object',
                  properties: {
                    Value: { type: 'boolean', description: 'Whether the loyalty program is active' }
                  },
                  description: 'Whether the loyalty program is active (or null if the status should not be updated)'
                }
              },
              required: ['LoyaltyProgramId'],
              additionalProperties: false
            },
            description: 'Loyalty programs to be updated',
            maxItems: 1000
          }
        },
        required: ['LoyaltyProgramUpdates'],
        additionalProperties: false
      },
      
      async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> {
        const result = await mewsRequest(config, '/api/connector/v1/loyaltyPrograms/update', args);
        return {
          content: [{
            type: 'text',
            text: JSON.stringify(result, null, 2)
          }]
        };
      }
    }; 
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 'Updates' implies a mutation operation, the description lacks details on permissions, side effects, error handling, or response format. It doesn't mention the batch capability (up to 1000 items) or the ChainId parameter's conditional requirement, which are critical for correct usage.

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 with zero wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word earns its place by directly stating 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 (a batch update tool with conditional parameters and no output schema) and the lack of annotations, the description is incomplete. It doesn't address behavioral aspects like the batch limit, authentication needs for ChainId, or what the tool returns, leaving significant gaps for the agent to operate correctly.

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 fully documents the two parameters (ChainId and LoyaltyProgramUpdates) and their nested properties. The description adds no additional meaning beyond the schema, such as explaining the update semantics or the null-value handling for optional fields. This meets the baseline score when schema coverage is high.

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 verb ('Updates') and resource ('information about the specified loyalty programs'), providing a specific purpose. However, it doesn't distinguish this tool from sibling tools like 'updateLoyaltyMemberships' or 'updateLoyaltyTiers', which have similar naming patterns and likely operate on related but different resources.

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. It doesn't mention prerequisites, context, or exclusions, such as how it differs from 'addLoyaltyPrograms' or 'deleteLoyaltyPrograms' in the sibling list, leaving the agent to infer usage based on the name alone.

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