Skip to main content
Glama

register_for_event

Register for Network School events by providing event ID, name, and email to secure your spot in upcoming educational sessions and workshops.

Instructions

Register for a Network School event using the event ID from the event listing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
emailYesEmail address for registration
event_idYesThe event API ID (e.g., evt-xxx) from the event listing
nameYesFull name for registration
phone_numberNoPhone number (optional)
timezoneNoTimezone (default: Asia/Kuala_Lumpur)Asia/Kuala_Lumpur

Implementation Reference

  • MCP tool handler for 'register_for_event': validates input parameters (event_id, name, email), calls LumaClient.registerForEvent, and returns formatted registration success message.
    case 'register_for_event': { const eventId = args?.event_id as string; const name = args?.name as string; const email = args?.email as string; const phoneNumber = (args?.phone_number as string) || ''; const timezone = (args?.timezone as string) || 'Asia/Kuala_Lumpur'; if (!eventId || typeof eventId !== 'string') { return { content: [ { type: 'text', text: 'Error: event_id parameter is required and must be a string', }, ], isError: true, }; } if (!name || typeof name !== 'string') { return { content: [ { type: 'text', text: 'Error: name parameter is required and must be a string', }, ], isError: true, }; } if (!email || typeof email !== 'string') { return { content: [ { type: 'text', text: 'Error: email parameter is required and must be a string', }, ], isError: true, }; } const registration = await lumaClient.registerForEvent( eventId, name, email, phoneNumber, timezone ); const successMessage = `✅ Successfully registered for the event! Registration Details: - Name: ${name} - Email: ${registration.email} - Status: ${registration.approval_status} - Ticket Key: ${registration.ticket_key} - RSVP ID: ${registration.rsvp_api_id} ${registration.event_tickets.length > 0 ? `Ticket Type: ${registration.event_tickets[0].event_ticket_type_info.name} (${registration.event_tickets[0].event_ticket_type_info.type})` : ''} You should receive a confirmation email at ${registration.email}.`; return { content: [ { type: 'text', text: successMessage, }, ], }; }
  • Input schema for the 'register_for_event' tool, defining parameters, types, descriptions, defaults, and required fields.
    inputSchema: { type: 'object', properties: { event_id: { type: 'string', description: 'The event API ID (e.g., evt-xxx) from the event listing', }, name: { type: 'string', description: 'Full name for registration', }, email: { type: 'string', description: 'Email address for registration', }, phone_number: { type: 'string', description: 'Phone number (optional)', default: '', }, timezone: { type: 'string', description: 'Timezone (default: Asia/Kuala_Lumpur)', default: 'Asia/Kuala_Lumpur', }, }, required: ['event_id', 'name', 'email'], },
  • src/index.ts:81-112 (registration)
    Tool registration entry for 'register_for_event' in the list_tools response, including name, description, and input schema.
    { name: 'register_for_event', description: 'Register for a Network School event using the event ID from the event listing', inputSchema: { type: 'object', properties: { event_id: { type: 'string', description: 'The event API ID (e.g., evt-xxx) from the event listing', }, name: { type: 'string', description: 'Full name for registration', }, email: { type: 'string', description: 'Email address for registration', }, phone_number: { type: 'string', description: 'Phone number (optional)', default: '', }, timezone: { type: 'string', description: 'Timezone (default: Asia/Kuala_Lumpur)', default: 'Asia/Kuala_Lumpur', }, }, required: ['event_id', 'name', 'email'], }, },
  • Helper function LumaClient.registerForEvent that performs the actual API registration: verifies event, fetches ticket details, constructs registration payload, and calls Luma register endpoint.
    async registerForEvent( eventApiId: string, name: string, email: string, phoneNumber: string = '', timezone: string = 'Asia/Kuala_Lumpur' ): Promise<RegistrationResponse> { try { // First, fetch the event to verify it exists const events = await this.fetchEvents(); const eventEntry = events.entries.find(e => e.event.api_id === eventApiId); if (!eventEntry) { throw new Error(`Event with ID ${eventApiId} not found`); } // Try to get event details to find ticket types let ticketTypeSelection: { [key: string]: { count: number; amount: number } } = {}; try { const eventDetails = await this.getEventDetails(eventApiId); // Extract ticket types from event details if (eventDetails.event && eventDetails.event.event_ticket_types) { const ticketTypes = eventDetails.event.event_ticket_types; // Use the first available ticket type (typically "Standard" for free events) if (ticketTypes.length > 0) { const firstTicketType = ticketTypes[0]; ticketTypeSelection[firstTicketType.api_id] = { count: 1, amount: firstTicketType.cents || 0 }; } } } catch (detailsError) { // If we can't get ticket details, we'll try without it console.error('Could not fetch event details, attempting registration without ticket type info'); } const registrationData: Partial<RegisterRequest> = { name, first_name: '', last_name: '', email, event_api_id: eventApiId, for_waitlist: false, payment_method: null, payment_currency: null, registration_answers: [], coupon_code: null, timezone, token_gate_info: null, eth_address_info: null, phone_number: phoneNumber, solana_address_info: null, expected_amount_cents: 0, expected_amount_discount: 0, expected_amount_tax: 0, currency: null, event_invite_api_id: null, ticket_type_to_selection: ticketTypeSelection, solana_address: null, opened_from: { source: 'calendar', calendar_api_id: CALENDAR_API_ID, }, }; const response = await axios.post<RegistrationResponse>( LUMA_REGISTER_URL, registrationData, { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', }, } ); return response.data; } catch (error) { if (axios.isAxiosError(error)) { const status = error.response?.status; const statusText = error.response?.statusText; const errorData = error.response?.data; throw new Error( `Failed to register for event: ${status ? `${status} ${statusText}` : error.message}${ errorData ? ` - ${JSON.stringify(errorData)}` : '' }` ); } if (error instanceof Error) { throw new Error(`Failed to register for event: ${error.message}`); } throw new Error('Failed to register for event: Unknown error'); } }

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/tHeMaskedMan981/ns-mcp'

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