Skip to main content
Glama

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
NameRequiredDescriptionDefault
guildIdYesThe ID of the server (guild)
eventIdYesThe ID of the event to delete

Implementation Reference

  • 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) }] }; }
  • 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'), },
  • 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) }] }; } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scarecr0w12/discord-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server