Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

look-at

Directs a Minecraft bot to face specific coordinates in the game world. Use this tool to orient the character toward a target location for navigation, building, or interaction.

Instructions

Make the bot look at a specific position

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
xYesX coordinate
yYesY coordinate
zYesZ coordinate

Implementation Reference

  • The handler function for the 'look-at' tool. It takes x, y, z coordinates and uses the mineflayer bot's lookAt method to direct the bot's gaze to that position, returning a success message or error.
    async ({ x, y, z }): Promise<McpResponse> => {
      try {
        await bot.lookAt(new Vec3(x, y, z), true);
    
        return createResponse(`Looking at position (${x}, ${y}, ${z})`);
      } catch (error) {
        return createErrorResponse(error as Error);
      }
    }
  • Zod schema defining the input parameters for the 'look-at' tool: numeric x, y, z coordinates.
    {
      x: z.number().describe("X coordinate"),
      y: z.number().describe("Y coordinate"),
      z: z.number().describe("Z coordinate"),
    },
  • src/bot.ts:195-212 (registration)
    The registration of the 'look-at' tool using McpServer's tool method within the registerPositionTools function, including name, description, schema, and handler.
    server.tool(
      "look-at",
      "Make the bot look at a specific position",
      {
        x: z.number().describe("X coordinate"),
        y: z.number().describe("Y coordinate"),
        z: z.number().describe("Z coordinate"),
      },
      async ({ x, y, z }): Promise<McpResponse> => {
        try {
          await bot.lookAt(new Vec3(x, y, z), true);
    
          return createResponse(`Looking at position (${x}, ${y}, ${z})`);
        } catch (error) {
          return createErrorResponse(error as Error);
        }
      }
    );

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