Skip to main content
Glama

find-block

Locate the nearest block of a specified type within a defined search radius in Minecraft.

Instructions

Find the nearest block of a specific type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockTypeYesType of block to find
maxDistanceNoMaximum search distance (default: 16)

Implementation Reference

  • The handler function for the 'find-block' tool. It resolves the block type ID from minecraft-data, uses bot.findBlock to locate the nearest matching block within maxDistance, and returns the position if found.
    async ({ blockType, maxDistance = 16 }) => {
      const bot = getBot();
      const mcData = minecraftData(bot.version);
      const blocksByName = mcData.blocksByName;
    
      if (!blocksByName[blockType]) {
        return factory.createResponse(`Unknown block type: ${blockType}`);
      }
    
      const blockId = blocksByName[blockType].id;
    
      const block = bot.findBlock({
        matching: blockId,
        maxDistance: maxDistance
      });
    
      if (!block) {
        return factory.createResponse(`No ${blockType} found within ${maxDistance} blocks`);
      }
    
      return factory.createResponse(`Found ${blockType} at position (${block.position.x}, ${block.position.y}, ${block.position.z})`);
    }
  • Zod schema for 'find-block' tool inputs: required blockType (string) and optional maxDistance (number).
    {
      blockType: z.string().describe("Type of block to find"),
      maxDistance: z.number().optional().describe("Maximum search distance (default: 16)")
    },
  • Registration of the 'find-block' tool in the ToolFactory, including name, description, schema, and handler.
    factory.registerTool(
      "find-block",
      "Find the nearest block of a specific type",
      {
        blockType: z.string().describe("Type of block to find"),
        maxDistance: z.number().optional().describe("Maximum search distance (default: 16)")
      },
      async ({ blockType, maxDistance = 16 }) => {
        const bot = getBot();
        const mcData = minecraftData(bot.version);
        const blocksByName = mcData.blocksByName;
    
        if (!blocksByName[blockType]) {
          return factory.createResponse(`Unknown block type: ${blockType}`);
        }
    
        const blockId = blocksByName[blockType].id;
    
        const block = bot.findBlock({
          matching: blockId,
          maxDistance: maxDistance
        });
    
        if (!block) {
          return factory.createResponse(`No ${blockType} found within ${maxDistance} blocks`);
        }
    
        return factory.createResponse(`Found ${blockType} at position (${block.position.x}, ${block.position.y}, ${block.position.z})`);
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions 'nearest block' and 'search distance' but doesn't explain what 'nearest' means (e.g., from current position), how the search works (e.g., 3D radius), what happens if no block is found, or any performance/rate limit considerations. This leaves significant gaps for a tool that performs spatial searches.

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, clear sentence that efficiently communicates the core functionality without any wasted words. It's appropriately sized for a simple search tool and gets straight to the point.

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 spatial search tool with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., coordinates, block info, or just success/failure), error conditions, or behavioral details. Given the complexity of spatial searching and lack of structured data, 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%, so the schema already documents both parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema (e.g., it doesn't explain valid block types or distance units). This 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 verb ('find') and resource ('nearest block of a specific type'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'find-entity' or 'find-item' which also search for things, leaving room for confusion about when to choose this specific block-finding tool.

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 sibling tools like 'find-entity' or 'find-item', nor does it specify prerequisites (e.g., needing to be in a game world) or exclusions. Usage context is implied but not explicitly stated.

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