Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

register_for_event

Register users for events in the EventHorizon platform by providing event ID and optional form answers.

Instructions

Register the current user for an event.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYesThe ID of the event to register for
answersNoAnswers to registration form questions (if any)

Implementation Reference

  • MCP tool handler for 'register_for_event': calls apiClient to register and formats response.
    async ({ event_id, answers }) => { try { const apiClient = getClient(); const registration = await apiClient.registerForEvent(event_id, answers || {}); return { content: [{ type: 'text', text: `Successfully registered!\n\n${formatRegistration(registration)}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • src/index.ts:204-225 (registration)
    Registration of the 'register_for_event' tool with MCP server, including name, description, schema, and handler.
    server.tool( 'register_for_event', 'Register the current user for an event.', { event_id: z.number().describe('The ID of the event to register for'), answers: z.record(z.unknown()).optional().describe('Answers to registration form questions (if any)') }, async ({ event_id, answers }) => { try { const apiClient = getClient(); const registration = await apiClient.registerForEvent(event_id, answers || {}); return { content: [{ type: 'text', text: `Successfully registered!\n\n${formatRegistration(registration)}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • Zod input schema for the tool parameters: event_id (required number) and answers (optional record).
    { event_id: z.number().describe('The ID of the event to register for'), answers: z.record(z.unknown()).optional().describe('Answers to registration form questions (if any)') },
  • Core API client method implementing the registration via HTTP POST to the backend API.
    async registerForEvent(eventId: number, answers: Record<string, unknown> = {}): Promise<Registration> { try { const response: AxiosResponse<Registration> = await this.client.post(`/api/events/${eventId}/register/`, { answers }); return response.data; } catch (error) { throw new Error(`Failed to register for event ${eventId}: ${getErrorMessage(error)}`); } }
  • TypeScript interface defining the Registration response structure.
    export interface Registration { id: number; event: Event | number; user: User | number; status: 'pending' | 'approved' | 'waitlisted' | 'cancelled'; answers: Record<string, unknown>; registered_at: string; updated_at: string; }

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