Skip to main content
Glama

read_bin_table

Decode Diablo II .bin table records field by field using 1.14d layouts to inspect stored values, linked codes, and column layouts.

Instructions

Decode the records of a compiled Diablo II data table (.bin, e.g. data\global\excel\weapons.bin) field by field, using the 1.14d field layouts of github.com/Nugwa628/d2-114d-codex (cloned into the data folder). path: a .bin file on the local disk, or an MPQ archive with member= the .bin's name inside it; the file name picks the layout, so pass the file under its game name. start, limit: which records (from 0; at most 20 per call, 50 with columns=; a long reply stops early and says where to carry on). key: instead, the record whose key code is this (e.g. 'hax' in weapons.bin; tables keyed by a code only). columns: only these columns (a list, or names separated by commas), shown even when 0; otherwise every field that isn't 0, empty or -1. layout=True: list the table's columns with offset, type and link instead of records. The file is checked first: count x the 1.14d record size must be exactly the bytes after the count, or it is refused. A file from another version with the same record size would still decode wrongly: say which game version the file comes from. Links to code-keyed tables (item types, items, body locations...) show the linked code, read from that table's .bin beside the file or in the same MPQ folder; links to name-keyed tables (skills, monsters, states...) show the index only, since a .bin keeps no names. String ids are numbers (look them up with read_strings; 5382 means no string); formula fields are offsets into the *code.bin buffer, not decoded; fields a table-specific callback writes (cubemain inputs and outputs, monstats skill modes, monstats2 composite choices, monpreset Place) show the parts of their slot that the codex's callbacks.md gives, as stored indexes. The layouts don't record sign: a large 2- or 4-byte value also shows its signed reading. Values are as stored in the file, before the fix-ups the game makes after loading. For the record count and size of any version's file, use bin_table_info.

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": {
      "path": "<path>"
    },
    "name": "read_bin_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyNo
pathYes
limitNo
startNo
layoutNo
memberNo
columnsNo

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 unusually well: it discloses the validation rule ('count x the 1.14d record size must be exactly the bytes after the count, or it is refused'), a hard paging cap with early-stop behavior ('at most 20 per call, 50 with columns=; a long reply stops early and says where to carry on'), and the version-compatibility caveat that a same-record-size file from another version still decodes wrongly. It further discloses how links resolve, that string ids are numeric indexes, that formula fields are undecoded offsets, and that values are pre-fix-up as stored.

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 core action and essentially filler-free — nearly every clause carries a constraint, default, or caveat that isn't in the schema. The drawback is structure: roughly 300 words delivered as one dense paragraph with no line breaks or grouping, which makes the per-parameter guidance harder to scan than it needs to be.

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?

For a seven-parameter decoding tool with no annotations, this is complete: validation behavior, paging limits, alternative selection modes, link resolution semantics, and known decode limitations are all covered, and an output schema exists so return shape need not be spelled out. Nothing an agent needs in order to call it correctly — or to avoid a wrong decode — is 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 for all seven parameters — and it does, one by one: path (local .bin or MPQ archive), member (.bin name inside the archive), start and limit (record range plus the 20/50 cap), key (key code such as 'hax', with the constraint that it works only for code-keyed tables), columns (list or comma-separated, 'shown even when 0'), and layout (boolean that lists columns instead of records). It even explains the consequence of naming: 'the file name picks the layout, so pass the file under its game name.'

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 — 'Decode the records of a compiled Diablo II data table (.bin)' — and anchors it with a concrete example path (data\global\excel\weapons.bin) and the layout source. It closes by differentiating itself from the sibling bin_table_info ('For the record count and size of any version's file, use bin_table_info'), so an agent can route between the two without opening either schema.

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?

Rich routing guidance: 'instead' names alternatives for record selection (use key instead of start/limit), layout=True is described as a mode that replaces record listing, and bin_table_info is named for a specific adjacent purpose. It also states the version precondition ('say which game version the file comes from'). What's missing is any explicit when-not-to-use against other file readers like mpq_read or read_game_data, but the context is otherwise clear.

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