Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

generate_custom_report

Generate custom analytics reports by selecting data sources, metrics, and output format to analyze project performance.

Instructions

Generate a custom analytics report with specified metrics and visualizations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
report_nameYesName for the custom report
data_sourcesYesData sources to include in the report
metrics_configNoConfiguration for metrics calculation
output_formatNoOutput format for the reportjson
scheduleNoOptional scheduling configuration

Implementation Reference

  • The main handler function for the generate_custom_report tool. Validates input via Zod schema, collects data from each requested source (projects, tasks, documents, conversations, team_members, automations), calculates summary statistics, formats output (json/csv/summary), and optionally sets up scheduling.
    export const generateCustomReport = requireAuth(async (args: any) => {
      const { report_name, data_sources, metrics_config, output_format, schedule } = GenerateCustomReportSchema.parse(args)
      
      logger.info('Generating custom report', { report_name, data_sources, output_format })
    
      const report: any = {
        name: report_name,
        generated_at: new Date().toISOString(),
        data_sources,
        metrics_config: metrics_config || {},
        data: {}
      }
    
      // Collect data from each source
      for (const source of data_sources) {
        try {
          report.data[source] = await collectReportData(source, metrics_config)
        } catch (error) {
          logger.error(`Failed to collect data from ${source}:`, error)
          report.data[source] = { error: 'Data collection failed' }
        }
      }
    
      // Calculate summary statistics
      report.summary = calculateReportSummary(report.data, metrics_config)
    
      // Format output based on requested format
      if (output_format === 'csv') {
        report.csv_data = convertToCSV(report.data)
      } else if (output_format === 'summary') {
        return {
          report_name,
          summary: report.summary,
          key_insights: generateReportInsights(report.data),
          generated_at: report.generated_at
        }
      }
    
      // Set up scheduling if requested
      if (schedule) {
        report.schedule_id = await scheduleReport(report_name, args, schedule)
      }
    
      return report
    })
  • Zod validation schema for the tool's input parameters: report_name (required), data_sources (required, enum), metrics_config (optional with time_grouping/aggregation_method/filters), output_format (default: json), and schedule (optional with frequency/recipients).
    const GenerateCustomReportSchema = z.object({
      report_name: z.string().min(1),
      data_sources: z.array(z.enum(['projects', 'tasks', 'documents', 'conversations', 'team_members', 'automations'])).min(1),
      metrics_config: z.object({
        time_grouping: z.enum(['day', 'week', 'month']).default('week'),
        aggregation_method: z.enum(['sum', 'average', 'count']).default('count'),
        filters: z.record(z.any()).optional()
      }).optional(),
      output_format: z.enum(['json', 'csv', 'summary']).default('json'),
      schedule: z.object({
        frequency: z.enum(['once', 'daily', 'weekly', 'monthly']),
        recipients: z.array(z.string())
      }).optional()
    })
  • The MCPTool definition object that registers the tool with name 'generate_custom_report', description, and JSON Schema input definition. This is what the MCP protocol uses to expose the tool to clients.
    export const generateCustomReportTool: MCPTool = {
      name: 'generate_custom_report',
      description: 'Generate a custom analytics report with specified metrics and visualizations',
      inputSchema: {
        type: 'object',
        properties: {
          report_name: {
            type: 'string',
            description: 'Name for the custom report'
          },
          data_sources: {
            type: 'array',
            items: {
              type: 'string',
              enum: ['projects', 'tasks', 'documents', 'conversations', 'team_members', 'automations']
            },
            description: 'Data sources to include in the report'
          },
          metrics_config: {
            type: 'object',
            properties: {
              time_grouping: { type: 'string', enum: ['day', 'week', 'month'], default: 'week' },
              aggregation_method: { type: 'string', enum: ['sum', 'average', 'count'], default: 'count' },
              filters: { type: 'object' }
            },
            description: 'Configuration for metrics calculation'
          },
          output_format: {
            type: 'string',
            enum: ['json', 'csv', 'summary'],
            default: 'json',
            description: 'Output format for the report'
          },
          schedule: {
            type: 'object',
            properties: {
              frequency: { type: 'string', enum: ['once', 'daily', 'weekly', 'monthly'] },
              recipients: { type: 'array', items: { type: 'string' } }
            },
            description: 'Optional scheduling configuration'
          }
        },
        required: ['report_name', 'data_sources']
      }
    }
  • Exports the tool and handler in the analyticsInsightsTools and analyticsInsightsHandlers objects, mapping the name 'generate_custom_report' to the generateCustomReport handler function.
    // Export all analytics tools
    export const analyticsInsightsTools = {
      getProjectAnalyticsTool,
      getTeamProductivityTool,
      getWorkspaceHealthTool,
      generateCustomReportTool
    }
    
    export const analyticsInsightsHandlers = {
      get_project_analytics: getProjectAnalytics,
      get_team_productivity: getTeamProductivity,
      get_workspace_health: getWorkspaceHealth,
      generate_custom_report: generateCustomReport
    }
  • Helper functions used by the handler: collectReportData (fetches data per source), calculateReportSummary (computes summary stats), generateReportInsights (produces insight strings), convertToCSV (formats as CSV), and scheduleReport (creates scheduled report). All are placeholder implementations.
    async function collectReportData(source: string, config?: any): Promise<any> {
      // Placeholder for data collection
      return { count: 10, trend: 'positive' }
    }
    
    function calculateReportSummary(data: any, config?: any): any {
      return { total_items: 100, growth_rate: 5.2 }
    }
    
    function generateReportInsights(data: any): string[] {
      return ['Strong growth in documentation', 'Task completion trending upward']
    }
    
    function convertToCSV(data: any): string {
      return 'header1,header2\nvalue1,value2' // Placeholder
    }
    
    async function scheduleReport(name: string, config: any, schedule: any): Promise<string> {
      return 'schedule_123' // Placeholder
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, and the description lacks behavioral details such as side effects (e.g., report generation cost), authentication needs, rate limits, or whether the report is persisted.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, concise but under-specified. Lacks structure like bullet points or sections.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given nested parameters and optional scheduling, the description omits output format details, visualization description, and limitations. No output schema to supplement.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds the phrase 'metrics and visualizations' but does not enhance understanding beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it generates a custom analytics report with metrics and visualizations, but does not distinguish from sibling tools like get_project_analytics or get_search_analytics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus other analytics tools. No exclusions or context provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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