Skip to main content
Glama
code-rabi

Mews MCP

by code-rabi

addLoyaltyPrograms

Create new loyalty programs in the Mews hospitality system to reward customer engagement and manage program details like names, descriptions, and activation status.

Instructions

Adds new loyalty programs to the system

Input Schema

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

Implementation Reference

  • The async execute function that implements the core logic of the addLoyaltyPrograms tool by calling the Mews API endpoint to add loyalty programs.
    async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> {
      const result = await mewsRequest(config, '/api/connector/v1/loyaltyPrograms/add', args);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • The inputSchema defining the parameters for the tool: optional ChainId and required LoyaltyPrograms array with up to 1000 items.
    inputSchema: {
      type: 'object',
      properties: {
        ChainId: {
          type: 'string',
          description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.'
        },
        LoyaltyPrograms: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              Name: { type: 'string', description: 'Name of the loyalty program' },
              Description: { type: 'string', description: 'Description of the loyalty program' },
              ExternalIdentifier: { type: 'string', description: 'External identifier of the loyalty program' },
              IsActive: { type: 'boolean', description: 'Whether the loyalty program is active' }
            },
            required: ['Name'],
            additionalProperties: false
          },
          description: 'Array of loyalty program objects to create',
          maxItems: 1000
        }
      },
      required: ['LoyaltyPrograms'],
      additionalProperties: false
    },
  • Import of the addLoyaltyProgramsTool from its implementation file.
    import { addLoyaltyProgramsTool } from './loyalty/addLoyaltyPrograms.js';
  • Inclusion of addLoyaltyProgramsTool in the allTools array, registering it for use in the MCP server.
    addLoyaltyProgramsTool,
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. 'Adds' implies a write/mutation operation, but the description doesn't mention authentication requirements, rate limits, whether duplicates are allowed, what happens on failure, or the response format. This is inadequate for a mutation tool with zero annotation coverage.

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 appropriately sized for a tool with good schema documentation and gets straight to the point without unnecessary elaboration.

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 insufficient. It doesn't explain what 'adding' entails operationally, what validation occurs, whether there are side effects, or what the response contains. The agent lacks crucial context for proper tool invocation.

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 already fully documents both parameters (ChainId and LoyaltyPrograms array). The description doesn't add any parameter-specific information beyond what's in the schema, maintaining the baseline score for high schema coverage.

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 programs'), making the purpose immediately understandable. It distinguishes from deletion/update siblings but doesn't explicitly differentiate from other 'add' tools like addLoyaltyMemberships or addLoyaltyTiers, which would require more specific scope definition.

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?

No guidance is provided about when to use this tool versus alternatives like updateLoyaltyPrograms or getAllLoyaltyPrograms. The description doesn't mention prerequisites, constraints, or typical use cases, leaving the agent to infer usage from the tool 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