get_event_info
Retrieve detailed information about scheduled Discord events by providing server and event IDs.
Instructions
Get detailed information about 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 |
Implementation Reference
- src/tools/event-tools.ts:57-88 (handler)The main handler function that fetches detailed scheduled event information from Discord API, formats it, handles errors, and returns JSON response.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); return { id: event.id, name: event.name, description: event.description, scheduledStartTime: event.scheduledStartAt?.toISOString(), scheduledEndTime: event.scheduledEndAt?.toISOString(), privacyLevel: GuildScheduledEventPrivacyLevel[event.privacyLevel], status: GuildScheduledEventStatus[event.status], entityType: GuildScheduledEventEntityType[event.entityType], entityId: event.entityId, channelId: event.channelId, creatorId: event.creatorId, creator: event.creator ? { id: event.creator.id, username: event.creator.username } : null, userCount: event.userCount, location: event.entityMetadata?.location, image: event.coverImageURL(), url: event.url, }; }); 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:53-56 (schema)Zod input schema defining parameters guildId and eventId for the get_event_info tool.{ guildId: z.string().describe('The ID of the server (guild)'), eventId: z.string().describe('The ID of the event'), },
- src/tools/event-tools.ts:50-89 (registration)MCP server.tool registration for 'get_event_info' tool, specifying name, description, input schema, and handler.server.tool( 'get_event_info', 'Get detailed information about a scheduled event', { guildId: z.string().describe('The ID of the server (guild)'), eventId: z.string().describe('The ID of the event'), }, 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); return { id: event.id, name: event.name, description: event.description, scheduledStartTime: event.scheduledStartAt?.toISOString(), scheduledEndTime: event.scheduledEndAt?.toISOString(), privacyLevel: GuildScheduledEventPrivacyLevel[event.privacyLevel], status: GuildScheduledEventStatus[event.status], entityType: GuildScheduledEventEntityType[event.entityType], entityId: event.entityId, channelId: event.channelId, creatorId: event.creatorId, creator: event.creator ? { id: event.creator.id, username: event.creator.username } : null, userCount: event.userCount, location: event.entityMetadata?.location, image: event.coverImageURL(), url: event.url, }; }); if (!result.success) { return { content: [{ type: 'text', text: result.error }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] }; } );
- src/index.ts:62-62 (registration)Invocation of registerEventTools in the main MCP server setup, which registers the get_event_info tool among others.registerEventTools(server);