Skip to main content
Glama

get_nutrition_facts

Retrieve nutritional information for menu items to analyze dietary content and support informed food choices.

Instructions

Get (totally real and not at all made up) nutrition facts for a menu item.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemYesThe menu item to look up

Implementation Reference

  • The handler function that calculates and formats the nutrition facts for the get_nutrition_facts tool.
    async ({ item }) => {
      // Very scientific nutrition calculation
      const hash = [...item].reduce((acc, c) => acc + c.charCodeAt(0), 0);
      const calories = 300 + (hash % 900);
      const protein_g = 10 + (hash % 45);
      const carbs = 20 + (hash % 80);
      const fat = 5 + (hash % 35);
      const sodium = 400 + (hash % 1600);
    
      const lines = [
        `# Nutrition Facts: ${item}`,
        "",
        `| Nutrient | Amount |`,
        `|----------|--------|`,
        `| Calories | ${calories} |`,
        `| Protein | ${protein_g}g |`,
        `| Carbs | ${carbs}g |`,
        `| Fat | ${fat}g |`,
        `| Sodium | ${sodium}mg |`,
        `| Happiness | Immeasurable |`,
        `| Regret (post-meal) | Likely |`,
        "",
        "> Disclaimer: These numbers were generated by an AI that has never eaten food.",
      ];
    
      return { content: [{ type: "text", text: lines.join("\n") }] };
    }
  • index.js:308-313 (registration)
    The registration and input schema definition for the get_nutrition_facts tool.
    server.tool(
      "get_nutrition_facts",
      "Get (totally real and not at all made up) nutrition facts for a menu item.",
      {
        item: z.string().describe("The menu item to look up"),
      },
Behavior2/5

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

No annotations provided, so description carries full disclosure burden. Beyond the ironic hint that data may be fabricated, it lacks critical behavioral details: no mention of what happens when items don't exist, response format/fields (calories, macros), caching, or rate limits.

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?

Single sentence, appropriately brief. The parenthetical joke adds character fitting the server's humorous theme (siblings include 'chipotle_personality_test', 'burrito_integrity_check') without severely harming clarity. Front-loaded with action verb.

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?

Adequate for a simple single-parameter read operation. Lacks output description (common for tools without output schemas), but mentions the core entity (nutrition facts). Could be improved with error case documentation.

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

Parameters3/5

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

Schema coverage is 100% with the 'item' parameter fully described. Description reinforces this by mentioning 'menu item' but adds no additional syntax guidance, format examples, or validation rules beyond the schema. Baseline 3 appropriate for high-coverage schemas.

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?

States specific verb (Get) and resource (nutrition facts) with clear scope (menu item). The humorous parenthetical indicates the data source may be mock/fake, which actually clarifies behavior. Lacks explicit differentiation from sibling 'view_menu', though the focus on nutrition vs. general menu viewing is distinct.

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?

Provides no guidance on when to use this tool versus alternatives like 'view_menu', or prerequisites (e.g., needing to know item names from menu first). No error handling guidance included.

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