Skip to main content
Glama
NotoriousArnav

EventHorizon MCP Server

update_event

Modify event details such as title, time, location, or capacity by providing only the fields you need to change.

Instructions

Update an existing event. Only provide the fields you want to change.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYesThe ID of the event to update
titleNoNew title for the event
descriptionNoNew description for the event
start_timeNoNew start time in ISO 8601 format
end_timeNoNew end time in ISO 8601 format
locationNoNew location for the event
capacityNoNew capacity for the event

Implementation Reference

  • src/index.ts:142-176 (registration)
    Full registration of the 'update_event' MCP tool, including name, description, input schema, and handler function.
    server.tool( 'update_event', 'Update an existing event. Only provide the fields you want to change.', { event_id: z.number().describe('The ID of the event to update'), title: z.string().optional().describe('New title for the event'), description: z.string().optional().describe('New description for the event'), start_time: z.string().optional().describe('New start time in ISO 8601 format'), end_time: z.string().optional().describe('New end time in ISO 8601 format'), location: z.string().optional().describe('New location for the event'), capacity: z.number().optional().describe('New capacity for the event') }, async ({ event_id, title, description, start_time, end_time, location, capacity }) => { try { const apiClient = getClient(); const updateData: Record<string, unknown> = {}; if (title !== undefined) updateData.title = title; if (description !== undefined) updateData.description = description; if (start_time !== undefined) updateData.start_time = start_time; if (end_time !== undefined) updateData.end_time = end_time; if (location !== undefined) updateData.location = location; if (capacity !== undefined) updateData.capacity = capacity; const event = await apiClient.updateEvent(event_id, updateData); return { content: [{ type: 'text', text: `Event updated successfully!\n\n${formatEvent(event)}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
  • The handler function for the 'update_event' tool. It constructs a partial update object from provided parameters and calls the apiClient.updateEvent method, returning formatted success or error response.
    async ({ event_id, title, description, start_time, end_time, location, capacity }) => { try { const apiClient = getClient(); const updateData: Record<string, unknown> = {}; if (title !== undefined) updateData.title = title; if (description !== undefined) updateData.description = description; if (start_time !== undefined) updateData.start_time = start_time; if (end_time !== undefined) updateData.end_time = end_time; if (location !== undefined) updateData.location = location; if (capacity !== undefined) updateData.capacity = capacity; const event = await apiClient.updateEvent(event_id, updateData); return { content: [{ type: 'text', text: `Event updated successfully!\n\n${formatEvent(event)}` }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } }
  • Zod input schema defining parameters for the 'update_event' tool.
    { event_id: z.number().describe('The ID of the event to update'), title: z.string().optional().describe('New title for the event'), description: z.string().optional().describe('New description for the event'), start_time: z.string().optional().describe('New start time in ISO 8601 format'), end_time: z.string().optional().describe('New end time in ISO 8601 format'), location: z.string().optional().describe('New location for the event'), capacity: z.number().optional().describe('New capacity for the event') },
  • API client helper method 'updateEvent' that performs the HTTP PUT request to update an event via the EventHorizon API.
    async updateEvent(eventId: number, eventData: Partial<EventCreateRequest>): Promise<Event> { try { const response: AxiosResponse<Event> = await this.client.put(`/api/events/${eventId}/`, eventData); return response.data; } catch (error) { throw new Error(`Failed to update 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