Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

delete_event

Remove an event from the EventHorizon platform. This action is restricted to the event organizer and requires the event ID for deletion.

Instructions

Delete an event. Only the organizer can delete their events.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYesThe ID of the event to delete

Implementation Reference

  • The main handler function for the 'delete_event' tool. It retrieves the API client, calls deleteEvent on it with the provided event_id, and returns success or error response.
    async ({ event_id }) => { try { const apiClient = getClient(); await apiClient.deleteEvent(event_id); return { content: [{ type: 'text', text: `Event ${event_id} deleted successfully.` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • Zod schema defining the input parameters for the delete_event tool: event_id as number.
    { event_id: z.number().describe('The ID of the event to delete') },
  • src/index.ts:178-198 (registration)
    Registration of the 'delete_event' tool using server.tool(), including name, description, schema, and handler reference.
    server.tool( 'delete_event', 'Delete an event. Only the organizer can delete their events.', { event_id: z.number().describe('The ID of the event to delete') }, async ({ event_id }) => { try { const apiClient = getClient(); await apiClient.deleteEvent(event_id); return { content: [{ type: 'text', text: `Event ${event_id} deleted successfully.` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • Helper method in EventHorizonClient that performs the actual HTTP DELETE request to delete the event from the API.
    async deleteEvent(eventId: number): Promise<void> { try { await this.client.delete(`/api/events/${eventId}/`); } catch (error) { throw new Error(`Failed to delete 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