- Full API client with Basic Auth and OAuth2 support - 40+ tools across 10 categories (appointments, availability, clients, calendars, products, forms, labels, webhooks, coupons, blocks) - 14 interactive React-based MCP apps for rich UI experiences - Comprehensive error handling and pagination - TypeScript implementation with full type definitions - Complete documentation and examples
60 lines
1.8 KiB
TypeScript
60 lines
1.8 KiB
TypeScript
import { z } from 'zod';
|
|
import { AcuityClient } from '../clients/acuity.js';
|
|
|
|
export function createBlocksTools(client: AcuityClient) {
|
|
return {
|
|
acuity_list_blocks: {
|
|
description: 'List time blocks (blocked time slots)',
|
|
inputSchema: z.object({
|
|
calendarID: z.number().optional().describe('Filter by calendar ID'),
|
|
minDate: z.string().optional().describe('Minimum date (YYYY-MM-DD)'),
|
|
maxDate: z.string().optional().describe('Maximum date (YYYY-MM-DD)')
|
|
}),
|
|
handler: async (args: any) => {
|
|
const blocks = await client.listBlocks(args);
|
|
return {
|
|
content: [{
|
|
type: 'text',
|
|
text: JSON.stringify(blocks, null, 2)
|
|
}]
|
|
};
|
|
}
|
|
},
|
|
|
|
acuity_create_block: {
|
|
description: 'Create a new time block to block off time',
|
|
inputSchema: z.object({
|
|
calendarID: z.number().describe('Calendar ID'),
|
|
start: z.string().describe('Start datetime (ISO 8601)'),
|
|
end: z.string().describe('End datetime (ISO 8601)'),
|
|
notes: z.string().optional().describe('Block notes/reason')
|
|
}),
|
|
handler: async (args: any) => {
|
|
const block = await client.createBlock(args);
|
|
return {
|
|
content: [{
|
|
type: 'text',
|
|
text: JSON.stringify(block, null, 2)
|
|
}]
|
|
};
|
|
}
|
|
},
|
|
|
|
acuity_delete_block: {
|
|
description: 'Delete a time block',
|
|
inputSchema: z.object({
|
|
id: z.number().describe('Block ID')
|
|
}),
|
|
handler: async (args: any) => {
|
|
await client.deleteBlock(args.id);
|
|
return {
|
|
content: [{
|
|
type: 'text',
|
|
text: JSON.stringify({ success: true, message: 'Block deleted' })
|
|
}]
|
|
};
|
|
}
|
|
}
|
|
};
|
|
}
|