search_events
Search Network School calendar events by name or description to find relevant activities and opportunities.
Instructions
Search Network School events by name or description
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "search_events"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string |
Implementation Reference
- src/index.ts:220-250 (handler)Handler for the 'search_events' tool: validates query input, fetches events, filters using searchEvents helper, formats output with formatEventsList, and returns text content.
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 list_tools handler, including 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/index.ts:70-79 (schema)Input schema definition for 'search_events' tool: requires 'query' string.
inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query string', }, }, required: ['query'], }, - src/formatters.ts:101-109 (helper)Helper function searchEvents that filters events by matching query in event name or description (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; }); }