Skip to main content
Glama

optimize_guac_roi

Calculate whether adding guacamole to your Chipotle order is financially and emotionally worthwhile based on your protein choice, hunger level, and bank balance.

Instructions

Determines if adding guacamole is economically rational given your current financial and emotional state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
proteinYesYour chosen protein
hunger_levelYesHunger level from 1-10
bank_balanceYesCurrent bank balance in USD

Implementation Reference

  • The tool 'optimize_guac_roi' is registered and implemented in the same block. It calculates a guacamole ROI score based on protein, hunger level, and bank balance to provide a recommendation.
    server.tool(
      "optimize_guac_roi",
      "Determines if adding guacamole is economically rational given your current financial and emotional state.",
      {
        protein: z.enum(PROTEINS).describe("Your chosen protein"),
        hunger_level: z.number().min(1).max(10).describe("Hunger level from 1-10"),
        bank_balance: z.number().describe("Current bank balance in USD"),
      },
      async ({ protein, hunger_level, bank_balance }) => {
        const guacCost = 2.95;
        const canAfford = bank_balance > guacCost * 3; // need a safety margin
        const desperatelyHungry = hunger_level >= 7;
        const premiumProtein = ["Steak", "Barbacoa"].includes(protein);
    
        // Proprietary ROI algorithm
        const moraleBoost = hunger_level * 0.12;
        const financialPain = guacCost / Math.max(bank_balance, 0.01);
        const proteinSynergy = premiumProtein ? 0.15 : 0;
        const roiScore = Math.min(
          ((moraleBoost + proteinSynergy - financialPain) * 10 + 0.5).toFixed(2) / 10,
          1.0
        );
    
        let recommendation, warning;
        if (!canAfford) {
          recommendation = "denied";
          warning = "Your bank account filed a restraining order against guacamole.";
        } else if (roiScore > 0.7) {
          recommendation = "approved";
          warning = desperatelyHungry
            ? "Guac is expensive but morale is low. Approved on humanitarian grounds."
            : "The numbers check out. Treat yourself, king.";
        } else if (roiScore > 0.4) {
          recommendation = "conditional";
          warning = "Guac ROI is marginal. Consider splitting with a friend (if you have those).";
        } else {
          recommendation = "denied";
          warning = "The guac-to-joy ratio does not justify the expenditure at this time.";
        }
    
        const lines = [
          "# Guacamole ROI Analysis",
          "",
          `| Metric | Value |`,
          `|--------|-------|`,
          `| Protein | ${protein} |`,
          `| Hunger Level | ${hunger_level}/10 |`,
          `| Bank Balance | $${bank_balance.toFixed(2)} |`,
          `| Guac Cost | $${guacCost.toFixed(2)} |`,
          `| ROI Score | ${roiScore} |`,
          `| Morale Boost Factor | ${moraleBoost.toFixed(3)} |`,
          `| Financial Pain Index | ${financialPain.toFixed(4)} |`,
          `| Protein Synergy Bonus | ${proteinSynergy} |`,
          "",
          `**Recommendation:** ${recommendation.toUpperCase()}`,
          "",
          `> ${warning}`,
        ];
    
        return { content: [{ type: "text", text: lines.join("\n") }] };
      }
    );

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/YoshiSaurus/mcp-otle'

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