Skip to main content
Glama

Translate a Minecraft API symbol between eras

mc_translate

Suggests the equivalent method or class name when porting Minecraft mod code between versions 1.8.9 and 1.21+.

Instructions

Given a method or class name from one era, suggests the equivalent in the other era. Looks across both classes and method tasks. Useful when porting code between 1.8.9 and 1.21+.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolYesClass name, method call, or partial symbol
fromYes

Implementation Reference

  • src/index.ts:306-318 (registration)
    Registration of the mc_translate tool via server.registerTool with inputSchema and handler.
    server.registerTool(
      "mc_translate",
      {
        title: "Translate a Minecraft API symbol between eras",
        description:
          "Given a method or class name from one era, suggests the equivalent " +
          "in the other era. Looks across both classes and method tasks. Useful " +
          "when porting code between 1.8.9 and 1.21+.",
        inputSchema: {
          symbol: z.string().describe("Class name, method call, or partial symbol"),
          from: EraSchema,
        },
      },
  • The async handler function for mc_translate — translates a symbol between 1.8.9 and 1.21+ using curated CLASSES and METHODS tables.
      async ({ symbol, from }) => {
        // Curated tables only carry 1.8.9 / 1.21+ — collapse 26.1.x onto 1.21+.
        const fromCurated: CuratedEra = resolveCuratedEra(from);
        const to: CuratedEra = fromCurated === "1.8.9" ? "1.21+" : "1.8.9";
        const classMatches = fuzzyFind(
          CLASSES,
          (c) => `${c.concept} ${c[fromCurated].fqn}`,
          symbol,
          { topK: 4 },
        );
        const methodMatches = fuzzyFind(
          METHODS,
          (m) => `${m.task} ${m[fromCurated]}`,
          symbol,
          { topK: 4 },
        );
    
        const blocks: string[] = [];
        if (from === "26.1.x") {
          blocks.push(
            "_Curated translation tables don't yet have 26.1.x-specific entries — " +
              "showing 1.21+ equivalents. Use `mc_mojang_mappings` for authoritative " +
              "26.1.x class names._",
            "",
          );
        }
        if (classMatches.length) {
          blocks.push(`## Class translations (${fromCurated} → ${to})`);
          for (const { item: c } of classMatches) {
            blocks.push(`- **${c.concept}**: \`${c[fromCurated].fqn}\` → \`${c[to].fqn}\``);
          }
          blocks.push("");
        }
        if (methodMatches.length) {
          blocks.push(`## API translations (${fromCurated} → ${to})`);
          for (const { item: m } of methodMatches) {
            blocks.push(`### ${m.task}`);
            blocks.push(code("java", `// ${fromCurated}\n${m[fromCurated]}\n\n// ${to}\n${m[to]}`));
            if (m.notes) blocks.push(`> ${m.notes}`);
            blocks.push("");
          }
        }
        if (blocks.length === 0) {
          blocks.push(`No close matches for "${symbol}" coming from ${from}.`);
          blocks.push(
            "Try a class name (e.g. 'TileEntity', 'EntityPlayerMP') or an action ('send chat', 'register item').",
          );
        }
        return text(blocks.join("\n").trim());
      },
    );
  • Input schema for mc_translate requiring 'symbol' (string) and 'from' (EraSchema enum: 1.8.9, 1.21+, 26.1.x).
    {
      title: "Translate a Minecraft API symbol between eras",
      description:
        "Given a method or class name from one era, suggests the equivalent " +
        "in the other era. Looks across both classes and method tasks. Useful " +
        "when porting code between 1.8.9 and 1.21+.",
      inputSchema: {
        symbol: z.string().describe("Class name, method call, or partial symbol"),
        from: EraSchema,
      },
  • Imports of curated data tables (CLASSES, METHODS) and resolveCuratedEra used by the mc_translate handler.
    import {
      VERSIONS,
      CLASSES,
      METHODS,
      EVENTS,
      MIXIN_PATTERNS,
      GOTCHAS,
      YARN_TO_MOJANG,
      GRADLE_TEMPLATES,
      SCAFFOLD_KINDS,
      DATA_COMPONENTS,
      PACKET_PATTERNS,
      REGISTRY_PATTERNS,
      scaffold,
      resolveCuratedEra,
      type Era,
      type CuratedEra,
      type Loader,
    } from "./knowledge.js";
Behavior4/5

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

No annotations exist, so description carries full burden. It discloses that the tool 'suggests' equivalents and 'looks across both classes and method tasks', indicating a search behavior rather than a deterministic mapping. Could mention what happens if no equivalent is found.

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?

Two concise sentences with no fluff. First sentence immediately states the action, making it 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?

No output schema or return format description. 'Suggests the equivalent' is vague on return type. Could benefit from mentioning output format (e.g., string or object) and behavior for not found cases. Adequate but not complete.

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 covers 50% of parameters with descriptions. The description adds context about symbol being from one era and translating to another, but does not clarify that the 'from' parameter selects the source era and the output is the other era. With three era options, the mapping could be ambiguous.

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 tool translates Minecraft API symbols between eras, covering both classes and methods. It distinguishes from siblings like mc_mappings_translate by specifying cross-era translation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides a concrete use case: porting code between 1.8.9 and 1.21+. Does not explicitly exclude alternatives, but the context is clear enough for an agent to infer when to use.

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/ratph6/mc-mod-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server