Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

find-block

Locate the nearest block of a specified type within a defined search radius in Minecraft. Use this tool to find resources, structures, or specific blocks for building and exploration.

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 searches for the nearest block of the specified type within maxDistance using bot.findBlock, using minecraftData to resolve block ID by name.
    async ({ blockType, maxDistance = 16 }): Promise<McpResponse> => {
      try {
        const mcData = minecraftData(bot.version);
        const blocksByName = mcData.blocksByName;
    
        if (!blocksByName[blockType]) {
          return createResponse(`Unknown block type: ${blockType}`);
        }
    
        const blockId = blocksByName[blockType].id;
    
        const block = bot.findBlock({
          matching: blockId,
          maxDistance: maxDistance
        });
    
        if (!block) {
          return createResponse(`No ${blockType} found within ${maxDistance} blocks`);
        }
    
        return createResponse(`Found ${blockType} at position (${block.position.x}, ${block.position.y}, ${block.position.z})`);
      } catch (error) {
        return createErrorResponse(error as Error);
      }
    }
  • Input schema for the 'find-block' tool using Zod: blockType (string, required), maxDistance (number, optional).
    {
      blockType: z.string().describe("Type of block to find"),
      maxDistance: z.number().optional().describe("Maximum search distance (default: 16)")
    },
  • src/bot.ts:462-494 (registration)
    Registration of the 'find-block' tool using server.tool() in registerBlockTools function, including inline schema and handler.
    server.tool(
      "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 }): Promise<McpResponse> => {
        try {
          const mcData = minecraftData(bot.version);
          const blocksByName = mcData.blocksByName;
    
          if (!blocksByName[blockType]) {
            return createResponse(`Unknown block type: ${blockType}`);
          }
    
          const blockId = blocksByName[blockType].id;
    
          const block = bot.findBlock({
            matching: blockId,
            maxDistance: maxDistance
          });
    
          if (!block) {
            return createResponse(`No ${blockType} found within ${maxDistance} blocks`);
          }
    
          return createResponse(`Found ${blockType} at position (${block.position.x}, ${block.position.y}, ${block.position.z})`);
        } 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 the full burden of behavioral disclosure. It states what the tool does but doesn't explain how it works—whether it searches in all directions, what 'nearest' means (e.g., Euclidean distance), what happens if no block is found, or if there are performance implications. This leaves significant gaps for an agent to understand the tool's behavior.

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 directly states the tool's purpose without unnecessary words. It's front-loaded and efficiently conveys the core functionality, 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?

Given the complexity of a search operation with no annotations and no output schema, the description is incomplete. It doesn't explain what the tool returns (e.g., coordinates, success/failure), error conditions, or behavioral details, leaving the agent with insufficient context to use it effectively.

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 ('blockType' and 'maxDistance') with clear descriptions. The description doesn't add any additional meaning beyond what's in the schema, such as examples of block types or context for distance units, so it 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 action ('Find') and target ('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 nearby objects, so it doesn't fully distinguish its specific domain.

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. There's no mention of prerequisites, when not to use it, or how it compares to similar tools like 'find-entity' or 'detect-gamemode' in the sibling list.

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