Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

place-block

Place blocks at specific coordinates in Minecraft using X, Y, Z positions and face directions to build structures or modify terrain.

Instructions

Place a block at the specified position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate
faceDirectionNoDirection to place against (default: 'down')

Implementation Reference

  • The async handler function that implements the place-block tool logic: checks if position is free, defines possible faces for placement, prioritizes requested faceDirection, iterates over faces to find reference block, moves closer if can't see, looks at position, and attempts bot.placeBlock.
    async ({ x, y, z, faceDirection = 'down' }: { x: number, y: number, z: number, faceDirection?: FaceDirection }): Promise<McpResponse> => {
      try {
        const placePos = new Vec3(x, y, z);
        const blockAtPos = bot.blockAt(placePos);
        if (blockAtPos && blockAtPos.name !== 'air') {
          return createResponse(`There's already a block (${blockAtPos.name}) at (${x}, ${y}, ${z})`);
        }
    
        const possibleFaces: FaceOption[] = [
          { direction: 'down', vector: new Vec3(0, -1, 0) },
          { direction: 'north', vector: new Vec3(0, 0, -1) },
          { direction: 'south', vector: new Vec3(0, 0, 1) },
          { direction: 'east', vector: new Vec3(1, 0, 0) },
          { direction: 'west', vector: new Vec3(-1, 0, 0) },
          { direction: 'up', vector: new Vec3(0, 1, 0) }
        ];
    
        // Prioritize the requested face direction
        if (faceDirection !== 'down') {
          const specificFace = possibleFaces.find(face => face.direction === faceDirection);
          if (specificFace) {
            possibleFaces.unshift(possibleFaces.splice(possibleFaces.indexOf(specificFace), 1)[0]);
          }
        }
    
        // Try each potential face for placing
        for (const face of possibleFaces) {
          const referencePos = placePos.plus(face.vector);
          const referenceBlock = bot.blockAt(referencePos);
    
          if (referenceBlock && referenceBlock.name !== 'air') {
            if (!bot.canSeeBlock(referenceBlock)) {
              // Try to move closer to see the block
              const goal = new goals.GoalNear(referencePos.x, referencePos.y, referencePos.z, 2);
              await bot.pathfinder.goto(goal);
            }
    
            await bot.lookAt(placePos, true);
    
            try {
              await bot.placeBlock(referenceBlock, face.vector.scaled(-1));
              return createResponse(`Placed block at (${x}, ${y}, ${z}) using ${face.direction} face`);
            } catch (placeError) {
              console.error(`Failed to place using ${face.direction} face: ${(placeError as Error).message}`);
              continue;
            }
          }
        }
    
        return createResponse(`Failed to place block at (${x}, ${y}, ${z}): No suitable reference block found`);
      } catch (error) {
        return createErrorResponse(error as Error);
      }
    }
  • Zod input schema for the place-block tool defining required numeric coordinates x, y, z and optional faceDirection enum.
    {
      x: z.number().describe("X coordinate"),
      y: z.number().describe("Y coordinate"),
      z: z.number().describe("Z coordinate"),
      faceDirection: z.enum(['up', 'down', 'north', 'south', 'east', 'west']).optional().describe("Direction to place against (default: 'down')")
    },
  • src/bot.ts:341-404 (registration)
    Registration of the place-block tool via server.tool() call within registerBlockTools function, including name, description, schema, and inline handler.
    server.tool(
      "place-block",
      "Place a block at the specified position",
      {
        x: z.number().describe("X coordinate"),
        y: z.number().describe("Y coordinate"),
        z: z.number().describe("Z coordinate"),
        faceDirection: z.enum(['up', 'down', 'north', 'south', 'east', 'west']).optional().describe("Direction to place against (default: 'down')")
      },
      async ({ x, y, z, faceDirection = 'down' }: { x: number, y: number, z: number, faceDirection?: FaceDirection }): Promise<McpResponse> => {
        try {
          const placePos = new Vec3(x, y, z);
          const blockAtPos = bot.blockAt(placePos);
          if (blockAtPos && blockAtPos.name !== 'air') {
            return createResponse(`There's already a block (${blockAtPos.name}) at (${x}, ${y}, ${z})`);
          }
    
          const possibleFaces: FaceOption[] = [
            { direction: 'down', vector: new Vec3(0, -1, 0) },
            { direction: 'north', vector: new Vec3(0, 0, -1) },
            { direction: 'south', vector: new Vec3(0, 0, 1) },
            { direction: 'east', vector: new Vec3(1, 0, 0) },
            { direction: 'west', vector: new Vec3(-1, 0, 0) },
            { direction: 'up', vector: new Vec3(0, 1, 0) }
          ];
    
          // Prioritize the requested face direction
          if (faceDirection !== 'down') {
            const specificFace = possibleFaces.find(face => face.direction === faceDirection);
            if (specificFace) {
              possibleFaces.unshift(possibleFaces.splice(possibleFaces.indexOf(specificFace), 1)[0]);
            }
          }
    
          // Try each potential face for placing
          for (const face of possibleFaces) {
            const referencePos = placePos.plus(face.vector);
            const referenceBlock = bot.blockAt(referencePos);
    
            if (referenceBlock && referenceBlock.name !== 'air') {
              if (!bot.canSeeBlock(referenceBlock)) {
                // Try to move closer to see the block
                const goal = new goals.GoalNear(referencePos.x, referencePos.y, referencePos.z, 2);
                await bot.pathfinder.goto(goal);
              }
    
              await bot.lookAt(placePos, true);
    
              try {
                await bot.placeBlock(referenceBlock, face.vector.scaled(-1));
                return createResponse(`Placed block at (${x}, ${y}, ${z}) using ${face.direction} face`);
              } catch (placeError) {
                console.error(`Failed to place using ${face.direction} face: ${(placeError as Error).message}`);
                continue;
              }
            }
          }
    
          return createResponse(`Failed to place block at (${x}, ${y}, ${z}): No suitable reference block found`);
        } catch (error) {
          return createErrorResponse(error as Error);
        }
      }
    );
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Place a block' implies a write/mutation operation, but it doesn't specify whether this requires specific permissions, consumes inventory items, has cooldowns, or what happens if placement fails (e.g., obstructed location). This leaves significant behavioral gaps 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 that directly states the tool's function without unnecessary words. It's appropriately sized for a simple placement operation and front-loads the core action, making it easy to parse quickly.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after placement (success/failure indicators), inventory implications, or game mechanics constraints. Given the complexity of block placement in gaming contexts, more behavioral context is needed for effective agent use.

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%, providing complete documentation for all parameters (x, y, z coordinates and faceDirection with enum values). The description adds no additional parameter semantics beyond what's in the schema, so it meets the baseline but doesn't enhance understanding of parameter usage or constraints.

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 ('place') and resource ('block') with a specific location constraint ('at the specified position'), making the purpose immediately understandable. However, it doesn't distinguish this tool from potential alternatives like 'dig-block' or 'get-block-info' that also involve blocks, which prevents a perfect 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 'dig-block' (for removal) or 'get-block-info' (for inspection). It also doesn't mention prerequisites such as needing a block in inventory or being in a game mode that allows building, leaving the agent with insufficient context for appropriate tool selection.

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