Skip to main content
Glama
leo4life2

Minecraft MCP Server

by leo4life2

craftItems

Craft specified items in Minecraft using a crafting table or inventory. Provide the item name and count to automate item creation, enhancing in-game efficiency with the MCP Server.

Instructions

Craft items using a crafting table or inventory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countYesNumber of items to craft
itemYesThe name of the item to craft

Implementation Reference

  • Main handler function for the 'craftItems' tool. Crafts specified items or opens the crafting interface if no item provided. Uses helpers like craftAnItem and updateCraftingInterface.
    export const craftItems = async (
      bot: Bot,
      params: ISkillParams,
      serviceParams: ISkillServiceParams,
    ): Promise<boolean> => {
      const skillName = 'craftItems';
      const requiredParams: string[] = [];
      const isParamsValid = validateSkillParams(
        params,
        requiredParams,
        skillName,
      );
      if (!isParamsValid) {
        serviceParams.cancelExecution?.();
        bot.emit(
          'alteraBotEndObservation',
          `Mistake: You didn't provide all of the required parameters ${requiredParams.join(', ')} for the ${skillName} skill.`,
        );
        return false;
      }
      const unpackedParams = {
        item: params.item || null,
        count: params.count || 1,
        signal: serviceParams.signal,
        getStatsData: serviceParams.getStatsData,
        setStatsData: serviceParams.setStatsData,
      };
      const {item, count, setStatsData, getStatsData, signal} = unpackedParams;
      if (!item) {
        try {
          updateCraftingInterface(bot); // open the crafting interface
          // force choosing a new action after opening the crafting interface
          bot.emit(
            'alteraBotEndObservation',
            `You have opened the crafting interface and should choose a new action.`,
          );
        } catch (err) {
          return bot.emit(
            'alteraBotEndObservation',
            `Error: something went wrong when trying to see the items you can craft.`,
          );
        }
      } else {
        const [success, message] = await craftAnItem(bot, {
          name: item,
          count,
          setStatsData,
          getStatsData,
          signal,
        });
        if (success) {
          return bot.emit(
            'alteraBotEndObservation',
            `You have successfully finished crafting ${message}.`,
          );
        } else {
          return bot.emit(
            'alteraBotEndObservation',
            `You have failed to craft ${count} ${item} because ${message}`,
          );
        }
      }
    };
  • Input schema and metadata for the 'craftItems' tool, defining parameters, description, and required fields.
    craftItems: {
        description: "Craft items using a crafting table or inventory",
        params: {
            item: { type: "string", description: "The name of the item to craft" },
            count: { type: "number", description: "Number of items to craft" }
        },
        required: ["item", "count"]
    },
  • Dynamic registration of 'craftItems' skill (along with others) into the SkillRegistry via loadSkills function, using metadata to create SkillDefinition.
    for (const [skillName, metadata] of Object.entries(SKILL_METADATA)) {
        skills.push({
            name: skillName,
            description: metadata.description,
            inputSchema: {
                type: "object",
                properties: metadata.params,
                required: metadata.required
            },
            execute: createSkillExecutor(skillName)
        });
    }
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without disclosing behavioral traits. It doesn't mention if crafting consumes resources, requires specific permissions, has rate limits, or what happens on failure (e.g., insufficient materials). This is a significant gap for a mutation tool.

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, efficient sentence with zero waste. It front-loads the core action ('craft items') and provides essential context ('using a crafting table or inventory') without unnecessary details.

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

Completeness2/5

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

Given the complexity of a crafting operation with no annotations and no output schema, the description is incomplete. It lacks details on resource consumption, success/failure outcomes, and doesn't explain return values, making it inadequate for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage, fully describing 'count' and 'item' parameters. The description adds no additional meaning beyond the schema, such as examples of item names or constraints on count values, so it meets the baseline for high schema coverage.

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 ('craft items') and the context ('using a crafting table or inventory'), which distinguishes it from siblings like 'buildSomething' or 'smeltItem'. However, it doesn't specify what types of items can be crafted or differentiate from 'cookItem', leaving some ambiguity.

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?

No guidance is provided on when to use this tool versus alternatives like 'buildSomething' or 'cookItem'. The description mentions 'crafting table or inventory' but doesn't explain prerequisites, such as needing specific materials or access to these resources.

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

Related 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/leo4life2/minecraft-mcp-http'

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