Skip to main content
Glama

list-inventory

View all items in the bot's inventory to manage resources and plan actions in Minecraft.

Instructions

List all items in the bot's inventory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that lists all items in the bot's inventory by fetching from bot.inventory.items(), mapping to a list, and formatting as text response.
    async () => { const bot = getBot(); const items = bot.inventory.items(); const itemList: InventoryItem[] = items.map((item) => ({ name: item.name, count: item.count, slot: item.slot })); if (items.length === 0) { return factory.createResponse("Inventory is empty"); } let inventoryText = `Found ${items.length} items in inventory:\n\n`; itemList.forEach(item => { inventoryText += `- ${item.name} (x${item.count}) in slot ${item.slot}\n`; }); return factory.createResponse(inventoryText); }
  • Registers the list-inventory tool with ToolFactory, including description, empty input schema {}, and inline handler.
    factory.registerTool( "list-inventory", "List all items in the bot's inventory", {}, async () => { const bot = getBot(); const items = bot.inventory.items(); const itemList: InventoryItem[] = items.map((item) => ({ name: item.name, count: item.count, slot: item.slot })); if (items.length === 0) { return factory.createResponse("Inventory is empty"); } let inventoryText = `Found ${items.length} items in inventory:\n\n`; itemList.forEach(item => { inventoryText += `- ${item.name} (x${item.count}) in slot ${item.slot}\n`; }); return factory.createResponse(inventoryText); } );
  • src/main.ts:52-52 (registration)
    Top-level call to registerInventoryTools function, which registers the list-inventory tool among others.
    registerInventoryTools(factory, getBot);

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/yuniko-software/minecraft-mcp-server'

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