Skip to main content
Glama

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

Implementation Reference

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

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