Skip to main content
Glama

addVouchers

Enables creation of new vouchers, including discount codes and gift certificates, with details like name, code, value, validity period, usage limit, and accounting category, within the Mews hospitality platform.

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 execute handler function that processes the input arguments and makes an HTTP request to the Mews API endpoint '/api/connector/v1/vouchers/add' to add vouchers, returning the result as formatted JSON.
    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 structure for the addVouchers tool input, requiring a 'Vouchers' array of objects with at least 'Name' and 'Code'.
    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 that brings the addVouchersTool into the index for registration.
    import { addVouchersTool } from './vouchers/addVouchers.js';
  • Registration of addVouchersTool in the allTools array, which is used for MCP tool definitions and execution lookup.
    // 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