- 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
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
import { z } from 'zod';
|
|
import { AcuityClient } from '../clients/acuity.js';
|
|
|
|
export function createWebhooksTools(client: AcuityClient) {
|
|
return {
|
|
acuity_list_webhooks: {
|
|
description: 'List all webhooks',
|
|
inputSchema: z.object({}),
|
|
handler: async () => {
|
|
const webhooks = await client.listWebhooks();
|
|
return {
|
|
content: [{
|
|
type: 'text',
|
|
text: JSON.stringify(webhooks, null, 2)
|
|
}]
|
|
};
|
|
}
|
|
},
|
|
|
|
acuity_create_webhook: {
|
|
description: 'Create a new webhook',
|
|
inputSchema: z.object({
|
|
event: z.string().describe('Event type (e.g., appointment.scheduled, appointment.canceled)'),
|
|
url: z.string().url().describe('Webhook URL')
|
|
}),
|
|
handler: async (args: any) => {
|
|
const webhook = await client.createWebhook(args);
|
|
return {
|
|
content: [{
|
|
type: 'text',
|
|
text: JSON.stringify(webhook, null, 2)
|
|
}]
|
|
};
|
|
}
|
|
},
|
|
|
|
acuity_delete_webhook: {
|
|
description: 'Delete a webhook',
|
|
inputSchema: z.object({
|
|
id: z.number().describe('Webhook ID')
|
|
}),
|
|
handler: async (args: any) => {
|
|
await client.deleteWebhook(args.id);
|
|
return {
|
|
content: [{
|
|
type: 'text',
|
|
text: JSON.stringify({ success: true, message: 'Webhook deleted' })
|
|
}]
|
|
};
|
|
}
|
|
}
|
|
};
|
|
}
|