Skip to main content
Glama

json_to_tbl

Convert a JSON string list into a Diablo II .tbl string table, building the index, hash table and CRC-16 the game checks, then verifying every key by lookup before writing the file.

Instructions

Build a Diablo II string table (.tbl) from a JSON file on the local disk. json: the path of a .json as tbl_to_json writes it, or simply a list of {"key": ..., "text": ...} objects; the order of the entries is the string numbering. out: the .tbl to write (name it string.tbl, expansionstring.tbl or patchstring.tbl for the game to load it); an existing file is refused unless overwrite is true. Builds the index, the hash table (strings placed in number order, as the game's own files are) and the CRC-16 the game checks. "hash_size" and "max_tries" in the JSON are optional: by default the hash table is the next prime above the string count and the lookup limit exactly what the placement needs; a limit given too low is raised. The result is read back and every key looked up the way the game does before the reply. Limits: 65,535 strings, 65,534 bytes of text each; a key repeated in one file is found at its first entry only. Not tested in the game itself.

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": {
      "json": "<json>",
      "out": "<out>"
    },
    "name": "json_to_tbl"
  }
}

Input Schema

NameRequiredDescriptionDefault
outYes
jsonYes
overwriteNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses the overwrite refusal behavior, that the index/hash table/CRC-16 are all generated, that the result is read back and every key re-looked-up before replying, hard limits (65,535 strings, 65,534 bytes of text), duplicate-key handling, and the honest caveat 'Not tested in the game itself.' These are exactly the traits an agent cannot infer from structured fields.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the purpose and then parameter-by-parameter, which is easy to scan. It is dense but nearly every clause earns its place; only phrases like 'the lookup limit exactly what the placement needs' are slightly awkward and could be tightened.

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?

An output schema exists, so return values need not be described, and the description still covers inputs, defaults, limits, failure modes, and validation behavior. For a file-mutating conversion tool with no annotations, nothing an agent needs in order to call it correctly appears to be missing.

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?

Schema description coverage is 0%, so the description must compensate entirely, and it does: json is explained as either tbl_to_json output or a plain list of {key, text} objects with order defining string numbering; out is explained with load-relevant filenames; overwrite is tied to the refusal behavior. It also documents the optional in-JSON hash_size and max_tries and their defaults, which the schema does not surface at all.

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 and resource — 'Build a Diablo II string table (.tbl) from a JSON file on the local disk' — which immediately distinguishes it from the inverse sibling tbl_to_json. The scope (local disk, .tbl output) is unambiguous.

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?

Guidance is clear but implicit: 'json: the path of a .json as tbl_to_json writes it' establishes the round-trip pairing with the sibling, and the naming hint (string.tbl / expansionstring.tbl / patchstring.tbl) tells the agent what output the game will actually load. There is no explicit 'use this instead of X when...' exclusion, so it falls short of a 5.

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