Skip to main content
Glama

It answers questions such as what a column in a data file does, what a row holds in each patch, where a function is defined in the game's reconstructed source, and what a patch's binary really does. Every result says which game version it's about.

The repository holds code only. It ships no game files, data tables or site content: each group of tools fetches or reads its own data, as set out below.

Use it now

There's a public server with the data already loaded, free and with no key or sign-in:

https://mcp.diablo2.org
  • Claude (web, desktop, mobile): Settings → Connectors → Add custom connector, and paste the URL.

  • Claude Code: claude mcp add --transport http d2 https://mcp.diablo2.org

  • Any other MCP client: add it as a remote server using streamable HTTP.

It offers every tool below except the mod check, archive, sprite and save tools, which work on files on your own disk; install it locally for those. Your assistant runs the tools, so there's nothing to pay and nothing to set up. The server is read-only.

Related MCP server: wow-vanilla-mcp

Tools

Knowledge base (diablo2.org: the Phrozen Keep's articles and file guides, the site's own pages, the download catalogue)

  • search_knowledge_base: search articles, by category if you like.

  • read_article: read one, by section or in parts.

  • lookup_column: what a column of a data file does, in every version's file guide and the D2R Data Guide.

  • read_d2r_guide: the D2R Data Guide's page for one data file.

  • search_downloads, get_download: the download catalogue (mods, tools, plugins, patches).

Data tables (the game's .txt tables, by patch)

  • search_game_data: find rows containing some text.

  • read_game_data: one row, column by column, in one patch or compared across all of them.

  • diff_tables: what changed in a table between two patches, matched by row key.

  • game_data_coverage: which versions and tables are loaded.

Source code (game and server reconstructions, 1.14d research specs and Rust reimplementation, and D2R modding repositories)

  • find_symbol: where a function, struct, enum value or macro is defined.

  • search_code: lines containing every word of a query in code, specs and notes.

  • read_code: lines of a file, with a permalink and the source's game version where given.

  • compare_versions: a diff between version branches, for a source that has them.

  • read_d2r_json: a D2R JSON file (UI layout, item art map, strings) by key.

  • d2moo_pull_requests: D2MOO's open pull requests and their diffs.

Decompiled binaries (Ghidra output)

  • decomp_search: a string, constant or function name in one patch's binaries.

  • decomp_function: one function's decompiled C, by name or address.

Calculator

  • calculate: a sandboxed calculator for odds, expected values, breakpoints and small simulations.

Mod check (a mod's tables on your own disk; see docs/modcheck.md)

  • mod_changes: what a mod's tables change from a vanilla version, table by table or row by row.

  • lint_tables: what's broken in a set of tables: bad references, malformed cells, column and row problems.

Archives (MPQ archives and string tables on your own disk; see docs/archives.md)

  • mpq_list, mpq_read, mpq_extract: list an MPQ, read one file in it, or extract files by name or pattern.

  • mpq_create: build an MPQ from a folder.

  • read_strings: look up or search the game's strings in .tbl files or an MPQ.

  • tbl_to_json, json_to_tbl: convert a string table to editable JSON and back.

  • check_strings: check a mod's Resurrected string files against the game's: placeholders that would crash, ids that collide in their low 16 bits, missing languages, broken colour codes; gives the next free id.

  • bin_table_info: what a compiled .bin data table holds.

  • read_bin_table: a compiled .bin table's records field by field, with the 1.14d layouts from d2-114d-codex.

Sprites (DC6, DCC and COF files on your own disk; see docs/sprites.md)

  • sprite_info: what a sprite or COF holds: directions, frames, sizes, offsets, layers, warnings.

  • sprite_to_png: decode a DC6 or DCC to PNG, one frame or a sheet, optionally through a colour-shift table.

  • png_to_dc6, png_to_dcc: encode PNG frames as a DC6 or DCC against a palette.

Drops (exact odds from a table set's treasure classes, 1.10 rules onward, and the chance to hit; see docs/dropcalc.md)

  • drop_chances: what a monster, super unique, boss or treasure class drops and how often, by difficulty, players, party and magic find.

  • monster_stats: a monster's life, defence, experience and attacks by difficulty and players.

  • item_affixes: which magic or rare affixes an item can roll at an item level, and how likely each is.

  • hit_chance: the chance an attack hits, from attack rating, defence and both levels (or a monster's), and the smallest attack rating that reaches a chance.

Breakpoints (from your own animdata.d2 and tables; see docs/breakpoints.md)

  • frame_breakpoints: a character's, form's or mercenary's FCR, FHR or FBR table.

  • attack_speed: frames per attack for a character, weapon and skill, and the IAS breakpoints.

Internals (one function across game versions, from your own Ghidra output; see docs/internals.md)

  • function_across_versions: a function's counterpart in other versions, with a confidence and the evidence. It declines rather than guesses, so many functions get no match.

  • function_fingerprint: what the index recorded for one function.

  • function_index_status: which versions are indexed.

Saves (a character save on your own disk, read with an imported table set's widths; see docs/saves.md)

  • inspect_save: what a .d2s holds: header and checksum, character, progress, mercenary, stats, class skills, and every item for Legacy version 96 saves (Resurrected version 105: all but the item records). Read-only.

Groups beyond the calculator live in their own modules (d2mcp/tools_<group>.py) and read files at paths you give them, so a hosted server can leave them out with groups=.

Install

Needs Python 3.10 or later, and git on the PATH for the source code tools.

git clone https://github.com/diablo2org/D2-MCP.git
cd D2-MCP
python3 -m venv .venv
.venv/bin/pip install -e .

Run

.venv/bin/python -m d2mcp      # or: .venv/bin/d2-mcp

It speaks MCP over stdio, so normally an MCP client starts it. Any client works. With Claude Code:

claude mcp add d2 --env D2MCP_DATA_DIR=/path/to/data -- /path/to/D2-MCP/.venv/bin/python -m d2mcp

Or in a client's JSON configuration:

{
  "mcpServers": {
    "d2": {
      "command": "/path/to/D2-MCP/.venv/bin/python",
      "args": ["-m", "d2mcp"],
      "env": { "D2MCP_DATA_DIR": "/path/to/data" }
    }
  }
}

Settings are environment variables:

Variable

What it does

Default

D2MCP_DATA_DIR

Where everything fetched or built is kept.

./data under the current directory

DECOMP_DIR

Your folder of Ghidra output, for the decompiled binaries tools.

not set

D2MCP_REFRESH

0 turns the background downloads off.

on

DIABLO2_ORG_URL

The site the knowledge base comes from.

https://diablo2.org

D2MCP_USER_AGENT

The User-Agent sent to diablo2.org and GitHub.

D2-MCP/<version>

The server starts with no data at all. A tool whose data is missing says it isn't set up.

Host it

--http serves the same tools over HTTP (MCP's streamable HTTP transport, at /mcp), so people can add the server by URL with nothing to install:

D2MCP_ALLOWED_HOSTS=mcp.example.org .venv/bin/python -m d2mcp --http --host 0.0.0.0 --port 8000

Setting

What it does

Default

--host, --port (or D2MCP_HOST, D2MCP_PORT)

Where it listens. Put a TLS proxy in front of it.

127.0.0.1, 8000

D2MCP_ALLOWED_HOSTS

The public host name(s), comma-separated. Requests for any other Host are refused (DNS-rebinding protection).

unset: no check

D2MCP_HTTP_PATH

The path MCP is served at; / serves it at the bare URL.

/mcp

D2MCP_GROUPS

The tool groups to offer, comma-separated.

every group except modcheck, archives and sprites

The mod check, archive, sprite and save tools read and write files at paths the caller gives, which on a hosted server would be the server's own disk, so they're left out unless you list them. The server is stateless, so it can run several copies behind a load balancer. Clients connect with the URL, for example claude mcp add --transport http d2 https://mcp.example.org/mcp.

Data

Everything lives in the data folder. The first start with background refresh on fetches the knowledge base and clones the code repositories, which takes a few minutes and about 500 MB. After that, a restart loads from disk and fetches nothing: each job records when it last ran in .refreshed/, so several servers can share one data folder.

Group

Where the data comes from

Kept in

Knowledge base

Fetched from diablo2.org's public endpoints (/llms-kb.txt, /llms-full.txt, /api/kb, /api/downloads), every 6 hours.

library/

D2R Data Guide

Clone it yourself: git clone https://github.com/ThePhrozenKeep/D2R-RotW-DataGuide data/repos/D2R-RotW-DataGuide.

repos/

1.14d .bin field layouts

Clone it yourself: git clone https://github.com/Nugwa628/d2-114d-codex data/repos/d2-114d-codex (specs CC BY 4.0, read in place; builds on Legbreak's Iblis Codex). Only read_bin_table uses it.

repos/

Source code

Shallow GitHub clones, updated daily. Legacy and servers: D2MOO, Redivivus, d2hausos, PvPGN, d2-dedicated-server, Iblis Codex (Legbreak's 1.14d reconstruction, MIT), d2-114d-codex (1.14d specs CC BY 4.0, Ghidra tools MIT, builds on Legbreak's Iblis Codex), d2gamma (1.14d Rust reimplementation, MIT). Resurrected: D2RMM and its mods, D2RVanillaFIles, ModdingDiablo2Resurrected, D2RL-Plugins, SpriteEdit, d2rAI-toolkit (engine, format and mechanics notes and Python modding tools, MIT).

<name>_repo/

Data tables, Legacy

Your own game files. Nothing is downloaded. See below.

gamedata/<version>/

Data tables, Resurrected

Converted from a clone of blizzhackers/d2data. See below.

gamedata/d2r/, gamedata/d2r-base/

Decompiled binaries

Your own Ghidra output. Nothing is downloaded. See below.

wherever DECOMP_DIR points

Saves

Your own .d2s files, read where they are; stat widths and item bases from an imported table set. Nothing is downloaded or kept.

nowhere

Data tables

Import each version's tables from your own copy of the game: a folder of the .txt files from data/global/excel, a .zip of them, or an MPQ that holds them (patch_d2.mpq, d2exp.mpq).

D2MCP_DATA_DIR=/path/to/data .venv/bin/python -m d2mcp.tables import 1.13c /path/to/patch_d2.mpq
D2MCP_DATA_DIR=/path/to/data .venv/bin/python -m d2mcp.tables import 1.10 /path/to/folder-of-txt

The version is the name the tools will use (1.09d, 1.13c, your mod's name). A patch.txt beside the tables is kept as that patch's version history.

For Resurrected:

git clone --depth 1 https://github.com/blizzhackers/d2data /path/to/data/repos/d2data
D2MCP_DATA_DIR=/path/to/data .venv/bin/python -m d2mcp.tables d2r

The data tools' descriptions name the versions the tools were written against (1.09d to 1.14d, d2r, d2r-base) and that set's gaps. If yours differ, pass your own description with doc_override (see below).

Decompiled binaries

Point DECOMP_DIR at a folder with one subfolder per game version (1.09d, 1.13c...), each holding one file per binary, named <binary>.c (D2Game.dll.c, Game.exe.c). Each file is the binary's decompiled C from Ghidra, with every function headed by a line of this form:

/* ==== 6fce44f0 FUN_6fce44f0 ==== */

That is the address, then the function's name. A function that looks reached only through a function-pointer table can carry (table-only...) before the closing ====; that is optional, and the script's detection of it is a heuristic. The folder is made from your own game files with scripts/ghidra/ExportForD2MCP.java, a Ghidra script (11 or 12) that writes <outdir>/<version>/<binary>.c for each program it runs on, every function in address order under that header. Per patch, in a folder of that patch's DLLs and EXE:

/path/to/ghidra/support/analyzeHeadless /path/to/projects D2MCP-1.13c -import /path/to/1.13c-files \
    -scriptPath /path/to/d2-mcp/scripts/ghidra \
    -postScript ExportForD2MCP.java /path/to/dump 1.13c
export DECOMP_DIR=/path/to/dump

Expect minutes of analysis per DLL and a few more for Game.exe; scripts/ghidra/README.md has the options, re-export, versions and timings. The script is adapted from tools/ghidra in Nugwa628/d2-114d-codex (MIT, Copyright (c) 2026 Nugwa). The d2-114d-codex research builds on Legbreak's Iblis Codex (https://github.com/CaptainLegbreak/Iblis-Codex).

Use the tools in your own server

python -m d2mcp is a thin wrapper. The tools can be added to any FastMCP server, alongside your own:

from contextlib import asynccontextmanager
from mcp.server.fastmcp import FastMCP
import d2mcp   # set D2MCP_DATA_DIR before this import

codebases = {**d2mcp.default_codebases(), "mymod": d2mcp.CodeBase("MyMod", "me/my-mod")}

@asynccontextmanager
async def lifespan(_server):
    tasks = d2mcp.start_jobs(codebases)   # loads the code from disk, refreshes it and the knowledge base
    try:
        yield
    finally:
        for t in tasks:
            t.cancel()

mcp = FastMCP("my-server", lifespan=lifespan)
d2mcp.register(mcp, codebases, doc_suffix={"find_symbol": "    'mymod' is my mod's source."})
  • codebases is what the code tools' source parameter offers.

  • groups=("knowledge", "gamedata", "code", "decomp", "calc") picks groups. Tools are listed in the order they're registered, so call register once per group to put your own tools in between.

  • doc_suffix and doc_override add to or replace a tool's description, by tool name.

  • d2mcp.gamedata.add_live_version(...) adds a mod's tables, read live from a git clone you keep.

  • d2mcp.every(name, hours, job, reload) schedules your own refresh job on the same shared stamps.

  • Load what's on disk before you serve: d2mcp.library.library.load_cache() and d2mcp.gamedata.gamedata.load().

Add a source

A source is a module in d2mcp/ that owns one kind of data, plus its tools in d2mcp/tools.py:

  1. Write d2mcp/<source>.py. Keep its files under config.DATA_DIR, load them from disk on start, and never fetch at import. If it downloads anything, give it a refresh() the scheduler can call.

  2. Add its tools as a group in tools.py: a function that returns them, listed in GROUPS and in build_tools. The docstring is the tool's description, so write it for the assistant that will read it. When the data is missing, return a short message that says it isn't set up and how to set it up.

  3. If it refreshes, add its job to refresh.start_jobs.

  4. Add the tool names to tests/test_register.py and to this README, with where its data comes from.

To add a code repository instead, add a CodeBase to d2mcp/d2moo.py. Only public repositories, and say in the tool descriptions what it is and which game version it's for.

A new repository, or one its own author proposes, is added with pin= set to the full commit id that was reviewed. The server then serves that commit and nothing newer: to update it, open a pull request that moves the pin, so the change is reviewed before it reaches anyone using the public server. Sources from long-standing projects follow their latest commit. D2MCP_UNPIN=1 makes every source follow its latest commit, for a local server.

Tests

.venv/bin/pip install pytest
.venv/bin/pytest

The tests use an empty temporary data folder and no network.

Other Diablo II MCP servers

  • Capybara's D2 Editor – capy mcp --profile <id> serves MCP over stdio to edit, check, render and save .ds1 maps and create custom .dt1 tiles.

Where it came from

D2-MCP grew out of DarkWanderer, a Discord bot that answers questions in Diablo II modding and private-server communities. People kept asking it things like what a column in a data file does, which patch changed a skill, or what a function in the game really does, and it kept needing to look things up rather than guess. So it got tools: the knowledge base, the data tables by patch, the reconstructed source and the decompiled binaries. Those tools turned out to be useful to anyone working on the game, so they were split out of the bot into this package, and the bot now uses D2-MCP like any other client.

Licence

MIT. See LICENSE.

Available Tools

45 tools
attack_speedA

Attack speed: frames per attack for a setup, and the increased attack speed (IAS) breakpoints, computed from the game's animation data (animdata.d2) and data tables for the version. character: a class, a mercenary (rogue, town guard, iron wolf, barbarian mercenary) or a monstats.txt Id. weapon: a weapons.txt name or code ('' for unarmed; a mercenary's own weapon if left out). skill: a skills.txt name ('attack' for a normal attack): Zeal, Fury, Fend, Strafe and Dragon Talon are timed hit by hit with the animation rewinds; Jab, Frenzy, Double Swing, Double Throw, Dragon Claw as sequences; Whirlwind by its own weapon-only rule; Smite, Bash, Kick and other skills that follow attack speed. ias: total IAS from all gear including the weapon. weapon_ias: the part of it on the weapon (it counts twice for shape-shifted players and alone for Whirlwind). skill_ias: IAS from skills and auras (Fanaticism, Frenzy, Burst of Speed, the wereform skills' IAS, Blessed Aim's...), added after diminishing returns, can be negative (Holy Freeze, slows). form: 'human', or 'werewolf' / 'werebear' (or another shape-shift state). weapon2: the other hand's weapon for a Barbarian or Assassin holding two. hits: how many hits a multi-hit skill makes (default: its maximum). version: the game version the data was imported as, e.g. '1.13c'. The reply gives frames per hit separated by '/' (the last part is the final hit and the follow-through), then the IAS (from gear other than the weapon) at which that changes. Limits: no dual-wield Whirlwind, no Whirlwind or sequences while shape-shifted, no throwing-skill specifics beyond the throw animation; Fury and other shape-shifted skills use the documented wereform base-speed rule; mods are right only if their animdata.d2 and tables are imported.

Inputs: character (required), ias, form, hits, +6 more. Returns: result

bin_table_infoA

Say what a compiled Diablo II data table (.bin, the game's compiled form of a .txt table, e.g. data\global\excel\weapons.bin) holds: its record count and record size. path: a .bin file on the local disk, or an MPQ archive with member= the .bin's name inside it. The file starts with a 32-bit record count, then fixed-size records, so the record size is (file size - 4) / count; when that doesn't divide evenly the file isn't a plain record table (the *code.bin files are compiled formulas, for one) and the reply says so. Limits: it reports the header only; read_bin_table decodes the fields of 1.14d files. The record count can be compared with the .txt table's rows (the compiler may skip rows such as 'Expansion' separators).

Inputs: path (required), member. Returns: result

calculateA

Run numbers instead of estimating them: drop odds over N runs, expected values, rune maths, breakpoints, frame counts, small Monte Carlo sims. code is a tiny Python subset: numbers, strings, lists, dicts, arithmetic, assignments, if/for/while, comprehensions, print(), list/dict/set/string methods, and these functions: abs min max sum round len range int float str sorted enumerate zip any all divmod pow format, sqrt exp log log10 log2 floor ceil comb perm factorial gcd prod fsum pi e inf, mean median stdev, random randint uniform choice choices shuffle sample seed. No imports or files. It ends after 5 s of CPU or 256 MB. The value of the last line is shown, plus anything printed. Example: 'p = 1/2950\nruns = 500\nprint(f"{1-(1-p)**runs:.1%} for at least one")'. Show the result, not the code, unless someone asks how you worked it out; for a sim, say it's a simulation and how many trials.

Inputs: code (required). Returns: result

check_stringsA

Check a mod's Diablo II: Resurrected string files against the game's own for mistakes that crash the game or lose its text. Findings are errors (the notes this rests on say it crashes, loses records or collides), warnings (probably unintended) and notes; checks marked heuristic are not from those notes. Args: mod: the mod's data/local/lng/strings folder, a mod folder holding data/local/lng (its strings and strings-legacy are both read), or .json files; a list of paths works. vanilla: the same for the game's own strings, extracted from your install; give all of the files, since the check is only as complete as they are. A next_string_id.txt beside the vanilla strings folder (or in data/local/lng above it) starts the search for a free id. limit: findings shown, 1 to 1000 (default 100); the counts are always complete. Checks: missing-keys (a mod file replaces the game's whole file of that name, so the game's keys it lacks show as keys in game); placeholders (printf-style %d, %s, %+d, %1$s, %*d and the rest differing in number, order or type from the game's string of the same key and language; a missing argument crashes if the game formats the key itself, as it does for some; %% is a literal percent sign and takes no argument); ids (a new key, or an override with a changed id, whose id shares its low 16 bits with another string, since the game matches ids by their low 16 bits; ids above 65,535; a key with different ids in different files; an override whose id differs from the game's); languages (strings missing a language field the mod's files carry, strings changed in enUS that keep the game's text in another language, languages the game has and the mod doesn't, empty or non-text values); duplicate keys the game's file doesn't have. Heuristics, reported as notes or warnings: colour codes cut short, literal backslash sequences, positional and plain placeholders mixed, an override's changed id. Keys are matched ignoring case, as the toolkit does; that isn't verified against the game. Strings the mod leaves exactly as the game has them are not judged. It ends with the next free id, counting up from next_string_id.txt (or one above the highest id below 65,536) and skipping low 16 bits in use. Limits: only keys the game has can be compared, so the placeholders of a new key (and the ones the engine fills in for it) aren't checked. The rules are Nugwa628/d2rAI-toolkit's notes on build 93847, not read from the game. Classic .tbl tables aren't checked. No findings means these checks passed, not that the strings work in game.

Inputs: mod (required), vanilla (required), limit. Returns: result

compare_versionsA

What changed in the code between two patches: a git diff of a file or folder between version branches, a per-file summary first, then the changes, ignoring whitespace and #line directives. Only 'd2hausos' (seperaGG's byte-matching decompilation) has versions: 'v1.00', 'v1.01', 'v1.02', 'v1.03', one branch each. path: repo-relative, e.g. 'D2Game/AI' or 'D2Common/Skills.cpp' (find it with search_code first; '.' is the whole repo, usually too big). The diff is capped at 60 KB: when it's truncated, narrow the path to a subfolder or file from the summary. Use it for "what changed between 1.00 and 1.01 in X". It's code reading only: say which two versions you compared, link the compare page or the branches it gives, describe what the code does differently, and don't claim gameplay effects the diff doesn't show. Cite short snippets, never whole files.

Inputs: path (required), source (required), to_version (required), from_version (required). Returns: result

d2moo_pull_requestsA

D2MOO's open pull requests: bug fixes and new code that are written but still awaiting review, so they're not in the master code that search_code and read_code show. Check them whenever D2MOO's code bears on an answer. With no arguments, lists them all. query keeps the ones whose title, description, files or diff contain every word, e.g. 'vendor' or 'SUnitNpc'. number shows one PR's description and full diff; for a long diff, continue with the offset the result gives. Cite the PR link and say it's unmerged and may change in review.

Inputs: query, number, offset. Returns: result

decomp_functionA

One function's decompiled C from a patch's binary, by name (e.g. 'FUN_6fce44f0') or address ('6fce44f0' or '0x6fce44f0'; an address inside a function gives the function containing it). version and binary as for decomp_search. Up to 250 lines; says when it's truncated. This is Ghidra's decompiled output of Blizzard's own binaries (every DLL and EXE of each patch), not source code: function names are Ghidra's (FUN_, Ordinal_, thunk_...) or ours, variables are Ghidra's, and strings appear as labels like s_Data_Global_Monsters__6fb75f54 (the string's first 32 characters, punctuation as _; labelled in 1.00 to 1.10 and partly 1.14d, but hardly at all in 1.11 to 1.13d). Reading it is code reading, not testing: say what the code appears to do, not that you ran it. Cite version, binary and address (e.g. 1.09d D2Game.dll FUN_6fce44f0 @6fce44f0). In public replies quote only short snippets (a few lines), never whole functions. 1.14b and 1.14d have every DLL merged into Game.exe. For clean names use D2MOO (1.10f) or Redivivus (1.14d) first; these dumps are for other patches and for checking what a given patch's binary really does.

Inputs: binary (required), version (required), function_or_address (required). Returns: result

diff_tablesA

What changed in one data table between two patches, e.g. file='weapons.txt', from_version='1.10', to_version='1.13c'. Rows are matched by the table's key (code, name, index, skill, Id..., or key_column), not by position: lists rows added and removed, columns added and removed, and for each changed row only the cells that changed (column: old → new). filter keeps only rows whose key contains that text (e.g. 'Enigma', 'axe'): use it when the result is truncated. Versions as for search_game_data; 1.12a, 1.13d and 1.14d lack many tables, so diff against 1.13c or 1.11b. For one row across every patch, read_game_data version='all' is simpler.

Inputs: file (required), to_version (required), from_version (required), filter, +1 more. Returns: result

drop_chancesA

Exact drop chances per kill, worked out from a version's own tables (any vanilla patch or mod loaded in the game data), not simulated. Follows the game's code: the monster's treasure class by type, its upgrade by monster level in Nightmare/Hell (group/level columns), NoDrop by players, picks and negative picks, nested and item-type classes (armo/weap...), the ItemRatio quality roll with magic find's diminishing returns and the class's quality modifiers, unique/set level checks, and the limit of 6 items. source: a monster (MonStats Id such as 'mephisto', 'fallen1', or its name), a super unique ('Pindleskin'), or a treasure class ('tc:Act 5 (H) Equip B'). difficulty: normal, nightmare, hell. players: 1-8 in the game; party: how many of them are in the killer's party in that area (NoDrop uses (players - party) / 2 + party). mf: the killer's magic find percent. item: a base item code or name, or a unique / set item name, to get that item's chance and '1 in N'; quality (unique, set, rare, magic, superior, normal, low) with a base item gives it at that quality and lists the base's uniques or set items. Without item: the most likely drops (limit, at most 50), of any quality or of the given quality. monster_type: normal, champion, unique, minion (super uniques are always unique). area: the Levels.txt Name, LevelName or Id the monster is in; needed in Nightmare/Hell for monsters that take the area's level, and the tool asks for it when it can't tell. quest: the first-kill quest drop (TreasureClass4). mlvl: the monster level to assume for a 'tc:' source. version: a game data version, default the server's default; the answer names it. Limits: 1.10 and later Legacy rules only, expansion game; 1.09 and earlier and Resurrected are refused. Names are the tables' own (no string tables): use codes or the names in weapons/armor/misc/UniqueItems. Chests and other objects aren't sources, only their classes by name. State the version and the notes.

Inputs: source (required), mf, area, item, +9 more. Returns: result

find_symbolA

Find where a function, struct, enum value or macro is defined or declared, e.g. 'D2SkillsTxt' or 'STATLIST_GetUnitStatUnsigned'. Returns file paths and line numbers, definitions first. source: 'd2moo' (1.10f game code: D2Common, D2Game; clean, well named) or 'redivivus' (all of 1.14d decompiled into C++: game code plus D2Client, D2Win, D2gfx, D2Sound, D2Net, Storm, Fog; names are reconstructions) or 'd2hausos' (seperaGG's decompilation of all of 1.00, every DLL and EXE, byte-matching; 1.00 only, link it, no credit line) or 'pvpgn' (PvPGN, the private Battle.net and D2 realm server: bnetd, d2cs, d2dbs, and its conf/ templates) or 'd2ds' (jaenster's d2-dedicated-server, in Zig: headless d2gs for 1.06b to 1.14d, realmd, d2ingress). For 1.14d, 'iblis-codex' is Legbreak's byte-matching Game.exe reconstruction in C++, 'd2-114d-codex' has Nugwa628's research specs and Ghidra tools, and 'd2gamma' is Nugwa628's Rust reimplementation. The Diablo II: Resurrected sources (see search_code) work too, e.g. 'readJson' in 'd2rmm'.

Inputs: name (required), source. Returns: result

frame_breakpointsA

Breakpoint table for faster cast rate (fcr), faster hit recovery (fhr) or faster block rate (fbr): each stat value where the animation gets a frame shorter, and the frames it takes from there, computed from the game's animation data (animdata.d2) and data tables for the version, so it works for mods too. character: a class (amazon, sorceress, necromancer, paladin, barbarian, druid, assassin), a mercenary (rogue, town guard, iron wolf, barbarian mercenary) or any monstats.txt Id. form: 'human' (default), or a shape-shift state for a class, e.g. 'werewolf', 'werebear' (states.txt). version: the game version the data was imported as (e.g. '1.13c'); may be left out when only one is set up. Players get one table per group of weapon classes that share an animation (e.g. a Paladin's hit recovery with a spear or staff differs), FCR adds skills cast as a sequence (Sorceress Lightning and Chain Lightning), FBR adds Holy Shield. Values are the item stat as on gear (before diminishing returns). Limits: values up to 400%; skill cast delays (cooldowns) are separate from these frames and not shown; sequence casts other than the Lightning sequence are listed as not supported; tables for a mod are only right if its animdata.d2 and tables are imported.

Inputs: stat (required), character (required), form, version. Returns: result

function_across_versionsA

Find one function of Blizzard's binaries in other game versions: give it in one version, get its counterpart's address in each other indexed version, with a confidence and the evidence. function: an address ('6fd5da40' or '0x6fd5da40'; an address inside a function means that function), an export ordinal as '#10916' (needs binary=), Ghidra's name for it (e.g. 'FUN_6fd5da40'), or a name from the D2MOO (1.10f) or Redivivus (1.14d) source clones (e.g. 'STATLIST_GetUnitStatUnsigned'). version: the version it's given in, e.g. '1.10', '1.13c', '1.14d'. binary: optional, e.g. 'D2Common.dll' or 'D2Common'; 1.14b and 1.14d have every DLL merged into Game.exe. to_versions: which versions to look in (default all indexed ones). Confidence: exact (same export ordinal, only where the DLL's ordinals are checked stable between the two versions), strong (strings or constants found in only this function in each version, or identical code once addresses are taken out), weak (call structure only: verify before relying on it). Many functions get no match: the matcher refuses to guess. Needs the index built from your own Ghidra output (python -m d2mcp.internals build); the first lookup between two versions takes a few seconds.

Inputs: version (required), function (required), binary, to_versions. Returns: result

function_fingerprintA

What the function index recorded for one function of one version: its names (Ghidra's, its export ordinals, names from the D2MOO and Redivivus source clones), length, the strings it uses, its distinctive constants, and how many functions and imports it calls. Useful to see why a function_across_versions match was made, or to pick a string to search for with decomp_search when it wasn't. function, version and binary as for function_across_versions. Strings shown as label: are only known from Ghidra's 32-character labels. Up to 6 strings and 8 constants.

Inputs: version (required), function (required), binary. Returns: result

function_index_statusA

Which game versions the cross-version function index covers: functions, binaries and export ordinals per version, whether strings are known in full, and how many names were joined from the source clones. Says how to build the index when it isn't built.

Inputs: no named parameters. Returns: result

game_data_coverageA

Which patches' data tables are loaded (vanilla LoD and Resurrected), how many tables each has, and which ones are missing.

Inputs: no named parameters. Returns: result

get_downloadA

Full details of one download by id from search_downloads: description, file name, size, checksum, dates, status and links.

Inputs: id (required). Returns: result

hit_chanceA

The chance an attack hits, before block, dodge or avoid: 200% x AR / (AR + defence) x attacker level / (attacker level + defender level), worked in the game's own integer order (each step truncates, in 32 bits) and held to 5-95%. Read for this: the 1.10f source (D2MOO) and the 1.14d executable, which agree; 1.13c is assumed the same. 1.09 and earlier use the published formula, with the rounding not checked; Resurrected's code wasn't read. Two ways to use it: By numbers: attack_rating, defense, attacker_level and defender_level; the answer shows each step. Against a monster: monster (a MonStats Id or name, or a super unique), with difficulty, players, area, monster_type (normal, champion, unique, minion) and ladder as monster_stats takes them, gives its level and defence from the version's tables (version: default the server's). Then give attack_rating and attacker_level (your character level); defense or defender_level override the monster's. target: a whole percent. For player_vs_monster the answer is the smallest attack rating that reaches it (found by search on the exact integer formula, and the true minimum in the range searched: ratings up to about 21 million, or 1,048,576 with an attack_rating_percent, past which the game's arithmetic wraps or rounds differently; attack_rating may be left out), or says that nothing in that range reaches it. For monster_vs_player (direction) it is the smallest defence that keeps the monster's chance at or below target. direction: 'player_vs_monster' (default), or 'monster_vs_player': give the player's defense and defender_level (their character level); the monster's attack ratings come from its attacks as monster_stats lists them (a champion's attack rating bonus included), unless attack_rating is given. attack_rating_percent: percent added to the rating first, as the game does (0 if the figure already includes it). Not applied (change the defence or rating you give instead): auras and curses on the target; the defender's armorclass_vs_hth / armorclass_vs_missile bonus on top of its sheet defence; 'ignore target defense' (zeroes a monster's defence, but not a unique, super unique, boss or hireling's) and 'target defense -x%' (x% off, halved against players, bosses, super uniques and hirelings, in full against other monsters); unique monsters' modifiers. A monster's tables are only needed with monster; plain numbers work without any. State the version and the notes.

Inputs: area, ladder, target, defense, +10 more. Returns: result

inspect_saveA

What a Diablo II character save (.d2s) on this machine holds, read without changing it: the header (version, size, whether the checksum matches), name, class, level, hardcore/expansion/ladder/died flags, acts completed and where the character last was, the mercenary, the stats section (strength, life, experience, gold...), points in each class skill, and the items: where each is, simple or full, quality, item level, ethereal, sockets and what fills them, runeword, personalized, quantity, durability. path: the .d2s file. version: the table set to read it with (a version imported with python -m d2mcp.tables, e.g. '1.13c', a mod's name, or 'd2r'); left out, the default Legacy set (or 'd2r' for a Resurrected save) is used when loaded. A mod's save needs the mod's own tables: its itemstatcost.txt sets the stat widths. item_detail: list each item's properties (stat name=value), its affix ids and set or unique row. item_start: skip this many items (the reply lists up to 60 at a time). Reads Legacy version 96 saves (the layout 1.14d writes) completely. Resurrected version 105 saves: header (with the flags word raw), stats and skills, and the item count only; this reader doesn't decode their item records. Other versions, and D2RLoader's extended format: the signature, size and checksum only. Affix ids and the runeword field are given as stored, not as names.

Inputs: path (required), version, item_start, item_detail. Returns: result

item_affixesA

Which prefixes and suffixes a base item can roll at an item level, from a version's MagicPrefix and MagicSuffix tables (a vanilla patch or a mod), with the affix level (from item level, the base's level and its magic lvl) and each affix's group and weight. quality 'magic': each affix's exact chance to be on a dropped magic item. quality 'rare': the pool rares draw from (rare=1 affixes) with each affix's share of one pick; a rare takes 3-6 in turn, so that is not a per-item chance. item: a base item's code or name ('rin', 'Monarch'). ilvl: 1-99, the item level (a monster drop's is the monster's level). limit: affixes listed per side, most likely first. Limits: 1.10 and later Legacy rules only; staff mods, automagic and sockets are separate rolls and not listed. State the version.

Inputs: ilvl (required), item (required), limit, quality, +1 more. Returns: result

json_to_tblA

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.

Inputs: out (required), json (required), overwrite. Returns: result

lint_tablesA

Find what is broken in a set of Diablo II data tables (Legacy 1.09 to 1.14d; not Resurrected). mod: a folder on this machine holding the .txt files (a mod's data/global/excel, or a folder containing it) or a table version imported into the data folder. like: the vanilla version the mod is built on, e.g. '1.13c'; give it whenever you can, because it picks the rule set (1.09 or 1.10+), stands in for tables the mod doesn't ship so references into them can be checked, and turns on the column and 'Expansion' row comparisons. file limits the report to one table (references are still resolved against the whole set). limit is the most findings listed (default 150, up to 2000), shared across files so one table's flood can't hide the rest; repeats of one finding are counted, not listed, and when many references into one table fail they are summed up in a line naming that table. Counts per check and per file are always complete. The result is capped at about 40 KB. Each finding gives severity, check, file, line number (the header is line 1), the row's name, the column, the bad value and why. Checks: reference (a cell names a row that doesn't exist: treasure classes, monsters, missiles, states, skills and skill descriptions, sounds, overlays, item codes, item types, properties, stats, sets...), treasure-class (picks that name nothing or a class defined further down, picks after an empty slot, rows after a nameless row), cube (inputs, outputs and their modifiers), duplicate-key, structure (rows with the wrong number of cells, repeated columns), number (text in a number column, values too big for it), length, limit (row counts and value ranges the game enforces), columns (against like: missing, unknown or misspelt columns), expansion (missing 'Expansion' marker rows) and line-endings. Errors are values the game can't use as written; warnings are probably unintended; notes are for information. It reads the tables the way the 1.10 game code loads them; it doesn't run the game, check formulas, string keys (.tbl), animation or map files, or judge balance. Oddities in Blizzard's own tables are not reported. No findings means none of these checks failed, not that the mod works.

Inputs: mod (required), file, like, limit. Returns: result

lookup_columnA

Look up what a column does in a data file, e.g. file 'Skills.txt' and column 'srvdofunc'. Returns that column's entry from every file guide to the file, one per game version (1.10 to 1.14, 1.09, 1.08, 1.00 to 1.06), with the section it's in, plus the Phrozen Keep's D2R Data Guide entry (Resurrected 3.x, Reign of the Warlock: type, description, value tables) and other articles that mention the column. Use it whenever a question names a column, and for each column you tell someone to set.

Inputs: file (required), column (required). Returns: result

mod_changesA

What a mod's data tables change from a vanilla version. mod: the mod's tables, either a folder on this machine holding its .txt files (the mod's data/global/excel, or a folder containing it) or a table version imported into the data folder. base: the vanilla version to compare against, e.g. '1.13c' (a folder works too). Without file: one line per table that differs (rows added, removed and changed, columns added and removed), then the tables only one side has and the identical ones. With file (e.g. 'Skills.txt'): that table's changed rows cell by cell (column: old → new), then its added and removed rows. Rows are matched by the table's key column (code, name, index, skill, Id...), never by position, and a blank cell equals 0. filter keeps only rows whose key contains that text; limit is the most rows listed per kind (default 40, up to 500). The result is capped at about 40 KB. Vanilla 1.12a, 1.13d and 1.14d are partial sets here: the tables their import couldn't decode are listed as not comparable, with the full version to compare them against instead (1.13c or 1.11b). Says which sets it compared; when the tables aren't set up it says how to import them.

Inputs: mod (required), base (required), file, limit, +1 more. Returns: result

monster_statsA

A monster's level, life range, defence, damage and attack rating per attack, experience, resistances and immunities, as that version of the game works them out from its tables (a vanilla patch or a mod), for a normal monster, champion, unique and minion where they differ. 1.10 and later: MonStats percentages scaled by MonLvl for the monster's level, which in Nightmare/Hell is the area's level (give area: Levels.txt Name, LevelName or Id; the tool asks when it can't tell) unless the row is a boss or noRatio; life and experience +50% per extra player, damage and attack rating +1/16 per extra player in Nightmare/Hell; champion +2 levels, unique and minion +3, life by MonUMod's constants. 1.09 and earlier: the flat per-difficulty MonStats values only (player scaling and champion/unique bonuses aren't supported there). monster: a MonStats Id ('baalcrab', 'fallen1') or name, or a super unique ('Pindleskin'). difficulty: normal, nightmare, hell. players: 1-8. ladder: true (default) uses MonLvl's L- columns, which ladder realm games and single player / TCP/IP games use; false the plain columns of non-ladder realm games. Limits: Legacy only (Resurrected refused), expansion game; unique monsters' random modifiers and auras are not included; experience is before the level penalty and party split. State the version.

Inputs: monster (required), area, ladder, players, +2 more. Returns: result

mpq_createA

Pack a folder into a new MPQ archive (format version 1, as Diablo II 1.x uses) on the local disk. Every file under src_dir goes in under its path relative to src_dir, with backslashes (src_dir/data/global/excel/x.txt becomes data\global\excel\x.txt), plus a (listfile) naming them all. src_dir: the folder to pack. out_path: the .mpq to write; an existing file is refused unless overwrite is true. compression: 'zlib' (default), 'bzip2', 'pkware', 'implode' (the older whole-file PKWARE flag) or 'store'. After writing, the archive is opened again with this package's reader and every member compared with its source file; the result says so. That is the only check made: the output has not been loaded by the game itself, so try it in the game before relying on it. Members aren't encrypted. It only makes a new archive; it can't add to or change an existing one. Member names must fit Latin-1.

Inputs: src_dir (required), out_path (required), overwrite, compression. Returns: result

mpq_extractA

Extract members of an MPQ archive on the local disk into a folder, keeping their folder structure (data\global\excel\Weapons.txt becomes <out_dir>/data/global/excel/Weapons.txt). Reports what it wrote. path: the .mpq file. member_or_pattern: one member's full name, or a pattern for several: shell wildcards (*.txt, data\global\excel*, * for everything) or a plain piece of the name; case and slash direction don't matter. out_dir: the folder to write into (created if missing). listfile: optional external list of member names for an archive that lacks its own. limit: most files written per call, 1 to 5000 (default 200). overwrite: existing files are left alone and reported unless this is true. It never writes outside out_dir: a member whose name would land elsewhere is refused. Unpacking is pure Python and stops after about 100 seconds, saying how far it got: run it again (files already written are skipped) or narrow the pattern. Same format support and limits as mpq_read.

Inputs: path (required), out_dir (required), member_or_pattern (required), limit, +2 more. Returns: result

mpq_listA

List what's inside an MPQ archive on the local disk (Diablo II and its mods: d2data.mpq, d2exp.mpq, patch_d2.mpq...). Returns the archive's header facts, how many files it holds, how many have names, a count by file type, then the members: name, size, packed size and how each is stored. path: the .mpq file. pattern: optional filter, shell wildcards (*.txt, data\global\excel*) or a plain piece of the name; case and slash direction don't matter. limit: members shown, 1 to 1000 (default 200); start: skip this many, to page. Names come from the archive's own (listfile); an archive without one is said to have none, and its members are listed as FileNNNNNNNN.xxx. listfile: optional path of a text file of member names (one per line) to name them. Limits: MPQ format version 1 only (not the archives of later Blizzard games, nor Resurrected's CASC storage).

Inputs: path (required), limit, start, pattern, +1 more. Returns: result

mpq_readA

Read one member of an MPQ archive on the local disk. A text member (the .txt data tables, .ini, lists) comes back as text, 24,000 characters per call: pass start (a character offset; the reply says where to continue) for the rest. A binary member comes back as a short summary instead: size, how it's stored, what kind of file it looks like (sound, sprite, string table, compiled table...) and a hex dump of its first 64 bytes; use mpq_extract to get the file itself, read_strings for .tbl string tables. path: the .mpq file. member: the full name inside the archive, e.g. data\global\excel\Weapons.txt (case and slash direction don't matter), or FileNNNNNNNN.xxx for an unnamed one as mpq_list shows it. listfile: optional external list of names, only needed to decrypt an encrypted member the archive doesn't name. Reads: stored, imploded (PKWARE DCL) and multi-compressed members (zlib, bzip2, PKWARE, Huffman, ADPCM mono and stereo), encrypted or not, sectored or single-unit. Not read: LZMA and sparse compression, patch files, and archives newer than format version 1. The table is whatever is in that archive: say which archive (and so which patch or mod) it came from.

Inputs: path (required), member (required), start, listfile. Returns: result

png_to_dc6A

Encode PNG pictures on this machine as a Legacy Diablo II DC6 sprite (interface art, inventory items, cursors...). Pixels with alpha below 128 become transparent (palette index 0); every other pixel takes the palette entry of its exact colour, or the nearest one by RGB distance (no dithering), and the reply says how many weren't exact. pngs_or_sheet: the frames' PNG paths in order (all of direction 0, then direction 1...), each becoming a frame of its own size; or a single sheet, cut into directions rows of frames_per_direction columns of equal cells. One path without frames_per_direction is a single frame. out: the .dc6 to write. palette, palette_dir: as for sprite_to_png (a pal.dat path, or an act name under a palette folder); use the palette the game shows that art with. directions: how many directions (default 1). offsets: [[x, y]] for every frame or one pair per frame: the frames' offset fields (the left edge is drawn at origin x + offset x, the bottom row at origin y + offset y). Default 0,0, which is what inventory and panel art has. allow_large: a frame wider or taller than 256 px is refused, because the game's sprite cache refuses such frames; nothing is split for you. Split large art into tiles of at most 256x256 as separate frames (the game's panels are built that way), or pass allow_large=True to write the file regardless. overwrite: replace out if it exists. Inventory art is 28 px per grid square, in the game's own files. Needs Pillow (the images extra).

Inputs: out (required), palette (required), pngs_or_sheet (required), offsets, +5 more. Returns: result

png_to_dccA

Encode PNG pictures on this machine as a Legacy Diablo II DCC sprite (the compressed format of character, monster, missile and object animations). The result is decoded again before it's written and must match pixel for pixel; files made this way have NOT been confirmed in the game itself, so test in game, and keep the DC6 route (png_to_dc6) in mind where the game accepts either. pngs_or_sheet, out, palette, palette_dir, directions, frames_per_direction, offsets, overwrite: as for png_to_dc6; colours are matched to the palette the same way. For a sheet written by sprite_to_png, pass the directions, frames_per_direction and offsets its reply gave. trim: cut each frame down to its opaque pixels and move its offsets to match (default; a DCC stores a box per frame, and sheet cells are mostly empty). reduce_colours: a DCC stores pixels in cells of about 4x4, each holding at most 4 colours counting transparency. Art decoded from a DCC already fits. Other art usually doesn't: it's refused, with the number of cells over the limit, unless reduce_colours=True, which redraws the least-used colours of those cells as their nearest neighbours in the cell (lossy, and it shows on detailed art). Every direction needs the same number of frames, and a COF with the same counts. Needs Pillow (the images extra).

Inputs: out (required), palette (required), pngs_or_sheet (required), trim, +6 more. Returns: result

read_articleA

Read a knowledge base article or site page as markdown, with its author, version label and URL. article is an id from search results (e.g. 'file-guides/skills-txt') or its diablo2.org URL. Long articles come in parts: the result lists the sections, so request one with section, or continue with offset.

Inputs: article (required), offset, section. Returns: result

read_bin_tableA

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.

Inputs: path (required), key, limit, start, +3 more. Returns: result

read_codeA

Read lines of a source file, research spec or modding note, numbered, with a GitHub permalink to cite. Up to 300 lines per call. Start a little above a hit for context. source: the one the path came from, as for find_symbol and search_code.

Inputs: path (required), start (required), end, source. Returns: result

read_d2r_guideA

The Phrozen Keep's Diablo II: Resurrected Data Guide (Reign of the Warlock edition) for one data file, e.g. 'skills.txt' or 'enums': its overview and every column it documents, with the start of each description. Use lookup_column for one column's full entry, value tables included. Without file: the files it covers.

Inputs: file. Returns: result

read_d2r_jsonA

Read a Diablo II: Resurrected JSON file by key: a UI layout (e.g. 'hireablespanelhd.json', 'bankexpansionlayouthd.json', 'controller/characterstatspanelhd.json'), the HD item art map ('items.json': item code to data/hd/items asset; 'uniques.json', 'sets.json'), 'missiles.json', 'monsters.json' or a strings file ('item-names.json'). Without key it outlines the file: a layout's widget tree (type and name of each widget, children indented), or a list's keys. key: a widget name in a layout ('HireablesPanel', 'Template'), an item code ('hax'), a strings Key, or a dotted path ('fields.rect'). source: 'd2r-vanilla' (the default: unmodded files from D2R 2.4/2.5, before Reign of the Warlock), or 'd2r-howto' or 'd2rmm-mods' for a mod's own JSON (modified copies, so say so). These are D2R only; Legacy has no JSON. Find files with search_code first.

Inputs: file (required), key, source. Returns: result

read_game_dataA

Show one row of a vanilla data table, column by column (empty columns left out), e.g. file='Runes.txt', row='Enigma' (the row's name or code, or 'row 12' from search_game_data). version: one patch as for search_game_data, or 'all' to compare the row across every patch that has the table: the first shows in full, later ones only the columns that changed. columns optionally limits which columns to show. With file='patch' it reads that patch's patch.txt around the line number given in row.

Inputs: row (required), file (required), columns, version. Returns: result

read_stringsA

Look up the game's text strings in files on the local disk: Diablo II's string tables (string.tbl, expansionstring.tbl, patchstring.tbl) or Diablo II: Resurrected's JSON string files. source: one path or a list of paths, each a .tbl file; an MPQ archive (its data\local\lng<language>
string.tbl, expansionstring.tbl and patchstring.tbl are read, whichever it holds: give d2data.mpq, d2exp.mpq and patch_d2.mpq together for the full set); a folder holding those .tbl files (or a mod folder with data/local/lng// inside); a folder of Resurrected's data/local/lng/strings/*.json; one such .json; or a .json written by tbl_to_json. key: a string key (case-sensitive, e.g. 'hax' or 'ModStr1a'), or a string number (e.g. 22000, or an id in Resurrected's files). search: text to find in keys and strings, case ignored. limit: results shown for search, 1 to 100 (default 20). With neither key nor search: what was loaded, with counts. language: for MPQs and mod folders the language folder (default eng; also deu, fra, esp, ita, pol, kor, chi, jpn...); for Resurrected the JSON field (default enUS; also deDE, frFR, zhTW...). For the classic tables the reply gives the order the game looks a key up in (patchstring, then expansionstring, then string; the first that has the key wins), which file each result is from, its number (string.tbl counts from 0, patchstring.tbl from 10000, expansionstring.tbl from 20000) and any lower-priority file that also defines the key. When several sources hold a file of the same name, the last one listed is the one used, as a patch or mod archive replaces the base game's. Line breaks show as \n; colour codes show as ÿc plus a character. The strings are those of the files given: say which game version, patch or mod they belong to from where the files came from; Resurrected's files are Resurrected only.

Inputs: source (required), key, limit, search, +1 more. Returns: result

search_codeA

Search the source for lines containing every word of the query (case-insensitive), e.g. 'srvdofunc'. Use it for column names from the data files, partial identifiers and comments. path optionally filters, e.g. 'D2Game/src/SKILLS' (D2MOO), 'D2Client/UI' (Redivivus), 'src/d2cs' (PvPGN), 'apps/realmd' (d2ds) or 'Layouts' (d2r-vanilla). Sources are as for find_symbol. For 1.14d, try 'Source/' in 'iblis-codex', 'specs/data' in 'd2-114d-codex' for TSV field layouts (also specs for formats, items, treasure, combat and monsters), or 'crates/' in 'd2gamma' for Rust. Cite d2gamma as a reimplementation. Returns up to 40 file:line hits. Diablo II: Resurrected modding sources (every result from them is D2R only, never Legacy or 1.13c): 'd2rmm' (D2RMM, the D2R mod manager: src/bridge/ModAPI.d.ts is the ModAPI that mod.js scripts call, D2RMM.readJson, writeJson, readTsv, writeTsv, readTxt, copyFile, getConfigJSON...; DOCS.md and README.md; and .claude/.md, its notes on D2R's files, mechanics, the modding API and mod examples), 'd2rmm-mods' (D2RMM's own example mods, each a mod.js plus mod.json config: expanded stash/cube/inventory, stackable runes, loot colours...), 'd2r-vanilla' (unmodded D2R files from patch 2.4/2.5, before 2.6 and Reign of the Warlock: Data/Global/UI/Layouts/.json, the UI layouts (hd and controller variants), Data/Local/Lng/strings/*.json, Additional Jsons/ items.json, uniques.json, sets.json (data/hd/items: item code to HD asset), missiles.json, monsters.json, plus 2.4's Excel .txt; read a JSON file by key with read_d2r_json), 'd2r-howto' (HighTechLowIQ's D2R modding guide: README.md walks through mod folders and -mod/-txt, new items with HD graphics, sets, stash tabs, maps, menus, runes, with the example mods' files under mods/), 'd2rl-plugins' (eezstreet's D2RLoader plugins for D2R 3.x and the ini options they add), 'd2r-spriteedit' (eezstreet's SpriteEdit: how D2R's .sprite format is read and written, in C#) and 'd2rai-toolkit' (Nugwa628's D2R engine, mechanics and format notes in knowledge/ and Python tools in modkit/).

Inputs: query (required), path, source. Returns: result

search_downloadsB

Search the Phrozen Keep download catalogue: mods, modding tools, plugins (sounds, graphics, DLL code, maps), patch installers and clean game files. Returns id, title, version, category, status, size and a short description. Status "available" can be downloaded now, "pending" is saved but not hosted yet, "lost" means nobody has the file.

Inputs: query (required), section, available_only. Returns: result

search_game_dataA

Search the game's data tables (weapons.txt, UniqueItems.txt, Runes.txt, skills.txt...) for rows containing the text (case-insensitive), e.g. 'Enigma', 'Harlequin Crest', 'item_fastercastrate'. file optionally limits it to one table. Also searches that patch's patch.txt (Blizzard's version history) when file is unset or 'patch'. version: vanilla LoD '1.09d', '1.10', '1.11b', '1.12a', '1.13c', '1.13d' (the default) or '1.14d'; or Resurrected: 'd2r' (current 3.x tables with Reign of the Warlock: Warlock, heralds, desecrated zones, sunder charms; also strings-eng.txt, the English names) or 'd2r-base' (D2R's base tables without that content). 1.12a, 1.13d and 1.14d lack many tables (weapons, armor, UniqueItems, SetItems, cubemain, skills...); the result says which, and 1.13c (complete, partly from a lightly modded copy) or 1.11b is the nearest full set. Then use read_game_data on a hit to see the whole row.

Inputs: query (required), file, limit, version. Returns: result

search_knowledge_baseA

Search diablo2.org: the knowledge base (file guides for every data file such as Skills.txt, ItemStatCost.txt and CubeMain.txt, tutorials, references, Keep history) and the site's own pages (playing and modding guides, modding with AI, patches, history, and the mod, server, tool and community directory). Returns ranked articles with id, title, category, game version label, URL and the best-matching passage. Search with the file or column name and the specific terms the user used. category is an optional slug from the server instructions; limit is 1 to 15.

Inputs: query (required), limit, category. Returns: result

sprite_infoA

Describe a Legacy Diablo II sprite file on this machine: a DC6 (interface and item art), a DCC (character, monster, missile and object animations) or a COF (an animation's layers). Not Resurrected's .sprite files. For DC6 and DCC: directions, frames per direction, each frame's width x height and offsets, each direction's box and the bounds of the whole sprite, plus warnings: DC6 frames wider or taller than 256 px (the game's sprite cache refuses them), unusual termination bytes, damaged data, and frame counts that disagree with a COF. For a COF: directions, frames, speed, bounding box, the layers (component, weapon class, shadow, transparency and draw effect), the frame triggers (attack, missile, sound, skill) and the back-to-front draw order per direction. path: the file; its type is taken from the extension, or the first bytes. cof: optionally the path of the COF this DC6/DCC is a layer of, to check directions and frame counts. direction: list every frame of this one direction (sprites with many frames are otherwise summarised). Reads the file only; it works without Pillow.

Inputs: path (required), cof, direction. Returns: result

sprite_to_pngA

Decode a Legacy Diablo II DC6 or DCC sprite on this machine to PNG, with palette index 0 transparent. path: the .dc6 or .dcc file. out: the .png to write (its folder must exist). palette: the colours, which sprite files don't carry: the path of a pal.dat (256 blue-green-red triples, as in data/global/palette//pal.dat), or of a folder holding one, or an act folder's name ('act1', 'units', 'loading'...) looked up under palette_dir (or the data folder's palette/). Use the palette the game shows the art with (in a game, the current act's); a wrong palette gives wrong colours, not an error. What is written: with frame, that one frame (of direction, default 0) at its own size. Otherwise with sheet=True one picture: a row per direction (or only direction), a column per frame, every cell the size of the box holding all those frames and each frame placed by its offsets. With sheet=False one PNG per frame, named _d00_f000.png and so on. The reply gives the cell size and the directions, frames_per_direction and offsets to pass to png_to_dc6 or png_to_dcc to rebuild the sprite from what was written. scale: 1 to 8, enlarges without smoothing (for looking at; encode from scale 1). colormap, colormap_index: a colour-shift file (.dat of 256-byte tables: data/global/items/palette/*.dat for item tints, a monster's palshift.dat, RandTransforms.dat) and which table of it to draw the sprite through, counting from 0. overwrite: replace files that exist. Needs Pillow (the images extra).

Inputs: out (required), path (required), palette (required), frame, +7 more. Returns: result

tbl_to_jsonA

Convert a Diablo II string table (.tbl) on the local disk to a JSON file that can be edited and turned back with json_to_tbl. path: the .tbl file (extract it from an MPQ with mpq_extract first). out: the .json to write; an existing file is refused unless overwrite is true. The JSON has the table's version, hash table size and lookup limit, then "entries": one {"key", "text"} per line in string-number order (an entry's place in the list is its number, so add new strings at the end and don't reorder). Text is UTF-8; a key or text that isn't valid UTF-8 is kept exactly as "key_hex" / "text_hex". The reply says whether json_to_tbl would rebuild the same bytes from it.

Inputs: out (required), path (required), overwrite. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 45 tools

    Disambiguation4/5

    Tools are organized by resource and domain (knowledge base, game data tables, source code, decompiled binaries, MPQ archives, strings, sprites, calculators, saves), so most purposes are clearly distinct. There is potential overlap among the several search/read tools and the function-index trio, but the descriptions make the boundaries clear enough.

    Naming Consistency4/5

    Almost all tool names are snake_case and follow predictable verb_noun or noun_noun patterns, with consistent prefixes such as mpq_, decomp_, sprite_, and png_to_. Minor deviations like calculate, function_across_versions, and domain abbreviations are readable and do not break the overall consistency.

    Tool Count2/5

    45 tools is far above the comfortable 3-15 range and creates significant selection overhead for an agent. The broad Diablo II research/modding scope justifies many tools, but the set is heavy and could be consolidated or namespaced further.

    Completeness4/5

    The surface covers knowledge search/reading, game data search/read/diff, source and decompiled code, function indexing, MPQ operations, string tables, sprites, gameplay calculators, and save inspection, which is unusually complete for the domain. Minor documented gaps remain, such as D2R save item decoding and lack of direct in-game verification, but agents can work around most of them.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers