Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

manage_registration

Approve, waitlist, or cancel event registrations as an organizer to control attendee participation.

Instructions

Manage a registration (approve, waitlist, or cancel). Only available to the event organizer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
registration_idYesThe ID of the registration to manage
actionYesAction to take on the registration

Implementation Reference

  • The asynchronous handler function for the 'manage_registration' MCP tool. It retrieves the API client, calls manageRegistration on it, formats the response using formatRegistration, and returns success or error content.
    async ({ registration_id, action }) => {
      try {
        const apiClient = getClient();
        const registration = await apiClient.manageRegistration(registration_id, action);
        return {
          content: [{ type: 'text', text: `Registration ${action}d successfully!\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 'manage_registration' tool defining parameters: registration_id (number) and action (one of 'approve', 'waitlist', 'cancel').
    {
      registration_id: z.number().describe('The ID of the registration to manage'),
      action: z.enum(['approve', 'waitlist', 'cancel']).describe('Action to take on the registration')
    },
  • src/index.ts:279-300 (registration)
    MCP server.tool registration for the 'manage_registration' tool, specifying name, description, input schema, and handler function.
    server.tool(
      'manage_registration',
      'Manage a registration (approve, waitlist, or cancel). Only available to the event organizer.',
      {
        registration_id: z.number().describe('The ID of the registration to manage'),
        action: z.enum(['approve', 'waitlist', 'cancel']).describe('Action to take on the registration')
      },
      async ({ registration_id, action }) => {
        try {
          const apiClient = getClient();
          const registration = await apiClient.manageRegistration(registration_id, action);
          return {
            content: [{ type: 'text', text: `Registration ${action}d successfully!\n\n${formatRegistration(registration)}` }]
          };
        } catch (error) {
          return {
            content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true
          };
        }
      }
    );
  • Utility function to format Registration data into a readable string for 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}`;
    }
  • EventHorizonClient method that sends POST request to manage a specific registration via the backend API.
    async manageRegistration(registrationId: number, action: 'approve' | 'waitlist' | 'cancel'): Promise<Registration> {
      try {
        const response: AxiosResponse<Registration> = await this.client.post(`/api/registrations/${registrationId}/manage/`, { action });
        return response.data;
      } catch (error) {
        throw new Error(`Failed to manage registration ${registrationId}: ${getErrorMessage(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/NotoriousArnav/EventHorizon-MCP'

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