mcpengine/servers/clickup/src/tools/webhooks-tools.ts
Jake Shore 8e9d1ffb87 calendly: Complete MCP server with 27 tools and 12 React apps
- Calendly API v2 client with auth, pagination, error handling
- 27 MCP tools across 6 categories (events, event types, scheduling, users, orgs, webhooks)
- 12 React MCP apps with dark theme and client-side state
- Both stdio and HTTP modes supported
- Full TypeScript types and documentation
2026-02-12 17:08:15 -05:00

70 lines
2.4 KiB
TypeScript

/**
* ClickUp Webhooks Tools
*/
import { z } from 'zod';
import type { ClickUpClient } from '../clients/clickup.js';
export function createWebhooksTools(client: ClickUpClient) {
return [
{
name: 'clickup_webhooks_list',
description: 'List all webhooks in a team',
inputSchema: z.object({
team_id: z.string().describe('Team ID'),
}),
handler: async (args: any) => {
const response = await client.getWebhooks(args.team_id);
return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] };
}
},
{
name: 'clickup_webhooks_create',
description: 'Create a webhook',
inputSchema: z.object({
team_id: z.string().describe('Team ID'),
endpoint: z.string().describe('Webhook endpoint URL'),
events: z.array(z.string()).describe('Event types (e.g., taskCreated, taskUpdated, taskDeleted)'),
space_id: z.string().optional().describe('Filter to space ID'),
folder_id: z.string().optional().describe('Filter to folder ID'),
list_id: z.string().optional().describe('Filter to list ID'),
task_id: z.string().optional().describe('Filter to task ID'),
}),
handler: async (args: any) => {
const { team_id, ...data } = args;
const response = await client.createWebhook(team_id, data);
return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] };
}
},
{
name: 'clickup_webhooks_update',
description: 'Update a webhook',
inputSchema: z.object({
webhook_id: z.string().describe('Webhook ID'),
endpoint: z.string().optional().describe('Webhook endpoint URL'),
events: z.array(z.string()).optional().describe('Event types'),
status: z.string().optional().describe('Status (active, disabled)'),
}),
handler: async (args: any) => {
const { webhook_id, ...data } = args;
const response = await client.updateWebhook(webhook_id, data);
return { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] };
}
},
{
name: 'clickup_webhooks_delete',
description: 'Delete a webhook',
inputSchema: z.object({
webhook_id: z.string().describe('Webhook ID'),
}),
handler: async (args: any) => {
await client.deleteWebhook(args.webhook_id);
return { content: [{ type: 'text', text: 'Webhook deleted successfully' }] };
}
},
];
}