Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

get_event_registrations

Retrieve all attendee registrations for a specific event using the event ID. This tool is designed for event organizers to view registration details.

Instructions

Get all registrations for an event. Only available to the event organizer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYesThe ID of the event

Implementation Reference

  • src/index.ts:249-277 (registration)
    Registers the 'get_event_registrations' tool with MCP server, including input schema and handler function.
    server.tool( 'get_event_registrations', 'Get all registrations for an event. Only available to the event organizer.', { event_id: z.number().describe('The ID of the event') }, async ({ event_id }) => { try { const apiClient = getClient(); const registrations = await apiClient.getEventRegistrations(event_id); if (registrations.length === 0) { return { content: [{ type: 'text', text: 'No registrations found for this event.' }] }; } const formatted = registrations.map(formatRegistration).join('\n\n---\n\n'); return { content: [{ type: 'text', text: `Found ${registrations.length} registration(s):\n\n${formatted}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • Handler function that fetches event registrations using apiClient, formats them with formatRegistration, and returns formatted text content or error.
    async ({ event_id }) => { try { const apiClient = getClient(); const registrations = await apiClient.getEventRegistrations(event_id); if (registrations.length === 0) { return { content: [{ type: 'text', text: 'No registrations found for this event.' }] }; } const formatted = registrations.map(formatRegistration).join('\n\n---\n\n'); return { content: [{ type: 'text', text: `Found ${registrations.length} registration(s):\n\n${formatted}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • Input schema for the tool using Zod: requires event_id as number.
    { event_id: z.number().describe('The ID of the event') },
  • API client method that performs HTTP GET to fetch registrations for a specific event from the backend API.
    async getEventRegistrations(eventId: number): Promise<Registration[]> { try { const response: AxiosResponse<Registration[]> = await this.client.get(`/api/events/${eventId}/registrations/`); return response.data; } catch (error) { throw new Error(`Failed to get registrations for event ${eventId}: ${getErrorMessage(error)}`); } }
  • Utility function to format a Registration object into a human-readable string for display in tool responses.
    function formatRegistration(reg: Registration): string { const eventInfo = typeof reg.event === 'object' ? reg.event.title : `Event ID: ${reg.event}`; const userInfo = typeof reg.user === 'object' ? reg.user.username : `User ID: ${reg.user}`; return `Registration (ID: ${reg.id}) Event: ${eventInfo} User: ${userInfo} Status: ${reg.status} Registered at: ${reg.registered_at}`; }

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/NotoriousArnav/EventHorizon-MCP'

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