delete_event
Remove scheduled Discord events by specifying server and event IDs to manage server activities.
Instructions
Delete a scheduled event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| guildId | Yes | The ID of the server (guild) | |
| eventId | Yes | The ID of the event to delete |
Implementation Reference
- src/tools/event-tools.ts:226-243 (handler)The handler function that performs the actual deletion of the Discord scheduled event using the Discord.js API, wrapped in error handling.async ({ guildId, eventId }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const guild = await client.guilds.fetch(guildId); const event = await guild.scheduledEvents.fetch(eventId); const eventName = event.name; await event.delete(); return { eventId, eventName, message: 'Event deleted successfully' }; }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; }
- src/tools/event-tools.ts:222-225 (schema)Zod schema defining the input parameters: guildId and eventId.{ guildId: z.string().describe('The ID of the server (guild)'), eventId: z.string().describe('The ID of the event to delete'), },
- src/tools/event-tools.ts:220-244 (registration)The server.tool() call that registers the delete_event tool with the MCP server, including name, description, schema, and handler.'delete_event', 'Delete a scheduled event', { guildId: z.string().describe('The ID of the server (guild)'), eventId: z.string().describe('The ID of the event to delete'), }, async ({ guildId, eventId }) => { const result = await withErrorHandling(async () => { const client = await getDiscordClient(); const guild = await client.guilds.fetch(guildId); const event = await guild.scheduledEvents.fetch(eventId); const eventName = event.name; await event.delete(); return { eventId, eventName, message: 'Event deleted successfully' }; }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; } );