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);

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are provided, but the description accurately conveys a read-only listing operation. Beyond that, no additional behavioral traits (e.g., side effects, permissions) are relevant for such a simple tool, so the description is sufficient.

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 sentence with no fluff. It is front-loaded and every word serves a purpose.

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

Completeness5/5

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

Given the tool has no parameters, no annotations, and no output schema, the description is complete. It tells the agent exactly what the tool does—listing inventory items—without requiring additional context.

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 input schema has no parameters (0 params) and 100% schema description coverage, so the baseline is 4. The description adds no parameter details, but none are needed.

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

Purpose5/5

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

The description 'List all items in the bot's inventory' uses a clear verb ('List') and specific resource ('items in the bot's inventory'), which is distinct from sibling tools like 'craft-item' or 'find-item' that involve different actions.

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

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when the agent needs to know the bot's current inventory contents. Since there are no competing list tools for inventory (e.g., 'list-recipes' is different), clear context is provided, though no explicit exclusions or alternatives are needed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.