Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

create_event

Create new events by specifying title, description, times, location, and capacity for event management on the EventHorizon platform.

Instructions

Create a new event. Requires title, description, start/end times, location, and capacity.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the event
descriptionYesDescription of the event
start_timeYesStart time in ISO 8601 format (e.g., 2024-12-25T10:00:00Z)
end_timeYesEnd time in ISO 8601 format (e.g., 2024-12-25T18:00:00Z)
locationYesLocation of the event
capacityYesMaximum number of attendees

Implementation Reference

  • src/index.ts:108-140 (registration)
    Registers the 'create_event' tool with the MCP server, including Zod input schema, description, and the handler function that delegates to the API client.
    server.tool( 'create_event', 'Create a new event. Requires title, description, start/end times, location, and capacity.', { title: z.string().describe('Title of the event'), description: z.string().describe('Description of the event'), start_time: z.string().describe('Start time in ISO 8601 format (e.g., 2024-12-25T10:00:00Z)'), end_time: z.string().describe('End time in ISO 8601 format (e.g., 2024-12-25T18:00:00Z)'), location: z.string().describe('Location of the event'), capacity: z.number().describe('Maximum number of attendees') }, async ({ title, description, start_time, end_time, location, capacity }) => { try { const apiClient = getClient(); const event = await apiClient.createEvent({ title, description, start_time, end_time, location, capacity }); return { content: [{ type: 'text', text: `Event created successfully!\n\n${formatEvent(event)}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • The underlying API client handler that performs the HTTP POST request to create the event on the EventHorizon backend.
    async createEvent(eventData: EventCreateRequest): Promise<Event> { try { const response: AxiosResponse<Event> = await this.client.post('/api/events/', eventData); return response.data; } catch (error) { throw new Error(`Failed to create event: ${getErrorMessage(error)}`); } }
  • TypeScript interface defining the structure of data required to create an event, used by the API client.
    export interface EventCreateRequest { title: string; description: string; start_time: string; end_time: string; location: string; capacity: number; registration_schema?: Record<string, unknown>[]; }
  • Helper function used by the create_event handler to format the created event for display in the response.
    function formatEvent(event: Event): string { return `Event: ${event.title} (ID: ${event.id}) Description: ${event.description} Location: ${event.location} Start: ${event.start_time} End: ${event.end_time} Capacity: ${event.capacity} Organizer: ${event.organizer.username} Registered: ${event.is_registered ? 'Yes' : 'No'}`; }
  • Lazy-initializes and returns the EventHorizonClient instance, used by all tool handlers including create_event.
    function getClient(): EventHorizonClient { if (!client) { const errors = validateConfig(); if (errors.length > 0) { throw new Error(`Configuration errors: ${errors.join('; ')}`); } client = new EventHorizonClient(); } return client; }

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