Skip to main content
Glama

get-block-info

Retrieve detailed information about Minecraft blocks by providing their exact coordinates in the game world.

Instructions

Get information about a block at the specified position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate

Implementation Reference

  • The asynchronous handler function that implements the core logic of the 'get-block-info' tool. It retrieves the bot, gets the block at the specified position, and returns information about the block or a no-block message.
    async ({ x, y, z }) => {
      const bot = getBot();
      const blockPos = new Vec3(x, y, z);
      const block = bot.blockAt(blockPos);
    
      if (!block) {
        return factory.createResponse(`No block information found at position (${x}, ${y}, ${z})`);
      }
    
      return factory.createResponse(`Found ${block.name} (type: ${block.type}) at position (${block.position.x}, ${block.position.y}, ${block.position.z})`);
    }
  • The Zod schema defining the input parameters for the 'get-block-info' tool: x, y, z coordinates.
    {
      x: z.number().describe("X coordinate"),
      y: z.number().describe("Y coordinate"),
      z: z.number().describe("Z coordinate"),
    },
  • The factory.registerTool call that registers the 'get-block-info' tool, including its name, description, input schema, and handler function.
    factory.registerTool(
      "get-block-info",
      "Get information about 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) {
          return factory.createResponse(`No block information found at position (${x}, ${y}, ${z})`);
        }
    
        return factory.createResponse(`Found ${block.name} (type: ${block.type}) at position (${block.position.x}, ${block.position.y}, ${block.position.z})`);
      }
    );
  • src/main.ts:53-53 (registration)
    The call to registerBlockTools in the main application, which includes the registration of 'get-block-info' among other block tools.
    registerBlockTools(factory, getBot);

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