Skip to main content
Glama
janetsep

TreePod Financial MCP Agent

by janetsep

Generar reporte

generate_report

Generate business executive reports from real data to analyze financial performance and support decision-making.

Instructions

Genera reportes ejecutivos del negocio basado en datos reales

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
report_typeNomonthly
formatNosummary

Implementation Reference

  • server.js:185-228 (registration)
    Registration of the 'generate_report' MCP tool, including input schema validation and wrapper handler that delegates core logic to businessCalculator.generateReport
    server.registerTool(
      'generate_report',
      {
        title: 'Generar reporte',
        description: 'Genera reportes ejecutivos del negocio basado en datos reales',
        inputSchema: z.object({
          report_type: z.string().default('monthly'),
          format: z.string().default('summary'),
        }),
      },
      async ({ report_type = 'monthly', format = 'summary' }) => {
        validator.log('info', `Iniciando generación de reporte tipo: ${report_type}, formato: ${format}`);
        
        try {
          // Validar parámetros de entrada
          const inputValidation = validator.validateUserInput({
            report_type,
            format
          }, {
            report_type: { required: true, type: 'string', enum: ['monthly', 'occupancy', 'financial', 'competition'] },
            format: { required: true, type: 'string', enum: ['summary', 'detailed'] }
          });
    
          if (!inputValidation.valid) {
            return validator.generateInsufficientDataResponse(
              'parámetros de reporte',
              `Errores: ${inputValidation.errors.join(', ')}`
            );
          }
          
          const result = await businessCalculator.generateReport(report_type, format);
          
          validator.log('info', 'Reporte generado exitosamente');
          return result;
          
        } catch (error) {
          validator.log('error', `Error crítico en generación de reporte: ${error.message}`);
          return validator.generateInsufficientDataResponse(
            'generación de reporte',
            'Error interno del sistema. Contacta al administrador.'
          );
        }
      }
    );
  • Input schema definition for generate_report tool using Zod: report_type (monthly|occupancy|financial|competition), format (summary|detailed)
    {
      title: 'Generar reporte',
      description: 'Genera reportes ejecutivos del negocio basado en datos reales',
      inputSchema: z.object({
        report_type: z.string().default('monthly'),
        format: z.string().default('summary'),
      }),
  • Core handler logic for generateReport in BusinessCalculator class: dispatches to type-specific report generators based on report_type, with error handling
    async generateReport(reportType, format = 'summary') {
      validator.log('info', `Generando reporte ${reportType} en formato ${format}`);
      
      try {
        switch (reportType) {
          case 'monthly':
            return await this.generateMonthlyReport(format);
          case 'occupancy':
            return await this.generateOccupancyReport(format);
          case 'financial':
            return await this.generateFinancialReport(format);
          case 'competition':
            return await this.generateCompetitionReport(format);
          default:
            return await this.generateMonthlyReport(format);
        }
      } catch (error) {
        validator.log('error', `Error generando reporte ${reportType}: ${error.message}`);
        return validator.generateInsufficientDataResponse(
          `reporte ${reportType}`,
          'Error interno en la generación del reporte. Contacta al administrador.'
        );
      }
    }
  • Helper method generateMonthlyReport: loads data, computes analysis, formats monthly report content
    async generateMonthlyReport(format) {
      const financialData = await dataLoader.loadFinancialData();
      const businessData = await dataLoader.loadBusinessStatus();
      const domosStatus = await dataLoader.loadDomosStatus();
      
      if (!financialData && !businessData) {
        return validator.generateInsufficientDataResponse(
          'datos para reporte mensual',
          'No se pudo acceder a los datos financieros ni de estado del negocio'
        );
      }
    
      const analysis = this.calculateFinancialAnalysis(financialData || {}, 'Enero 2025');
      const occupancyMetrics = domosStatus ? this.calculateOccupancyMetrics(domosStatus) : null;
      
      return {
        content: [{
          type: 'text',
          text: this.formatMonthlyReport(analysis, occupancyMetrics, format)
        }]
      };
    }
  • Helper method generateOccupancyReport: generates occupancy-focused report using domos status data
    async generateOccupancyReport(format) {
      const businessData = await dataLoader.loadBusinessStatus();
      const domosStatus = await dataLoader.loadDomosStatus();
      
      if (!domosStatus) {
        return validator.generateInsufficientDataResponse(
          'datos de ocupación',
          'No se pudo acceder al estado actual de los domos'
        );
      }
    
      const metrics = this.calculateOccupancyMetrics(domosStatus);
      const occupancyRate = businessData?.occupancy || 0;
      
      return {
        content: [{
          type: 'text',
          text: this.formatOccupancyReport(metrics, occupancyRate, format)
        }]
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that reports are 'basado en datos reales' (based on real data), which adds some context about data sources, but fails to disclose critical behavioral traits such as whether this is a read-only operation, if it requires specific permissions, what the output format might be (beyond the format parameter), or any rate limits. For a tool with no annotation coverage, this is inadequate.

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

Conciseness4/5

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

The description is concise and front-loaded in a single sentence: 'Genera reportes ejecutivos del negocio basado en datos reales'. It efficiently conveys the core purpose without unnecessary words. However, it could be slightly improved by structuring to highlight key aspects like parameters or usage context, but it earns high marks for brevity and clarity.

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 the complexity (a report generation tool with 2 parameters), lack of annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't explain what the tool returns, how parameters affect the output, or behavioral aspects like permissions or data sources. The description alone is insufficient for an agent to use the tool effectively without additional context or trial-and-error.

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

Parameters2/5

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

The schema description coverage is 0%, meaning neither parameter (report_type, format) has descriptions in the schema. The tool description does not mention these parameters at all, providing no additional meaning beyond what the bare schema offers. With 2 parameters and no schema descriptions, the description fails to compensate, leaving users guessing about what values are valid (e.g., what report_types or formats are supported).

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 the tool's purpose: 'Genera reportes ejecutivos del negocio basado en datos reales' (Generates executive business reports based on real data). It specifies the verb 'genera' (generates) and resource 'reportes ejecutivos del negocio' (executive business reports), and distinguishes from siblings like analyze_finances or predict_revenue by focusing on report generation rather than analysis or prediction. However, it doesn't explicitly differentiate from all siblings (e.g., compare_competition might also generate reports).

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when this tool is appropriate, when other tools should be used instead, or what prerequisites might be needed. Given the sibling tools include analyze_finances, predict_revenue, and others that might overlap with report generation, this lack of differentiation is a significant gap.

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/janetsep/treepod-financial-mcp'

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