Skip to main content
Glama
leo4life2

Minecraft MCP Server

by leo4life2

eatFood

Restore hunger in Minecraft by consuming food directly from your inventory using this simple tool on the MCP Server. Ideal for AI agents managing in-game survival tasks.

Instructions

Eat food from inventory to restore hunger

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function for the 'eatFood' tool. Determines if the bot is hungry (food < 20), searches inventory for edible items from a predefined list of Minecraft foods, equips the first available food to hand slot, and consumes it using bot.consume(). Emits observations via bot.emit for start/end states.
    export const eatFood = async (
      bot: Bot,
      params: ISkillParams,
      serviceParams: ISkillServiceParams,
    ): Promise<boolean> => {
      const minecraftFoodNames = [
        'apple',
        'baked_potato',
        'beetroot',
        'beetroot_soup',
        'bread',
        'cake',
        'carrot',
        'chorus_fruit',
        'cooked_chicken',
        'cooked_cod',
        'cooked_mutton',
        'cooked_porkchop',
        'cooked_rabbit',
        'cooked_salmon',
        'cookie',
        'dried_kelp',
        'enchanted_golden_apple',
        'glow_berries',
        'golden_apple',
        'golden_carrot',
        'honey_bottle',
        'melon_slice',
        'mushroom_stew',
        'poisonous_potato',
        'potato',
        'pufferfish',
        'pumpkin_pie',
        'rabbit_stew',
        'beef',
        'chicken',
        'cod',
        'mutton',
        'porkchop',
        'rabbit',
        'salmon',
        'rotten_flesh',
        'spider_eye',
        'cooked_beef',
        'suspicious_stew',
        'sweet_berries',
        'tropical_fish',
      ];
      const {getStatsData, setStatsData} = serviceParams;
    
      // check to see if the bot is hungry
      if (bot.food < 20) {
        console.log(`Bot is hungry and has ${bot.food} food points.`);
      } else {
        return bot.emit(
          'alteraBotEndObservation',
          `You decided not to eat since you are not hungry.`,
        );
      }
    
      for (const foodName of minecraftFoodNames) {
        const food = bot.inventory.findInventoryItem(foodName as any, null, false);
    
        if (food !== null) {
          console.log(`Found item: ${foodName}`);
          bot.equip(food, 'hand');
          console.log(`Eating: ${foodName}`);
          try {
            await asyncwrap({
              func: async () => {
                console.log(`${foodName} consumed!`);
                return bot.consume();
              },
              getStatsData,
              setStatsData,
            });
          } catch (error) {
            console.log(`Error consuming ${foodName}: ${error}`);
          }
    
          return bot.emit(
            'alteraBotEndObservation',
            `You finished eating one ${foodName}`,
          );
        }
      }
    
      return bot.emit(
        'alteraBotEndObservation',
        `You tried to eat but you have no food to eat!`,
      );
    };
  • Schema definition for the 'eatFood' tool within SKILL_METADATA. Specifies the tool description and an empty input schema (no parameters required). This is used to generate the inputSchema for the SkillDefinition.
    eatFood: {
        description: "Eat food from inventory to restore hunger",
        params: {},
        required: []
    },
  • The loadSkills function registers all skills including 'eatFood' by iterating over SKILL_METADATA, creating SkillDefinition objects with name, description, inputSchema from metadata, and dynamic executor that imports the skill implementation. This array is likely used to register tools with the MCP server.
    export async function loadSkills(): Promise<SkillDefinition[]> {
        const skills: SkillDefinition[] = [];
    
        for (const [skillName, metadata] of Object.entries(SKILL_METADATA)) {
            skills.push({
                name: skillName,
                description: metadata.description,
                inputSchema: {
                    type: "object",
                    properties: metadata.params,
                    required: metadata.required
                },
                execute: createSkillExecutor(skillName)
            });
        }
    
        return skills;
    }
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 states the tool 'eat food from inventory to restore hunger,' which implies a mutation (consuming inventory items) and an effect (hunger restoration), but lacks details on permissions, side effects (e.g., item destruction, cooldowns), or response format. This is insufficient for a mutation tool with zero annotation coverage.

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 action and purpose without any wasted words. It directly communicates what the tool does and why, making it highly concise and well-structured for quick understanding.

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

Completeness2/5

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

Given the complexity of a mutation tool (eating food implies inventory changes and hunger effects) with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits (e.g., what happens if no food is available, how much hunger is restored), making it inadequate for safe and effective use by an AI agent.

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 0 parameters with 100% coverage, so no parameter documentation is needed. The description adds no parameter information, which is acceptable here as there are no parameters to describe. Baseline is 4 for 0 parameters, as the description doesn't need to compensate for any gaps.

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 action ('eat food') and the resource ('from inventory'), with the purpose ('to restore hunger') explicitly defined. It distinguishes itself from siblings like 'cookItem' or 'useItemOnBlockOrEntity' by focusing on consumption for hunger restoration, though it doesn't explicitly compare to alternatives like 'rest' for similar effects.

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 implies usage when hunger needs restoration, but provides no explicit guidance on when to use this tool versus alternatives (e.g., 'rest' might also restore hunger, 'cookItem' might prepare food first). There are no prerequisites mentioned, such as requiring food in inventory or specific conditions, leaving gaps in practical application.

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

Related 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/leo4life2/minecraft-mcp-http'

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