Skip to main content
Glama
code-rabi

Mews MCP

by code-rabi

addLoyaltyTiers

Create new loyalty tiers in Mews to structure customer reward programs with defined levels, benefits, and point requirements.

Instructions

Adds new loyalty tiers to the system

Input Schema

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

Implementation Reference

  • The execute function of the addLoyaltyTiersTool that performs the HTTP request to the /api/connector/v1/loyaltyTiers/add endpoint.
    async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> {
      const result = await mewsRequest(config, '/api/connector/v1/loyaltyTiers/add', args);
      return {
        content: [{
          type: 'text',
          text: JSON.stringify(result, null, 2)
        }]
      };
    }
  • The inputSchema defining the parameters for adding loyalty tiers, including optional ChainId and required array of LoyaltyTiers.
    inputSchema: {
      type: 'object',
      properties: {
        ChainId: {
          type: 'string',
          description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.'
        },
        LoyaltyTiers: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' },
              Name: { type: 'string', description: 'Name of the loyalty tier' },
              Description: { type: 'string', description: 'Description of the loyalty tier' },
              Level: { type: 'number', description: 'Level of the loyalty tier (lower numbers = lower tiers)' },
              MinimumPointsRequired: { type: 'number', description: 'Minimum points required to reach this tier' },
              BenefitDescription: { type: 'string', description: 'Description of the benefits for this tier' },
              IsActive: { type: 'boolean', description: 'Whether the loyalty tier is active' }
            },
            required: ['LoyaltyProgramId', 'Name'],
            additionalProperties: false
          },
          description: 'Array of loyalty tier objects to create',
          maxItems: 1000
        }
      },
      required: ['LoyaltyTiers'],
      additionalProperties: false
    },
  • Import of the addLoyaltyTiersTool.
    import { addLoyaltyTiersTool } from './loyalty/addLoyaltyTiers.js';
  • Inclusion of addLoyaltyTiersTool in the allTools array for registration.
    addLoyaltyTiersTool,
  • Full tool definition including name, description, schema, and handler.
    export const addLoyaltyTiersTool: Tool = {
      name: 'addLoyaltyTiers',
      description: 'Adds new loyalty tiers to the system',
      inputSchema: {
        type: 'object',
        properties: {
          ChainId: {
            type: 'string',
            description: 'Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.'
          },
          LoyaltyTiers: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                LoyaltyProgramId: { type: 'string', description: 'Unique identifier of the loyalty program' },
                Name: { type: 'string', description: 'Name of the loyalty tier' },
                Description: { type: 'string', description: 'Description of the loyalty tier' },
                Level: { type: 'number', description: 'Level of the loyalty tier (lower numbers = lower tiers)' },
                MinimumPointsRequired: { type: 'number', description: 'Minimum points required to reach this tier' },
                BenefitDescription: { type: 'string', description: 'Description of the benefits for this tier' },
                IsActive: { type: 'boolean', description: 'Whether the loyalty tier is active' }
              },
              required: ['LoyaltyProgramId', 'Name'],
              additionalProperties: false
            },
            description: 'Array of loyalty tier objects to create',
            maxItems: 1000
          }
        },
        required: ['LoyaltyTiers'],
        additionalProperties: false
      },
      
      async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> {
        const result = await mewsRequest(config, '/api/connector/v1/loyaltyTiers/add', 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?

With no annotations provided, the description carries the full burden of behavioral disclosure. While 'Adds new loyalty tiers' implies a write operation, it lacks crucial behavioral details: what permissions are required, whether this is idempotent, what happens if tiers conflict, what the response looks like, or any rate limits. For a mutation tool with zero annotation coverage, this is inadequate.

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 no 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 'success' looks like, what gets returned, error conditions, or behavioral constraints. The schema covers parameter details well, but the overall tool behavior remains opaque to an AI agent trying to use it effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 already documents both parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema, but with complete schema coverage and only 2 parameters, a baseline of 3 is appropriate. The description's clarity about the tool's purpose slightly enhances understanding of how parameters relate to that purpose.

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

Purpose3/5

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

The description 'Adds new loyalty tiers to the system' clearly states the action (adds) and resource (loyalty tiers), making the purpose understandable. However, it lacks specificity about what 'loyalty tiers' are in this context and doesn't distinguish this tool from sibling tools like 'addLoyaltyPrograms' or 'addLoyaltyMemberships' beyond the resource name.

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. There are multiple sibling tools related to loyalty systems (addLoyaltyPrograms, addLoyaltyMemberships, updateLoyaltyTiers, deleteLoyaltyTiers), but the description offers no context about when this specific tool is appropriate versus those others.

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