Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

find-item

Locate a specific item in your Minecraft bot's inventory by name or type to manage resources and plan actions effectively.

Instructions

Find a specific item in the bot's inventory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameOrTypeYesName or type of item to find

Implementation Reference

  • src/bot.ts:287-309 (registration)
    Registration of the 'find-item' MCP tool including schema and handler in the registerInventoryTools function.
    server.tool( "find-item", "Find a specific item in the bot's inventory", { nameOrType: z.string().describe("Name or type of item to find") }, async ({ nameOrType }): Promise<McpResponse> => { try { const items = bot.inventory.items(); const item = items.find((item: any) => item.name.includes(nameOrType.toLowerCase()) ); if (item) { return createResponse(`Found ${item.count} ${item.name} in inventory (slot ${item.slot})`); } else { return createResponse(`Couldn't find any item matching '${nameOrType}' in inventory`); } } catch (error) { return createErrorResponse(error as Error); } } );
  • Handler function that searches the bot's inventory for an item matching the given nameOrType (case-insensitive), returns count, name, and slot if found, or a not-found message.
    async ({ nameOrType }): Promise<McpResponse> => { try { const items = bot.inventory.items(); const item = items.find((item: any) => item.name.includes(nameOrType.toLowerCase()) ); if (item) { return createResponse(`Found ${item.count} ${item.name} in inventory (slot ${item.slot})`); } else { return createResponse(`Couldn't find any item matching '${nameOrType}' in inventory`); } } catch (error) { return createErrorResponse(error as Error); } }
  • Input schema defining the required 'nameOrType' parameter as a string for the item to search for.
    { nameOrType: z.string().describe("Name or type of item to find") },

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/zeeweebee/mcp-server'

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