Skip to main content
Glama

dig-block

Remove blocks at specific coordinates in Minecraft to clear terrain, create openings, or gather resources for building and exploration.

Instructions

Dig a block at the specified position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate

Implementation Reference

  • Handler function for the 'dig-block' tool. It retrieves the bot, checks for a block at the given coordinates, navigates if necessary, digs the block, and returns a success message.
    async ({ x, y, z }) => {
      const bot = getBot();
      const blockPos = new Vec3(x, y, z);
      const block = bot.blockAt(blockPos);
    
      if (!block || block.name === 'air') {
        return factory.createResponse(`No block found at position (${x}, ${y}, ${z})`);
      }
    
      if (!bot.canDigBlock(block) || !bot.canSeeBlock(block)) {
        const goal = new goals.GoalNear(x, y, z, 2);
        await bot.pathfinder.goto(goal);
      }
    
      await bot.dig(block);
      return factory.createResponse(`Dug ${block.name} at (${x}, ${y}, ${z})`);
    }
  • Zod input schema for 'dig-block' tool defining required numeric parameters x, y, z coordinates.
    {
      x: z.number().describe("X coordinate"),
      y: z.number().describe("Y coordinate"),
      z: z.number().describe("Z coordinate"),
    },
  • Registration of the 'dig-block' tool using ToolFactory.registerTool, including name, description, schema, and inline handler function.
    factory.registerTool(
      "dig-block",
      "Dig a block at the specified position",
      {
        x: z.number().describe("X coordinate"),
        y: z.number().describe("Y coordinate"),
        z: z.number().describe("Z coordinate"),
      },
      async ({ x, y, z }) => {
        const bot = getBot();
        const blockPos = new Vec3(x, y, z);
        const block = bot.blockAt(blockPos);
    
        if (!block || block.name === 'air') {
          return factory.createResponse(`No block found at position (${x}, ${y}, ${z})`);
        }
    
        if (!bot.canDigBlock(block) || !bot.canSeeBlock(block)) {
          const goal = new goals.GoalNear(x, y, z, 2);
          await bot.pathfinder.goto(goal);
        }
    
        await bot.dig(block);
        return factory.createResponse(`Dug ${block.name} at (${x}, ${y}, ${z})`);
      }
    );
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the action ('dig') which implies a destructive mutation, but doesn't disclose behavioral traits like whether it requires specific permissions, what happens to the dug block (e.g., drops items, disappears), rate limits, or error conditions (e.g., if block is unbreakable). The description is minimal and lacks critical operational context.

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 that front-loads the core action ('Dig a block') and specifies the targeting ('at the specified position'). There is zero waste, and it's appropriately sized for a simple tool with well-documented parameters.

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 tool's complexity (destructive mutation with no annotations and no output schema), the description is incomplete. It doesn't explain what 'dig' entails (e.g., block removal, item drops), success/failure conditions, or return values. For a mutation tool with zero annotation coverage, this leaves significant gaps for an AI agent to operate correctly.

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?

Schema description coverage is 100%, with clear parameter descriptions for x, y, z as coordinates. The description adds no additional meaning beyond the schema, such as coordinate system details (e.g., world vs. local) or units. Baseline is 3 since the schema adequately documents parameters, but the description doesn't compensate with extra context.

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 'Dig a block at the specified position' clearly states the action (dig) and resource (block) with positional targeting. It distinguishes from siblings like 'place-block' (opposite action) and 'find-block' (detection vs. modification), though it doesn't explicitly mention these distinctions. The purpose is specific and unambiguous.

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. It doesn't mention prerequisites (e.g., needing a tool, being near the block), exclusions (e.g., cannot dig certain blocks), or sibling tools like 'get-block-info' for checking before digging or 'place-block' for reversing the action. Usage is implied but not articulated.

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

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