getRatePricing
Retrieve pricing information for specified rates within a given date range to support rate analysis and financial planning in hospitality operations.
Instructions
Returns prices of rates during the specified period
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| RateIds | Yes | Array of rate IDs to get pricing for | |
| StartUtc | Yes | Start date for pricing period (ISO 8601) | |
| EndUtc | Yes | End date for pricing period (ISO 8601) |
Implementation Reference
- src/tools/rates/getRatePricing.ts:5-43 (handler)Full implementation of the 'getRatePricing' tool, including the execute handler that performs an HTTP request to the Mews API endpoint '/api/connector/v1/rates/getPricing' with the provided arguments.export const getRatePricingTool: Tool = { name: 'getRatePricing', description: 'Returns prices of rates during the specified period', inputSchema: { type: 'object', properties: { RateIds: { type: 'array', items: { type: 'string' }, description: 'Array of rate IDs to get pricing for', maxItems: 1000 }, StartUtc: { type: 'string', description: 'Start date for pricing period (ISO 8601)' }, EndUtc: { type: 'string', description: 'End date for pricing period (ISO 8601)' } }, required: ['RateIds', 'StartUtc', 'EndUtc'], additionalProperties: false }, 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/rates/getPricing', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Input schema validation for the getRatePricing tool, requiring RateIds array, StartUtc, and EndUtc.inputSchema: { type: 'object', properties: { RateIds: { type: 'array', items: { type: 'string' }, description: 'Array of rate IDs to get pricing for', maxItems: 1000 }, StartUtc: { type: 'string', description: 'Start date for pricing period (ISO 8601)' }, EndUtc: { type: 'string', description: 'End date for pricing period (ISO 8601)' } }, required: ['RateIds', 'StartUtc', 'EndUtc'], additionalProperties: false },
- src/tools/index.ts:55-56 (registration)Import of the getRatePricingTool for registration in the tools index.import { getAllRatesTool } from './rates/getAllRates.js'; import { getRatePricingTool } from './rates/getRatePricing.js';
- src/tools/index.ts:139-141 (registration)Registration of getRatePricingTool in the central allTools array used for toolMap and definitions.// Rates tools getAllRatesTool, getRatePricingTool,