getAllAvailabilityBlocks
Fetch all availability blocks for reservations in Mews MCP by applying filters such as date ranges, IDs, or collision intervals. Supports rate, space, and category blocks with a maximum time span of 100 hours.
Instructions
Returns all availability blocks (reservations blocked by rate, space category, or space) based on filter parameters. Note: At least one filter must be provided (CreatedUtc, UpdatedUtc, CollidingUtc, AvailabilityBlockIds, or ExternalIdentifiers). The time interval must not exceed 100 hours.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| AvailabilityBlockIds | No | Filter by specific availability block IDs | |
| CollidingUtc | No | Find blocks that collide with this time range | |
| EndUtc | Yes | End date for search (ISO 8601) | |
| ServiceIds | No | Filter by service IDs | |
| StartUtc | Yes | Start date for search (ISO 8601) |
Implementation Reference
- The async execute function implementing the core tool logic: constructs request data from args and calls mewsRequest to fetch availability blocks from the Mews API endpoint '/api/connector/v1/availabilityBlocks/getAll'.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/availabilityBlocks/getAll', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- Input schema defining the parameters for the getAllAvailabilityBlocks tool, including filters like AvailabilityBlockIds, ServiceIds, time ranges, and collision detection.inputSchema: { type: 'object', properties: { AvailabilityBlockIds: { type: 'array', items: { type: 'string' }, description: 'Filter by specific availability block IDs', maxItems: 1000 }, ServiceIds: { type: 'array', items: { type: 'string' }, description: 'Filter by service IDs', maxItems: 1000 }, StartUtc: { type: 'string', description: 'Start date for search (ISO 8601)' }, EndUtc: { type: 'string', description: 'End date for search (ISO 8601)' }, CollidingUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of collision range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of collision range (ISO 8601)' } }, description: 'Find blocks that collide with this time range' } }, required: ['StartUtc', 'EndUtc'], additionalProperties: false },
- src/tools/index.ts:63-63 (registration)Import statement bringing the getAllAvailabilityBlocksTool into the central tools index.import { getAllAvailabilityBlocksTool } from './availability/getAllAvailabilityBlocks.js';
- src/tools/index.ts:148-148 (registration)Inclusion of getAllAvailabilityBlocksTool in the allTools export array, registering it for use in the MCP server.getAllAvailabilityBlocksTool,