Skip to main content
Glama

equipItem

Equip an item to a specified slot (hand, head, torso, legs, feet) in Minecraft using the MCP Minecraft Remote server, enabling precise inventory management through natural language commands.

Instructions

Equip an item from inventory to hand or armor slot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
destinationNoSlot to equip the item tohand
itemNameYesName of the item to equip

Implementation Reference

  • Registration of the 'equipItem' tool using server.tool, including description, input schema, and inline handler function that equips items from inventory to specified slots.
    server.tool( 'equipItem', 'Equip an item from inventory to hand or armor slot', { itemName: z.string().describe('Name of the item to equip'), destination: z .enum(['hand', 'head', 'torso', 'legs', 'feet']) .default('hand') .describe('Slot to equip the item to'), }, async ({ itemName, destination }) => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { // Find the item in inventory const item = botState.bot.inventory .items() .find((item) => item.name.toLowerCase() === itemName.toLowerCase()) if (!item) { return createSuccessResponse( `Item "${itemName}" not found in inventory.` ) } // Equip the item to the specified destination await botState.bot.equip(item, destination) return createSuccessResponse( `Successfully equipped ${itemName} to ${destination}` ) } catch (error) { return createErrorResponse(error) } } )
  • The execution logic for equipItem: validates connection, locates item in bot's inventory by case-insensitive name match, equips to 'hand', 'head', 'torso', 'legs', or 'feet' slot, handles missing item or errors with responses.
    async ({ itemName, destination }) => { if (!botState.isConnected || !botState.bot) { return createNotConnectedResponse() } try { // Find the item in inventory const item = botState.bot.inventory .items() .find((item) => item.name.toLowerCase() === itemName.toLowerCase()) if (!item) { return createSuccessResponse( `Item "${itemName}" not found in inventory.` ) } // Equip the item to the specified destination await botState.bot.equip(item, destination) return createSuccessResponse( `Successfully equipped ${itemName} to ${destination}` ) } catch (error) { return createErrorResponse(error) } }
  • Input schema using Zod: itemName (required string), destination (optional enum with default 'hand').
    { itemName: z.string().describe('Name of the item to equip'), destination: z .enum(['hand', 'head', 'torso', 'legs', 'feet']) .default('hand') .describe('Slot to equip the item to'), },
  • High-level registration call within registerAllTools() that invokes the inventory management tools registration, including equipItem.
    registerInventoryManagementTools()

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/nacal/mcp-minecraft-remote'

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