Skip to main content
Glama

getAllAvailabilityBlocks

Retrieve all blocked reservations for rates, spaces, or categories in Mews hospitality platform using time-based filters to manage availability constraints.

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
NameRequiredDescriptionDefault
AvailabilityBlockIdsNoFilter by specific availability block IDs
ServiceIdsNoFilter by service IDs
StartUtcYesStart date for search (ISO 8601)
EndUtcYesEnd date for search (ISO 8601)
CollidingUtcNoFind blocks that collide with this time range

Implementation Reference

  • The execute function implementing the core logic of the getAllAvailabilityBlocks tool by calling 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) }] }; }
  • The inputSchema defining the parameters and validation for the tool inputs.
    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 },
  • Registration of the tool in the allTools array for global tool registry.
    // Availability tools getAllAvailabilityBlocksTool,

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