Skip to main content
Glama

chargeCreditCard

Process credit card payments to settle customer bills within the Mews hospitality platform. This tool securely charges cards and automatically applies payments to outstanding balances.

Instructions

Charges a credit card and adds the resulting payment to a customer bill

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
CustomerIdYesCustomer ID for the charge
AmountYesCharge amount object
CreditCardDataYesCredit card information
BillIdNoSpecific bill ID to apply charge to
NotesNoCharge notes

Implementation Reference

  • The async execute function that implements the core logic of the chargeCreditCard tool by forwarding input arguments to the Mews API endpoint '/api/connector/v1/payments/chargeCreditCard' via mewsRequest.
    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/payments/chargeCreditCard', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Input schema defining the required and optional parameters for the chargeCreditCard tool, including CustomerId, Amount (with Currency and Value), CreditCardData (with Number, Expiry, Name, optional SecurityCode), optional BillId and Notes.
    inputSchema: { type: 'object', properties: { CustomerId: { type: 'string', description: 'Customer ID for the charge' }, Amount: { type: 'object', properties: { Currency: { type: 'string', description: 'Charge currency code' }, Value: { type: 'number', description: 'Charge amount value' } }, required: ['Currency', 'Value'], description: 'Charge amount object' }, CreditCardData: { type: 'object', properties: { Number: { type: 'string', description: 'Credit card number' }, Expiry: { type: 'string', description: 'Expiry date (MM/YY)' }, Name: { type: 'string', description: 'Cardholder name' }, SecurityCode: { type: 'string', description: 'CVV/CVC code' } }, required: ['Number', 'Expiry', 'Name'], description: 'Credit card information' }, BillId: { type: 'string', description: 'Specific bill ID to apply charge to' }, Notes: { type: 'string', description: 'Charge notes' } }, required: ['CustomerId', 'Amount', 'CreditCardData'], additionalProperties: false },
  • Registration of the chargeCreditCardTool in the central allTools array, which is used to create the tool registry and map for execution.
    addPaymentTool, chargeCreditCardTool, getAllPaymentsTool,

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