Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

get_my_hosted_events

Retrieve all events you have organized on the EventHorizon platform to manage and review your hosted activities.

Instructions

Get all events organized by the current user.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP server tool registration and handler implementation for 'get_my_hosted_events'. Fetches user's hosted events using the API client, formats them with formatEvent, and returns formatted text content or error.
    server.tool( 'get_my_hosted_events', 'Get all events organized by the current user.', {}, async () => { try { const apiClient = getClient(); const events = await apiClient.getUserHostedEvents(); if (events.length === 0) { return { content: [{ type: 'text', text: 'You are not organizing any events.' }] }; } const formatted = events.map(formatEvent).join('\n\n---\n\n'); return { content: [{ type: 'text', text: `You are organizing ${events.length} event(s):\n\n${formatted}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • API client method that performs the HTTP GET request to '/api/events/' with organizer='me' parameter to retrieve events hosted by the current user.
    async getUserHostedEvents(): Promise<Event[]> { try { const response: AxiosResponse<Event[]> = await this.client.get('/api/events/', { params: { organizer: 'me' } }); return response.data; } catch (error) { throw new Error(`Failed to get user hosted events: ${getErrorMessage(error)}`); } }
  • Helper function to format an individual Event object into a readable string for tool output.
    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'}`; }
  • TypeScript interface defining the structure of an Event object used throughout the codebase.
    export interface Event { id: number; title: string; slug: string; description: string; start_time: string; end_time: string; location: string; capacity: number; organizer: User; registration_schema: Record<string, unknown>[]; is_registered: boolean; created_at: string; updated_at: string; }
  • Lazy-initializes and returns the shared EventHorizonClient instance used by all tools.
    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