Skip to main content
Glama
zeeweebee

Minecraft MCP Server

by zeeweebee

get-position

Retrieve the current coordinates of your Minecraft character to track movement, navigate the world, or execute location-based actions.

Instructions

Get the current position of the bot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that retrieves the bot's current position (floored coordinates) and returns a formatted text response.
    async (): Promise<McpResponse> => {
      try {
        const position = bot.entity.position;
        const pos = {
          x: Math.floor(position.x),
          y: Math.floor(position.y),
          z: Math.floor(position.z)
        };
    
        return createResponse(`Current position: (${pos.x}, ${pos.y}, ${pos.z})`);
      } catch (error) {
        return createErrorResponse(error as Error);
      }
    }
  • src/bot.ts:154-172 (registration)
    Registers the 'get-position' tool on the MCP server with empty input schema and inline handler.
    server.tool(
      "get-position",
      "Get the current position of the bot",
      {},
      async (): Promise<McpResponse> => {
        try {
          const position = bot.entity.position;
          const pos = {
            x: Math.floor(position.x),
            y: Math.floor(position.y),
            z: Math.floor(position.z)
          };
    
          return createResponse(`Current position: (${pos.x}, ${pos.y}, ${pos.z})`);
        } catch (error) {
          return createErrorResponse(error as Error);
        }
      }
    );
  • src/bot.ts:140-140 (registration)
    Invocation of registerPositionTools which includes the get-position tool registration.
    registerPositionTools(server, bot);
  • Helper function that registers position-related tools, including 'get-position'.
    function registerPositionTools(server: McpServer, bot: any) {
      server.tool(
        "get-position",
        "Get the current position of the bot",
        {},
        async (): Promise<McpResponse> => {
          try {
            const position = bot.entity.position;
            const pos = {
              x: Math.floor(position.x),
              y: Math.floor(position.y),
              z: Math.floor(position.z)
            };
    
            return createResponse(`Current position: (${pos.x}, ${pos.y}, ${pos.z})`);
          } catch (error) {
            return createErrorResponse(error as Error);
          }
        }
      );
    
      server.tool(
        "move-to-position",
        "Move the bot to a specific position",
        {
          x: z.number().describe("X coordinate"),
          y: z.number().describe("Y coordinate"),
          z: z.number().describe("Z coordinate"),
          range: z.number().optional().describe("How close to get to the target (default: 1)")
        },
        async ({ x, y, z, range = 1 }): Promise<McpResponse> => {
          try {
            const goal = new goals.GoalNear(x, y, z, range);
            await bot.pathfinder.goto(goal);
    
            return createResponse(`Successfully moved to position near (${x}, ${y}, ${z})`);
          } catch (error) {
            return createErrorResponse(error as Error);
          }
        }
      );
    
      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);
          }
        }
      );
    
      server.tool(
        "jump",
        "Make the bot jump",
        {},
        async (): Promise<McpResponse> => {
          try {
            bot.setControlState('jump', true);
            setTimeout(() => bot.setControlState('jump', false), 250);
    
            return createResponse("Successfully jumped");
          } catch (error) {
            return createErrorResponse(error as Error);
          }
        }
      );
    
      server.tool(
        "move-in-direction",
        "Move the bot in a specific direction for a duration",
        {
          direction: z.enum(['forward', 'back', 'left', 'right']).describe("Direction to move"),
          duration: z.number().optional().describe("Duration in milliseconds (default: 1000)")
        },
        async ({ direction, duration = 1000 }: { direction: Direction, duration?: number }): Promise<McpResponse> => {
          return new Promise((resolve) => {
            try {
              bot.setControlState(direction, true);
    
              setTimeout(() => {
                bot.setControlState(direction, false);
                resolve(createResponse(`Moved ${direction} for ${duration}ms`));
              }, duration);
            } catch (error) {
              bot.setControlState(direction, false);
              resolve(createErrorResponse(error as Error));
            }
          });
        }
      );
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves position but doesn't specify what 'position' entails (e.g., coordinates, orientation), whether it's real-time or cached, or any side effects. For a tool with zero annotation coverage, this is insufficient.

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 with zero waste. It's front-loaded with the core purpose and avoids redundancy, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema), the description is minimally adequate but lacks depth. It doesn't explain the return value (e.g., format of position data) or behavioral context, which would be helpful despite the low complexity. With no annotations, it should do more to compensate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, earning a baseline score of 4 for not adding unnecessary information beyond the schema.

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 tool's purpose with a specific verb ('Get') and resource ('current position of the bot'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'move-to-position' or 'fly-to', which are related to position manipulation rather than retrieval.

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 prerequisites, context (e.g., use for navigation checks), or exclusions (e.g., not for movement). With siblings like 'move-to-position' and 'fly-to', this lack of differentiation is a notable gap.

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