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));
            }
          });
        }
      );
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.0.0
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observed

TDQS

A3.7/5.0
Behavior3/5

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

Without annotations, the description must disclose behavior. It indicates a read operation, but does not mention permissions, cost, or side effects. Adequate for a simple getter.

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?

Single, clear sentence with no unnecessary words.

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?

No output schema and no description of return format (e.g., coordinates, orientation). Leaves ambiguity about what the agent receives.

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

Parameters5/5

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

No parameters exist, and schema coverage is 100%. The description adds no parameter details, but none are needed.

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

Purpose5/5

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

The description clearly states the verb 'Get' and the resource 'current position', which is distinct from sibling tools like 'get-block-info' and movement commands.

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?

No explicit guidance on when to use or not use this tool compared to alternatives like 'fly-to' or 'move-to-position'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.