Skip to main content
Glama
tHeMaskedMan981

Network School Events MCP Server

register_for_event

Register for Network School events by providing event ID, name, and email. Submit contact details to secure your spot in scheduled calendar activities.

Instructions

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

Input Schema

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

Implementation Reference

  • MCP call_tool handler for 'register_for_event': validates input parameters (event_id, name, email, etc.) and delegates registration to LumaClient.registerForEvent, then formats success response.
          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,
                },
              ],
            };
          }
  • src/index.ts:81-112 (registration)
    Registration of the 'register_for_event' tool in the list_tools response, including name, description, and input schema definition.
    {
      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'],
      },
    },
  • Core helper method in LumaClient that implements the event registration logic: verifies event, fetches ticket details if possible, constructs registration request, and calls Luma API 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');
      }
    }
  • TypeScript interface defining the structure of the Luma API registration request (RegisterRequest), used by the registerForEvent helper.
    export interface RegisterRequest {
      name: string;
      first_name: string;
      last_name: string;
      email: string;
      event_api_id: string;
      for_waitlist: boolean;
      payment_method: null;
      payment_currency: null;
      registration_answers: any[];
      coupon_code: null;
      timezone: string;
      token_gate_info: null;
      eth_address_info: null;
      phone_number: string;
      solana_address_info: null;
      expected_amount_cents: number;
      expected_amount_discount: number;
      expected_amount_tax: number;
      currency: null;
      event_invite_api_id: null;
      ticket_type_to_selection: {
        [key: string]: {
          count: number;
          amount: number;
        };
      };
      solana_address: null;
      opened_from: {
        source: string;
        calendar_api_id: 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/tHeMaskedMan981/ns-mcp'

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