Skip to main content
Glama

get_upcoming_events

Retrieve upcoming Network School calendar events for the next specified days to help users plan and stay informed about available activities.

Instructions

Get Network School events happening in the next N days

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoNumber of days to look ahead (default: 7)

Implementation Reference

  • Handler logic for 'get_upcoming_events' tool: validates input days, fetches events via LumaClient, filters upcoming events using filterUpcomingEvents, formats the list, and returns formatted text response.
    case 'get_upcoming_events': { const days = (args?.days as number) || 7; if (typeof days !== 'number' || days < 1) { return { content: [ { type: 'text', text: 'Error: days parameter must be a positive number', }, ], isError: true, }; } const response = await lumaClient.fetchEvents(); const upcomingEvents = filterUpcomingEvents(response.entries, days); const formatted = formatEventsList( upcomingEvents, `No events scheduled in the next ${days} day${days !== 1 ? 's' : ''}.` ); return { content: [ { type: 'text', text: formatted, }, ], }; }
  • src/index.ts:53-66 (registration)
    Registration of the 'get_upcoming_events' tool in the list_tools handler, including name, description, and input schema definition.
    { name: 'get_upcoming_events', description: 'Get Network School events happening in the next N days', inputSchema: { type: 'object', properties: { days: { type: 'number', description: 'Number of days to look ahead (default: 7)', default: 7, }, }, }, },
  • Input schema definition for the 'get_upcoming_events' tool, specifying the 'days' parameter.
    inputSchema: { type: 'object', properties: { days: { type: 'number', description: 'Number of days to look ahead (default: 7)', default: 7, }, }, },
  • Helper function filterUpcomingEvents that filters Luma events starting within the next N days, used in the tool handler.
    export function filterUpcomingEvents(entries: LumaEntry[], days: number): LumaEntry[] { const now = new Date(); const futureDate = addDays(now, days); return entries.filter(entry => { const startDate = parseISO(entry.event.start_at); return isWithinInterval(startDate, { start: startOfDay(now), end: endOfDay(futureDate) }); }); }
  • Helper function formatEventsList that formats a list of events into a readable string, used in the tool handler.
    export function formatEventsList(entries: LumaEntry[], emptyMessage: string = 'No events found.'): string { if (entries.length === 0) { return emptyMessage; } return entries.map(entry => formatEvent(entry)).join('\n\n'); }

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/tHeMaskedMan981/ns-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server