Skip to main content
Glama

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
NameRequiredDescriptionDefault
queryYesSearch query string

Implementation Reference

  • 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'], }, },
  • 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; }); }

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