Skip to main content
Glama
janetsep

TreePod Financial MCP Agent

by janetsep

generate_report

Generate executive business reports using real-time data to analyze financial performance, occupancy metrics, and operational insights for TreePod Glamping.

Instructions

Genera reportes ejecutivos del negocio basado en datos reales

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
report_typeNomonthly
formatNosummary

Implementation Reference

  • Core handler function that dispatches to specific report generators based on report_type parameter, loads real data, and handles errors.
    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.' ); } }
  • server.js:185-228 (registration)
    Registers the 'generate_report' tool with MCP server, including input schema, title, description, and wrapper handler that validates inputs and delegates 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.' ); } } );
  • Zod input schema defining report_type (monthly|occupancy|financial|competition) and format (summary|detailed) parameters.
    inputSchema: z.object({ report_type: z.string().default('monthly'), format: z.string().default('summary'), }),
  • Helper function for generating monthly reports: loads financial, business status, and domos data, performs analysis, and formats output.
    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) }] }; }

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