Skip to main content
Glama

placeBlock

Place blocks at specific coordinates in Minecraft by specifying X, Y, Z positions and item names for remote server building.

Instructions

Place a block at the specified location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate
itemNameYesName of the item to place

Implementation Reference

  • Handler function that implements the placeBlock tool logic: validates connection, locates and equips the item, iterates over possible faces to find a suitable reference block, and places the block.
      async ({ x, y, z, itemName }) => {
        if (!botState.isConnected || !botState.bot) {
          return createNotConnectedResponse()
        }
    
        try {
          // Find item from inventory
          const item = botState.bot.inventory
            .items()
            .find((item) => item.name.toLowerCase() === itemName.toLowerCase())
    
          if (!item) {
            return createSuccessResponse(
              `Item "${itemName}" not found in inventory.`
            )
          }
    
          // Hold item in hand
          await botState.bot.equip(item, 'hand')
    
          // Get reference block and placement face for target position
          const targetPos = { x, y, z }
          const faceVectors = [
            { x: 0, y: 1, z: 0 }, // Up
            { x: 0, y: -1, z: 0 }, // Down
            { x: 1, y: 0, z: 0 }, // East
            { x: -1, y: 0, z: 0 }, // West
            { x: 0, y: 0, z: 1 }, // South
            { x: 0, y: 0, z: -1 }, // North
          ]
    
          // Check each face to see if placement is possible
          for (const faceVector of faceVectors) {
            const referencePos = {
              x: targetPos.x - faceVector.x,
              y: targetPos.y - faceVector.y,
              z: targetPos.z - faceVector.z,
            }
    
            const referenceBlock = botState.bot.blockAt(
              new Vec3(referencePos.x, referencePos.y, referencePos.z)
            )
    
            if (referenceBlock && referenceBlock.name !== 'air') {
              try {
                // Place the block
                await botState.bot.placeBlock(
                  referenceBlock,
                  new Vec3(faceVector.x, faceVector.y, faceVector.z)
                )
    
                return createSuccessResponse(
                  `Successfully placed ${itemName} at X=${x}, Y=${y}, Z=${z}`
                )
              } catch (err) {
                // If placement fails on this face, try the next face
                continue
              }
            }
          }
    
          // If placement fails on all faces
          return createSuccessResponse(
            `Failed to place ${itemName}. No suitable surface found or not enough space.`
          )
        } catch (error) {
          return createErrorResponse(error)
        }
      }
    )
  • Zod schema defining input parameters for placeBlock tool: coordinates (x,y,z) and itemName.
    {
      x: z.number().describe('X coordinate'),
      y: z.number().describe('Y coordinate'),
      z: z.number().describe('Z coordinate'),
      itemName: z.string().describe('Name of the item to place'),
    },
  • Registers the placeBlock tool using server.tool, specifying name, description, input schema, and handler function.
    server.tool(
      'placeBlock',
      'Place a block at the specified location',
  • Calls registerBlockTools which includes the placeBlock tool registration.
    registerBlockTools()
  • src/index.ts:7-7 (registration)
    Top-level call to registerAllTools, which triggers the chain leading to placeBlock registration.
    registerAllTools()
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. It states the action ('place') but doesn't clarify if this is a destructive operation, requires specific permissions, has side effects, or what happens on failure. For a mutation tool with zero annotation coverage, this is a significant gap.

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 gets straight to the point with zero wasted words. It's appropriately sized for a simple action and front-loads the core functionality.

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 insufficient. It doesn't explain what happens after placement, error conditions, or behavioral constraints. Given the complexity of placing blocks in what appears to be a game/world context, more context is needed.

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 all parameters clearly documented in the schema itself. The description adds no additional parameter information beyond what's already in the structured data, so it meets the baseline for adequate coverage without adding value.

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 location specificity ('at the specified location'), making the purpose immediately understandable. However, it doesn't differentiate from similar tools like 'digBlock' or 'craftItem' which might involve blocks in different ways.

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 'craftItem' (which might create blocks) or 'digBlock' (which removes them). There's no mention of prerequisites, context, or exclusions, leaving the agent to infer usage from the name alone.

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/nacal/mcp-minecraft-remote'

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