Skip to main content
Glama
janetsep

TreePod Financial MCP Agent

by janetsep

Estado del negocio

get_business_status

Check current business health with real-time alerts and KPIs to monitor financial performance and operational status.

Instructions

Estado general actual del negocio con alertas y KPIs basado en datos reales

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
formatNosummary

Implementation Reference

  • Main handler function that loads business data from dataLoader, validates availability, computes metrics/alerts/status using helper methods, and returns formatted text response.
    async getBusinessStatus() {
      validator.log('info', 'Obteniendo estado general del negocio');
      
      try {
        // Cargar todos los datos necesarios
        const financialData = await dataLoader.loadFinancialData();
        const businessData = await dataLoader.loadBusinessStatus();
        const domosStatus = await dataLoader.loadDomosStatus();
        
        // Validar que tenemos datos mínimos
        if (!financialData && !businessData) {
          return validator.generateInsufficientDataResponse(
            'datos del estado del negocio',
            'No se pudo acceder a los datos financieros ni de estado del negocio'
          );
        }
        
        // Calcular métricas principales
        const metrics = this.calculateBusinessMetrics(financialData, businessData, domosStatus);
        const alerts = this.checkBusinessAlerts(metrics);
        const overallStatus = this.determineOverallStatus(metrics);
        
        return {
          content: [{
            type: 'text',
            text: this.formatBusinessStatus(metrics, alerts, overallStatus)
          }]
        };
        
      } catch (error) {
        validator.log('error', `Error obteniendo estado del negocio: ${error.message}`);
        return validator.generateInsufficientDataResponse(
          'estado del negocio',
          'Error interno en la consulta. Contacta al administrador.'
        );
      }
    }
  • server.js:232-258 (registration)
    Tool registration including schema definition (inputSchema with optional format), description, title, and thin async wrapper handler that invokes businessCalculator.getBusinessStatus() with logging and error handling.
    server.registerTool(
      'get_business_status',
      {
        title: 'Estado del negocio',
        description: 'Estado general actual del negocio con alertas y KPIs basado en datos reales',
        inputSchema: z.object({
          format: z.string().optional().default('summary')
        }),
      },
      async () => {
        validator.log('info', 'Iniciando consulta de estado general del negocio');
        
        try {
          const result = await businessCalculator.getBusinessStatus();
          
          validator.log('info', 'Estado del negocio obtenido exitosamente');
          return result;
          
        } catch (error) {
          validator.log('error', `Error crítico obteniendo estado del negocio: ${error.message}`);
          return validator.generateInsufficientDataResponse(
            'estado del negocio',
            'Error interno del sistema. Contacta al administrador.'
          );
        }
      }
    );
  • Key helper method that generates the formatted text output for the business status report, including KPIs, domos status, alerts, goal progress, and recommendations.
    formatBusinessStatus(metrics, alerts, overallStatus) {
      const now = new Date();
      const timestamp = now.toLocaleDateString('es-CL') + ' ' + now.toLocaleTimeString('es-CL', { hour: '2-digit', minute: '2-digit' });
      
      let content = `🎯 **ESTADO GENERAL TREEPOD GLAMPING**\n\n`;
      
      content += `💼 **Estado del Negocio:** ${overallStatus}\n`;
      content += `📅 **Última actualización:** ${timestamp}\n\n`;
      
      content += `**📊 KPIs PRINCIPALES:**\n`;
      content += `• 💰 Ingresos: ${this.formatCurrency(metrics.revenue)}\n`;
      content += `• 📈 Utilidad: ${this.formatCurrency(metrics.profit)} (${metrics.margin}%)\n`;
      content += `• 🏠 Ocupación: ${metrics.occupancy}%\n`;
      content += `• 📅 Reservas: ${metrics.reservations}\n\n`;
      
      // Información de domos si está disponible
      if (metrics.domosMetrics) {
        content += `**🏕️ ESTADO DOMOS:**\n`;
        content += `• Disponibles: ${metrics.domosMetrics.available}/${metrics.domosMetrics.total}\n`;
        content += `• Ocupados: ${metrics.domosMetrics.occupied}/${metrics.domosMetrics.total}\n`;
        if (metrics.domosMetrics.maintenance > 0) {
          content += `• En mantención: ${metrics.domosMetrics.maintenance}/${metrics.domosMetrics.total}\n`;
        }
        content += `\n`;
      }
      
      content += `**🚨 ALERTAS ACTIVAS:**\n`;
      if (alerts.length > 0) {
        alerts.forEach(alert => {
          content += `• ${alert}\n`;
        });
      } else {
        content += `✅ Sin alertas críticas\n`;
      }
      content += `\n`;
      
      content += `**🎯 PROGRESO HACIA METAS:**\n`;
      content += `• Ingresos: ${((metrics.revenue / metrics.revenueGoal) * 100).toFixed(1)}% de ${this.formatCurrency(metrics.revenueGoal)}\n`;
      content += `• Utilidad: ${((metrics.profit / metrics.profitGoal) * 100).toFixed(1)}% de ${this.formatCurrency(metrics.profitGoal)}\n`;
      content += `• Ocupación: ${((metrics.occupancy / metrics.occupancyGoal) * 100).toFixed(1)}% de ${metrics.occupancyGoal}%\n\n`;
      
      content += `**⚡ ACCIONES RECOMENDADAS:**\n`;
      const recommendations = this.getBusinessRecommendations(metrics, alerts);
      recommendations.forEach(rec => {
        content += `• ${rec}\n`;
      });
      
      content += `\n*Estado basado en datos reales del sistema TreePod*`;
      
      return content;
    }
  • Helper that computes core business metrics (revenue, profit, margin, occupancy, reservations, domos metrics) from loaded data, including business goals for progress calculation.
    calculateBusinessMetrics(financialData, businessData, domosStatus) {
      const revenue = financialData?.ingresos_total || 0;
      const expenses = financialData?.gastos_total || 0;
      const profit = revenue - expenses;
      const margin = revenue > 0 ? (profit / revenue * 100).toFixed(1) : 0;
      const occupancy = businessData?.occupancy || 0;
      const reservations = financialData?.reservas_totales || 0;
      
      // Métricas de domos si están disponibles
      let domosMetrics = null;
      if (domosStatus) {
        domosMetrics = this.calculateOccupancyMetrics(domosStatus);
      }
      
      return {
        revenue,
        expenses,
        profit,
        margin: parseFloat(margin),
        occupancy,
        reservations,
        domosMetrics,
        // Metas del negocio
        revenueGoal: 6000000,
        profitGoal: 2000000,
        occupancyGoal: 70
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a read-only operation by describing retrieval of status, but doesn't specify authentication needs, rate limits, data freshness, or error conditions. For a tool with zero annotation coverage, this is a significant gap in transparency.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose without unnecessary details. It wastes no words and is appropriately sized for a simple status retrieval tool.

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

Completeness3/5

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

Given the tool's simplicity (one optional parameter, no output schema, no annotations), the description is minimally adequate. It states what the tool does but lacks context on behavioral traits, usage guidelines, or output format. For a tool with 'business status' scope, more detail on what 'alerts and KPIs' entail would improve completeness.

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

Parameters4/5

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

The input schema has one parameter ('format') with 0% description coverage, and the tool description doesn't mention parameters at all. However, with only one optional parameter and a default value provided in the schema, the baseline is high. The description doesn't add semantic value, but the minimal parameter burden justifies a score of 4.

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: to retrieve the 'current general business status with alerts and KPIs based on real data.' It specifies the verb ('Estado general actual' implies retrieval) and resource ('negocio'), though it doesn't explicitly differentiate from siblings like 'analyze_finances' or 'predict_revenue.'

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 prerequisites, exclusions, or comparisons to sibling tools like 'check_occupancy' or 'generate_report,' leaving the agent to infer usage context from the tool name alone.

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