Skip to main content
Glama
crabsmadethis

crabsmadethis/d2r-horadric-tools

d2r_chargen_list

Retrieve and display character names defined in chars/*.yaml files for Diablo II Resurrected modding, enabling quick review of configured characters.

Instructions

List character names defined in chars/*.yaml.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool registration via @mcp.tool() decorator for d2r_chargen_list. The async function delegates to the imported _chargen_list (alias for list_chars in d2r_mcp/chargen.py).
    @mcp.tool()
    async def d2r_chargen_list() -> dict:
        """List character names defined in chars/*.yaml."""
        return _chargen_list()
  • Core handler function list_chars() that lists character names from chars/*.yaml files. Scans the CHARS_DIR directory for .yaml files, excludes merc_templates.yaml, and returns a list of character names (file stems).
    def list_chars() -> dict:
        """List character names defined in chars/*.yaml (excludes merc_templates)."""
        cdir = _chars_dir()
        if not os.path.isdir(cdir):
            return ok(characters=[], chars_dir=cdir)
        names = []
        for f in sorted(os.listdir(cdir)):
            if f.endswith(".yaml") and f != "merc_templates.yaml":
                names.append(f[:-5])
        return ok(characters=names, chars_dir=cdir)
  • Helper _chars_dir() that resolves the CHARS_DIR path from d2r_chargen.config at call time.
    def _chars_dir() -> str:
        """Resolve CHARS_DIR at call time (respects monkeypatched env)."""
        from d2r_chargen.config import CHARS_DIR
        return CHARS_DIR
  • Envelope helper ok() used by list_chars to return a success response with status='ok'.
    def ok(**payload) -> dict:
        """Return a success envelope with the given payload merged in."""
        return {"status": "ok", **payload}
  • Import statement that binds list_chars from d2r_mcp.chargen as _chargen_list, which is then called by the tool handler.
    from d2r_mcp.chargen import (
        list_chars as _chargen_list,
        validate as _chargen_validate,
        build as _chargen_build,
        import_save as _chargen_import,
    )
Behavior2/5

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

No annotations are provided, so the description carries full burden. It only states it lists names from files, but does not mention permissions, side effects, or output format, leaving significant gaps.

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?

Single sentence, no wasted words. Front-loaded with action and target.

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

Completeness4/5

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

For a simple, no-parameter list tool, the description is mostly complete. However, it does not specify the exact format of the output (e.g., just names or full paths), leaving minor ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, and schema coverage is 100%. The description adds value by specifying the source ('chars/*.yaml'), which is not in the schema. Baseline for 0 params is 4.

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 uses a specific verb ('List') and resource ('character names defined in chars/*.yaml'), clearly distinguishing it from siblings like d2r_chargen_build or d2r_chargen_import.

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

Usage Guidelines3/5

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

No explicit guidance on when to use this tool versus alternatives. The purpose is implied (simple listing), but no exclusions or context for when not to use it.

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/crabsmadethis/d2r-horadric-tools'

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