getAllSpaceCategories
Retrieve all space categories for a service using filters like specific category IDs or update date ranges, ensuring precise data access in Mews MCP server operations.
Instructions
Returns all space categories of a service
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ServiceIds | Yes | Filter by service IDs | |
| SpaceCategoryIds | No | Filter by specific category IDs | |
| UpdatedUtc | No | Date range filter for category updates |
Implementation Reference
- The execute function implementing the core logic of the getAllSpaceCategories tool. It constructs request data from input args and calls the Mews API endpoint '/api/connector/v1/spaceCategories/getAll' using mewsRequest utility.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/spaceCategories/getAll', requestData); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- The inputSchema defining the expected input parameters for the tool, requiring ServiceIds array and optionally filtering by SpaceCategoryIds or UpdatedUtc range.inputSchema: { type: 'object', properties: { ServiceIds: { type: 'array', items: { type: 'string' }, description: 'Filter by service IDs', maxItems: 1000 }, SpaceCategoryIds: { type: 'array', items: { type: 'string' }, description: 'Filter by specific category IDs', maxItems: 1000 }, UpdatedUtc: { type: 'object', properties: { StartUtc: { type: 'string', description: 'Start of update date range (ISO 8601)' }, EndUtc: { type: 'string', description: 'End of update date range (ISO 8601)' } }, description: 'Date range filter for category updates' } }, required: ['ServiceIds'], additionalProperties: false },
- src/tools/index.ts:130-134 (registration)Registration of the getAllSpaceCategoriesTool in the allTools array exported from index.ts, making it available for MCP server registration and execution.// Services tools getAllServicesTool, getAllSpacesTool, getAllSpaceCategoriesTool,
- src/tools/index.ts:48-48 (registration)Import statement bringing the getAllSpaceCategoriesTool into the index.ts registry file.import { getAllSpaceCategoriesTool } from './services/getAllSpaceCategories.js';