Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

unregister_from_event

Remove your registration from an event using its ID. This tool cancels your attendance for the specified event in the EventHorizon platform.

Instructions

Unregister the current user from an event.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYesThe ID of the event to unregister from

Implementation Reference

  • The MCP tool handler function for 'unregister_from_event'. It invokes the API client's unregisterFromEvent method with the provided event_id, handles success by returning a confirmation message, and catches errors to return an error message.
    async ({ event_id }) => { try { const apiClient = getClient(); await apiClient.unregisterFromEvent(event_id); return { content: [{ type: 'text', text: `Successfully unregistered from event ${event_id}.` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • Zod schema defining the input parameter 'event_id' as a number for the unregister_from_event tool.
    { event_id: z.number().describe('The ID of the event to unregister from') },
  • src/index.ts:227-247 (registration)
    Registration of the 'unregister_from_event' tool with the MCP server using server.tool(), specifying name, description, input schema, and inline handler function.
    server.tool( 'unregister_from_event', 'Unregister the current user from an event.', { event_id: z.number().describe('The ID of the event to unregister from') }, async ({ event_id }) => { try { const apiClient = getClient(); await apiClient.unregisterFromEvent(event_id); return { content: [{ type: 'text', text: `Successfully unregistered from event ${event_id}.` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • ApiClient helper method that performs the HTTP DELETE request to the backend API endpoint to unregister the user from the specified event.
    async unregisterFromEvent(eventId: number): Promise<void> { try { await this.client.delete(`/api/events/${eventId}/unregister/`); } catch (error) { throw new Error(`Failed to unregister from event ${eventId}: ${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