Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

get_search_analytics

Retrieve search pattern analytics and performance metrics for Helios-9 projects to optimize search functionality and user experience.

Instructions

Get analytics about search patterns and performance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
time_rangeNoTime range for analyticsweek
project_idNoProject to filter analytics (optional)
include_performanceNoInclude search performance metrics

Implementation Reference

  • The main handler function for the 'get_search_analytics' tool. Parses input arguments using Zod schema, logs the request, calls the calculateSearchAnalytics helper, and returns the analytics data.
    export const getSearchAnalytics = requireAuth(async (args: any) => {
      const { time_range, project_id, include_performance } = GetSearchAnalyticsSchema.parse(args)
      
      logger.info('Getting search analytics', { time_range, project_id })
    
      const analytics = await calculateSearchAnalytics(time_range, project_id, include_performance)
      
      return {
        time_range,
        project_id,
        ...analytics
      }
    })
  • Zod schema for validating input parameters of the get_search_analytics tool: time_range (enum), project_id (optional string), include_performance (boolean).
    const GetSearchAnalyticsSchema = z.object({
      time_range: z.enum(['hour', 'day', 'week', 'month']).default('week'),
      project_id: z.string().optional(),
      include_performance: z.boolean().default(true)
    })
  • MCPTool object definition exporting the tool specification including name 'get_search_analytics', description, and inputSchema for registration.
    export const getSearchAnalyticsTool: MCPTool = {
      name: 'get_search_analytics',
      description: 'Get analytics about search patterns and performance',
      inputSchema: {
        type: 'object',
        properties: {
          time_range: {
            type: 'string',
            enum: ['hour', 'day', 'week', 'month'],
            default: 'week',
            description: 'Time range for analytics'
          },
          project_id: {
            type: 'string',
            description: 'Project to filter analytics (optional)'
          },
          include_performance: {
            type: 'boolean',
            default: true,
            description: 'Include search performance metrics'
          }
        }
      }
    }
  • Registration of the getSearchAnalytics handler in the intelligentSearchHandlers object map, keyed by tool name.
    export const intelligentSearchHandlers = {
      universal_search: universalSearch,
      semantic_search: semanticSearch,
      get_search_suggestions: getSearchSuggestions,
      get_search_analytics: getSearchAnalytics
    }
  • Helper function that computes the search analytics data (currently a placeholder returning mock data), called by the main handler.
    async function calculateSearchAnalytics(timeRange: string, projectId?: string, includePerformance?: boolean): Promise<any> {
      // Placeholder for search analytics
      return {
        total_searches: 150,
        unique_queries: 45,
        avg_results_per_search: 8.3,
        top_search_terms: ['api', 'documentation', 'tasks', 'project'],
        search_trends: {
          documents: 45,
          tasks: 35,
          projects: 20
        },
        performance: includePerformance ? {
          avg_search_time: 125,
          cache_hit_rate: 78.5
        } : undefined
      }
    }

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/jakedx6/helios9-MCP-Server'

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