Skip to main content
Glama
leo4life2

Minecraft MCP Server

by leo4life2

openNearbyChest

Locate and open the nearest chest in Minecraft using this MCP Server tool. Simplify inventory management and item collection during gameplay.

Instructions

Open a nearby chest

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function implementing the openNearbyChest tool logic. It validates parameters, finds nearby chests using helper functions, navigates to the closest chest, opens it by looking at it and updating the chest interface, and emits observations.
    export const openNearbyChest = async (
      bot: Bot,
      params: ISkillParams,
      serviceParams: ISkillServiceParams,
    ): Promise<boolean> => {
      const skillName = 'openNearbyChest';
      const requiredParams: string[] = [];
      const isParamsValid = validateSkillParams(
        params,
        requiredParams,
        skillName,
      );
      if (!isParamsValid) {
        serviceParams.cancelExecution?.();
        bot.emit(
          'alteraBotEndObservation',
          `Mistake: You didn't provide all of the required parameters ${requiredParams.join(', ')} for the ${skillName} skill.`,
        );
        return false;
      }
    
      const unpackedParams = {
        setStatsData: serviceParams.setStatsData,
        getStatsData: serviceParams.getStatsData,
        signal: serviceParams.signal,
      };
      const {setStatsData, getStatsData, signal} = unpackedParams;
      const NEARBY_DISTANCE = bot.nearbyBlockXZRange;
      const chestPositions = findNearbyChests(bot, {
        searchRadius: NEARBY_DISTANCE,
        maxChests: 3,
      });
    
      if (chestPositions.length === 0) {
        return bot.emit(
          'alteraBotEndObservation',
          'You tried to open a nearby chest but no chests found nearby. If you were taking out items, no items were taken out.',
        );
      }
    
      const chestPosition = await findAChest(bot, {posToAvoid: null});
      if (chestPosition) {
        const navigateToLocationFunc = async function () {
          return navigateToLocation(bot, {
            x: chestPosition.x,
            y: chestPosition.y,
            z: chestPosition.z,
            range: 2,
          });
        };
        await asyncwrap({func: navigateToLocationFunc, setStatsData, getStatsData});
    
        // check for cancelation signal
        if (isSignalAborted(signal)) {
          return bot.emit(
            'alteraBotEndObservation',
            `You decided to do something else and stopped opening the chest.`,
          );
        }
    
        const chestBlock = bot.blockAt(chestPosition);
        bot.lookAt(chestPosition.offset(0.5, 0.5, 0.5));
    
        if (!chestBlock)
          return bot.emit(
            'alteraBotEndObservation',
            'The chest you were trying to open no longer exists!',
          );
    
        await updateChestInterface(bot, {
          chestPosition,
          getStatsData,
          setStatsData,
        });
        return bot.emit(
          'alteraBotEndObservation',
          `You have opened a chest at ${chestPosition}.`,
        );
      } else {
        return bot.emit(
          'alteraBotEndObservation',
          'You tried to open a nearby chest but there are no chests nearby. If you were taking out items, no items were taken out.',
        );
      }
    };
  • Registration metadata for the openNearbyChest tool in SKILL_METADATA, defining its description and empty input schema. This is used by loadSkills() to register the tool dynamically by importing and executing the handler from the corresponding skill file.
    openNearbyChest: {
        description: "Open a nearby chest",
        params: {},
        required: []
    },
  • Input schema definition for openNearbyChest: no required parameters, empty params object.
    openNearbyChest: {
        description: "Open a nearby chest",
        params: {},
        required: []
    },
Behavior1/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 but fails to do so. It does not indicate whether this action is read-only or mutative, what happens upon opening (e.g., displays contents, triggers events, consumes resources), potential side effects, or any limitations (e.g., cooldowns, permissions). The vague phrasing offers no actionable insights beyond the basic verb.

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 extremely concise with a single, direct sentence: 'Open a nearby chest.' It is front-loaded and wastes no words, making it easy to parse quickly. Every part of the sentence contributes to the core idea, though the content itself is minimal.

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 lack of annotations and output schema, the description is incomplete for effective tool use. It does not explain what 'open' entails behaviorally, what the result might be (e.g., item access, game state change), or how it interacts with the game environment. For a tool with potential mutative effects in a game context, this leaves significant gaps in understanding.

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 appropriately does not discuss parameters, and since there are none, it meets the baseline expectation without requiring compensation for gaps. However, it does not add any semantic context beyond the schema, such as implicit environmental requirements.

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

Purpose2/5

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

The description 'Open a nearby chest' is a tautology that essentially restates the tool name 'openNearbyChest' without adding meaningful specificity. It does not clarify what 'open' entails in this context (e.g., accessing contents, triggering an animation, or interacting with a game object) or distinguish it from sibling tools like 'openInventory' or 'retrieveItemsFromNearbyFurnace' that might involve similar container interactions.

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

Usage Guidelines1/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 does not mention prerequisites (e.g., requiring a chest to be nearby), exclusions (e.g., not usable if no chest exists), or comparisons to siblings like 'openInventory' for personal storage or 'retrieveItemsFromNearbyFurnace' for specific container types, leaving the agent with no context for selection.

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