Skip to main content
Glama

openInventory

Access and manage the bot's inventory on Minecraft MCP Server, enabling precise control over items for crafting, building, and other in-game tasks.

Instructions

Open the bot's inventory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that implements the 'openInventory' tool logic. It checks for required parameters (none), lists all items in the bot's inventory, formats a descriptive string, logs it, emits an end observation event, and returns success.
    export const openInventory = async ( bot: Bot, params: ISkillParams, serviceParams: ISkillServiceParams, ): Promise<boolean> => { const skillName = 'openInventory'; 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 inventory = bot.inventory.items(); let inventoryStr = inventory .map((item) => `${item.count} ${item.displayName.toLowerCase()}`) .join(', '); if (inventoryStr.length === 0) inventoryStr = 'nothing.'; const logMessage = `You just finished examining your inventory and it contains: ${inventoryStr}.`; console.log(logMessage); bot.emit('alteraBotEndObservation', logMessage); return true; };
  • Schema definition for the 'openInventory' tool, specifying no input parameters are required.
    openInventory: { description: "Open the bot's inventory", params: {}, required: [] },
  • The loadSkills function iterates over SKILL_METADATA (which includes 'openInventory') to register all skills by creating SkillDefinition objects with name, description, inputSchema, and a dynamic executor that loads the implementation from the skills/verified directory.
    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; }

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