Skip to main content
Glama

addVouchers

Create discount codes and gift certificates in the Mews hospitality platform to manage promotional offers and customer incentives.

Instructions

Adds new vouchers (discount codes, gift certificates) to the system

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
VouchersYesArray of voucher objects to create

Implementation Reference

  • The asynchronous execute function implementing the core logic of the addVouchers tool. It constructs the request data from input arguments and calls the mewsRequest utility to POST to the '/api/connector/v1/vouchers/add' endpoint.
    async execute(config: MewsAuthConfig, args: unknown): Promise<ToolResult> { const inputArgs = args as Record<string, unknown>; const requestData = { ...inputArgs }; const result = await mewsRequest(config, '/api/connector/v1/vouchers/add', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • The inputSchema defining the expected input structure for the addVouchers tool, specifying an array of Vouchers with required fields Name and Code, and optional fields like Value, validity dates, usage limits, etc.
    inputSchema: { type: 'object', properties: { Vouchers: { type: 'array', items: { type: 'object', properties: { Name: { type: 'string', description: 'Voucher name' }, Code: { type: 'string', description: 'Voucher code' }, Value: { type: 'object', properties: { Currency: { type: 'string', description: 'Voucher currency' }, Amount: { type: 'number', description: 'Voucher amount' } }, description: 'Voucher value' }, ValidityStartUtc: { type: 'string', description: 'Voucher validity start (ISO 8601)' }, ValidityEndUtc: { type: 'string', description: 'Voucher validity end (ISO 8601)' }, UsageLimit: { type: 'number', description: 'Maximum number of uses' }, Type: { type: 'string', description: 'Voucher type' }, AccountingCategoryId: { type: 'string', description: 'Accounting category for voucher' } }, required: ['Name', 'Code'] }, description: 'Array of voucher objects to create' } }, required: ['Vouchers'], additionalProperties: false },
  • Import statement bringing the addVouchersTool into the central index file.
    import { addVouchersTool } from './vouchers/addVouchers.js';
  • The addVouchersTool is added to the allTools array, which collects and exports all available tools for registration and execution.
    // Voucher tools addVouchersTool,

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