Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

list-inventory

Retrieve all items currently stored in the Minecraft bot's inventory to manage resources and plan in-game actions.

Instructions

List all items in the bot's inventory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that lists all items in the bot's inventory. It retrieves items using bot.inventory.items(), maps them to structured data, formats a text response, and handles errors.
    async (): Promise<McpResponse> => {
      try {
        const items = bot.inventory.items();
        const itemList: InventoryItem[] = items.map((item: any) => ({
          name: item.name,
          count: item.count,
          slot: item.slot
        }));
    
        if (items.length === 0) {
          return 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 createResponse(inventoryText);
      } catch (error) {
        return createErrorResponse(error as Error);
      }
    }
  • src/bot.ts:258-285 (registration)
    Registers the 'list-inventory' tool with the MCP server, including name, description, empty input schema, and inline handler.
    server.tool(
      "list-inventory",
      "List all items in the bot's inventory",
      {},
      async (): Promise<McpResponse> => {
        try {
          const items = bot.inventory.items();
          const itemList: InventoryItem[] = items.map((item: any) => ({
            name: item.name,
            count: item.count,
            slot: item.slot
          }));
    
          if (items.length === 0) {
            return 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 createResponse(inventoryText);
        } catch (error) {
          return createErrorResponse(error as Error);
        }
      }
    );
  • TypeScript interface defining the structure of an inventory item (name, count, slot), used in the tool handler for mapping inventory items.
    interface InventoryItem {
      name: string;
      count: number;
      slot: number;
    }
  • src/bot.ts:141-141 (registration)
    Invocation of the registerInventoryTools function within createMcpServer, which includes the registration of 'list-inventory'.
    registerInventoryTools(server, bot);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions 'List all items' but doesn't disclose behavioral traits like whether this is a read-only operation, if it requires specific permissions, how results are formatted, or if there are rate limits. For a tool with zero annotation coverage, this is inadequate.

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 a single, clear sentence with zero wasted words. It's front-loaded with the core purpose ('List all items') and efficiently conveys the essential information without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no annotations, no output schema), the description is minimally adequate. It states what the tool does but lacks details on behavior, output format, or usage context. For a basic list operation, this might suffice, but it leaves gaps in understanding how to interpret results.

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 tool has 0 parameters with 100% schema description coverage, so the schema already fully documents the inputs. The description doesn't need to add parameter details, and it correctly doesn't mention any. Baseline is 4 for tools with no parameters.

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

Purpose4/5

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

The description clearly states the action ('List') and resource ('items in the bot's inventory'), making the purpose immediately understandable. However, it doesn't differentiate from potential siblings like 'find-item' or 'equip-item', which might also involve inventory operations, so it doesn't reach the highest score.

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

Usage Guidelines2/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 like 'find-item' or 'equip-item'. It simply states what the tool does without any context about appropriate use cases or exclusions.

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

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