Skip to main content
Glama

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
NameRequiredDescriptionDefault
AvailabilityBlockIdsNoFilter by specific availability block IDs
CollidingUtcNoFind blocks that collide with this time range
EndUtcYesEnd date for search (ISO 8601)
ServiceIdsNoFilter by service IDs
StartUtcYesStart 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 },
  • Import statement bringing the getAllAvailabilityBlocksTool into the central tools index.
    import { getAllAvailabilityBlocksTool } from './availability/getAllAvailabilityBlocks.js';
  • Inclusion of getAllAvailabilityBlocksTool in the allTools export array, registering it for use in the MCP server.
    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