Skip to main content
Glama
@adhisang/minecraft-modding-mcp

@adhisang/minecraft-modding-mcp

by adhi-jp

nbt-encode

Read-only

Converts typed NBT JSON documents into Java Edition NBT bytes as base64, uncompressed or gzip, enabling round-trip with nbt-decode. Malformed documents fail with a node-specific error.

Instructions

Encode a typed NBT JSON document, as nbt-decode returns it, into Java Edition NBT bytes as base64, uncompressed or gzip. A malformed document fails with ERR_NBT_INVALID_TYPED_JSON naming the node. Example: {"typedJson":{"rootName":"R","root":{"type":"compound","value":{"answer":{"type":"int","value":42}}}},"compression":"gzip"}

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "typedJson": "<typedJson>"
    },
    "name": "nbt-encode"
  }
}

Input Schema

NameRequiredDescriptionDefault
typedJsonYesTyped NBT document {rootName, root}; every node is {type, value}, as nbt-decode returns.
compressionNogzip compresses the output.none

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv9.0.0-rc.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already establish a non-destructive, non-open-world operation, so the lower bar applies; the description still adds real context: output is base64-encoded bytes, compression is optional, and malformed input fails with ERR_NBT_INVALID_TYPED_JSON identifying the offending node. It does not discuss limits on output size or performance, which keeps it short of a 5.

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?

Three tight sentences: capability and output form first, then error behavior, then a concrete example. No filler, and the front-loaded verb+resource makes the first clause sufficient to route the tool.

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

Completeness5/5

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

With no output schema, the description must convey what comes back, and it does: base64-encoded NBT bytes, optionally gzip-compressed. Error semantics and the input document shape are both covered, which is everything an agent needs to invoke and recover from failure on this two-parameter tool.

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 coverage is 100% with descriptions on both properties and an enum for compression, so the schema already carries the parameter meaning. The description's contribution beyond that is mainly the worked example showing a valid typedJson payload and a gzip compression value, which is helpful but reinforces rather than extends the schema.

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?

States a specific verb (encode) and resource (typed NBT JSON document) with the exact output form (Java Edition NBT bytes as base64, compressed or not). It also anchors the tool to its inverse, 'as nbt-decode returns it', which distinguishes it from the sibling nbt-decode/nbt-patch tools without needing their schemas.

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?

The description makes the use case clear by tying the input format to nbt-decode's output, so an agent knows this is the serialization path back to NBT bytes. It does not explicitly say when to choose it over siblings or note exclusions, but the round-trip framing leaves little ambiguity.

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