get_todays_events
Retrieve all Network School calendar events scheduled for today to stay informed about current activities and opportunities.
Instructions
Get all Network School events happening today
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:170-186 (handler)Main execution logic for the get_todays_events tool: fetches all events, filters to today's events, formats them, and returns as formatted text.case 'get_todays_events': { const response = await lumaClient.fetchEvents(); const todaysEvents = filterTodaysEvents(response.entries); const formatted = formatEventsList( todaysEvents, 'No events scheduled for today.' ); return { content: [ { type: 'text', text: formatted, }, ], }; }
- src/index.ts:45-52 (registration)Registration of the get_todays_events tool in the ListToolsRequestSchema handler, defining name, description, and empty input schema.{ name: 'get_todays_events', description: 'Get all Network School events happening today', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:48-51 (schema)Input schema for get_todays_events tool (no parameters required).inputSchema: { type: 'object', properties: {}, },
- src/formatters.ts:75-80 (helper)Helper function to filter Luma events to only those happening today.export function filterTodaysEvents(entries: LumaEntry[]): LumaEntry[] { return entries.filter(entry => { const startDate = parseISO(entry.event.start_at); return isToday(startDate); }); }
- src/luma-client.ts:16-36 (helper)LumaClient method to fetch all future events from the Luma API, used by the tool handler.async fetchEvents(): Promise<LumaResponse> { try { const response = await axios.get<LumaResponse>(LUMA_API_URL, { headers: { 'Accept': 'application/json', }, }); return response.data; } catch (error) { if (axios.isAxiosError(error)) { const status = error.response?.status; const statusText = error.response?.statusText; throw new Error(`Failed to fetch events from Luma API: ${status ? `${status} ${statusText}` : error.message}`); } if (error instanceof Error) { throw new Error(`Failed to fetch events from Luma API: ${error.message}`); } throw new Error('Failed to fetch events from Luma API: Unknown error'); } }