Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

find-entity

Locate the nearest entity of a specified type within Minecraft, with adjustable search distance parameters for precise targeting.

Instructions

Find the nearest entity of a specific type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeNoType of entity to find (empty for any entity)
maxDistanceNoMaximum search distance (default: 16)

Implementation Reference

  • Handler function that implements the 'find-entity' tool logic: filters entities by type, finds the nearest one within maxDistance using bot.nearestEntity, and returns its position.
    async ({ type = '', maxDistance = 16 }): Promise<McpResponse> => {
      try {
        const entityFilter = (entity: any) => {
          if (!type) return true;
          if (type === 'player') return entity.type === 'player';
          if (type === 'mob') return entity.type === 'mob';
          return entity.name && entity.name.includes(type.toLowerCase());
        };
    
        const entity = bot.nearestEntity(entityFilter);
    
        if (!entity || bot.entity.position.distanceTo(entity.position) > maxDistance) {
          return createResponse(`No ${type || 'entity'} found within ${maxDistance} blocks`);
        }
    
        return createResponse(`Found ${entity.name || (entity as any).username || entity.type} at position (${Math.floor(entity.position.x)}, ${Math.floor(entity.position.y)}, ${Math.floor(entity.position.z)})`);
      } catch (error) {
        return createErrorResponse(error as Error);
      }
    }
  • Input schema for the 'find-entity' tool using Zod: optional type (string) and maxDistance (number).
    {
      type: z.string().optional().describe("Type of entity to find (empty for any entity)"),
      maxDistance: z.number().optional().describe("Maximum search distance (default: 16)")
    },
  • src/bot.ts:499-528 (registration)
    Registration of the 'find-entity' tool via server.tool() inside the registerEntityTools function.
    function registerEntityTools(server: McpServer, bot: any) {
      server.tool(
        "find-entity",
        "Find the nearest entity of a specific type",
        {
          type: z.string().optional().describe("Type of entity to find (empty for any entity)"),
          maxDistance: z.number().optional().describe("Maximum search distance (default: 16)")
        },
        async ({ type = '', maxDistance = 16 }): Promise<McpResponse> => {
          try {
            const entityFilter = (entity: any) => {
              if (!type) return true;
              if (type === 'player') return entity.type === 'player';
              if (type === 'mob') return entity.type === 'mob';
              return entity.name && entity.name.includes(type.toLowerCase());
            };
    
            const entity = bot.nearestEntity(entityFilter);
    
            if (!entity || bot.entity.position.distanceTo(entity.position) > maxDistance) {
              return createResponse(`No ${type || 'entity'} found within ${maxDistance} blocks`);
            }
    
            return createResponse(`Found ${entity.name || (entity as any).username || entity.type} at position (${Math.floor(entity.position.x)}, ${Math.floor(entity.position.y)}, ${Math.floor(entity.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 mentions 'nearest' and 'specific type' but lacks details on permissions, rate limits, error handling, or what happens if no entity is found. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

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 with zero waste. It's appropriately sized and front-loaded, clearly stating the core functionality without unnecessary elaboration.

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 tool with no annotations and no output schema, the description is incomplete. It doesn't explain return values, error conditions, or how 'entity' relates to sibling tools, leaving the agent with insufficient context for reliable 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%, so the schema already documents both parameters ('type' and 'maxDistance') fully. The description adds no additional meaning beyond what's in the schema, such as clarifying 'entity' types or distance units. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the purpose ('Find the nearest entity of a specific type') which is clear but vague. It specifies the action (find) and resource (entity), but doesn't distinguish it from sibling tools like 'find-block' or 'find-item', leaving ambiguity about what an 'entity' encompasses in this context.

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 when to choose 'find-entity' over 'find-block' or 'find-item', nor does it specify prerequisites or exclusions, leaving usage context entirely implicit.

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