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") }] };
      }
    );
Behavior3/5

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

No annotations provided, so description carries full burden. It establishes the tool performs an economic calculation ('economically rational'), but omits side effects, output format, or whether this stores decision history. Does not contradict any structured data.

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?

Single sentence, front-loaded with active verb. 'Economically rational' and 'financial and emotional state' efficiently convey the decision criteria without waste. No redundant phrases.

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?

Three well-documented parameters (100% coverage) but no output schema provided. Description should ideally specify what determination is returned (boolean, cost-benefit analysis, recommendation) to complete the contract. Adequate but gap exists.

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?

Schema coverage is 100%, establishing baseline 3. Description adds conceptual framing by mapping 'bank_balance' to 'financial state' and 'hunger_level' to 'emotional state,' providing semantic glue between raw parameters and the ROI concept.

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

Purpose5/5

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

Specific verb ('Determines') and clear resource scope ('adding guacamole'). Uniquely distinguishes from siblings like 'customize_order' or 'place_order' by focusing on economic rationality calculation rather than order execution.

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

Usage Guidelines3/5

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

Implies usage context through 'given your current financial and emotional state' (i.e., when deciding about guac), but lacks explicit when-to-use guidance or named alternatives like 'customize_order' for users who've already decided.

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

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