search_events
Find Network School calendar events by searching event names and descriptions to discover relevant activities and opportunities.
Instructions
Search Network School events by name or description
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string |
Implementation Reference
- src/index.ts:220-250 (handler)Handler for the 'search_events' tool in the CallToolRequestSchema. Validates the query parameter, fetches events via LumaClient, filters matching events using the searchEvents helper, formats the output, and returns a text response.case 'search_events': { const query = args?.query as string; if (!query || typeof query !== 'string') { return { content: [ { type: 'text', text: 'Error: query parameter is required and must be a string', }, ], isError: true, }; } const response = await lumaClient.fetchEvents(); const matchingEvents = searchEvents(response.entries, query); const formatted = formatEventsList( matchingEvents, `No events found matching "${query}".` ); return { content: [ { type: 'text', text: formatted, }, ], }; }
- src/index.ts:67-80 (registration)Registration of the 'search_events' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema.{ name: 'search_events', description: 'Search Network School events by name or description', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query string', }, }, required: ['query'], }, },
- src/formatters.ts:101-109 (helper)Helper function that implements the core search logic, filtering Luma events where the event name or description contains the query string (case-insensitive).export function searchEvents(entries: LumaEntry[], query: string): LumaEntry[] { const lowerQuery = query.toLowerCase(); return entries.filter(entry => { const nameMatch = entry.event.name.toLowerCase().includes(lowerQuery); const descriptionMatch = entry.event.description?.toLowerCase().includes(lowerQuery) || false; return nameMatch || descriptionMatch; }); }