unregister_from_event
Remove your registration from a specific event in the EventHorizon platform by providing the event ID.
Instructions
Unregister the current user from an event.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event_id | Yes | The ID of the event to unregister from |
Implementation Reference
- src/index.ts:227-247 (handler)MCP tool registration and inline handler function for 'unregister_from_event'. This is the primary implementation that gets the API client, calls unregisterFromEvent, and formats the response.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 }; } } );
- src/index.ts:230-232 (schema)Zod schema defining the input parameter 'event_id' for the tool.{ event_id: z.number().describe('The ID of the event to unregister from') },
- src/api-client.ts:165-171 (helper)Helper method in EventHorizonClient that performs the actual API DELETE request to unregister the user from the 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)}`); } }