Skip to main content
Glama
dmang-dev

mcp-dolphin

dolphin_read_range

Read a contiguous range of PowerPC memory as a hex dump. Efficient batch read for RAM analysis, snapshot comparison, and struct inspection.

Instructions

PURPOSE: Read a contiguous range of bytes from PowerPC memory as a hex dump. USAGE: For >4 bytes — far cheaper than looping dolphin_read8 (one bridge round-trip vs N). Max 65536 bytes/call; chunk larger reads in 64 KiB. Powers snapshot-diff RAM hunting, unknown-struct inspection, and region capture. BEHAVIOR: No side effects. The bridge reads byte-by-byte via Felk's memory.read_u8 then returns hex over the wire. No alignment requirement.

GameCube + Wii main address space landmarks (PowerPC, big-endian): 0x80000000-0x817FFFFF MEM1 main RAM (24 MiB) — GameCube + Wii game code & data GameCube games stay entirely within MEM1. Wii games use MEM1 for code and frequently-accessed data. 0x80000020 OS_GLOBALS — game-info struct (disc ID, FST, etc.) 0x80000034 OS_ARENA_LO (start of free MEM1 heap) 0x80003100 OS_REPORT (developer-console mirror, varies by SDK) 0x90000000-0x93FFFFFF MEM2 (64 MiB) — Wii ONLY. Larger texture/asset data, IOS work areas. Reading MEM2 on a GameCube game returns garbage / FAIL. 0xCC000000-0xCC00FFFF Hollywood I/O (Wii) / Flipper I/O (GameCube) — DMA, GPU FIFO, AI, EXI registers. Reads are usually safe, writes can wedge the emulator. Avoid. 0xCD000000-0xCD007FFF Wii-only Hollywood registers.

Notes: • All multi-byte values are BIG-ENDIAN on the real hardware. Felk's memory.read_u*/write_u* helpers handle the byte swap for you — the value you see is the value the game sees as a u32. • Addresses are 32-bit; Felk truncates the high bits of any u64 address argument. • Pointers in MEM1 are often stored as 4-byte addresses with the high bit set (e.g. 0x81234567). Dereferencing them requires no masking — pass the raw value back into memory.read_*.

RETURNS: 'ADDR_HEX [N bytes]:' header + space-separated 2-digit uppercase hex bytes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesStarting absolute PowerPC address. Bytes [address, address+length) are read. No alignment requirement.
lengthYesNumber of consecutive bytes to read (1-65536). Hard cap is the bridge's max; chunk larger reads yourself.

Implementation Reference

  • Handler for dolphin_read_range: takes address and length, calls memory.read_bytes via the Dolphin bridge, formats the result as hex bytes.
    case "dolphin_read_range": {
      const len = p.length as number;
      const hex = await dol.call<string>("memory.read_bytes", [a(), len]);
      const bytes = hex.match(/.{2}/g) ?? [];
      const spaced = bytes.map((b) => b.toUpperCase()).join(" ");
      return ok(`${addrHex(a())} [${bytes.length} bytes]:\n${spaced}`);
    }
  • src/tools.ts:155-181 (registration)
    Tool registration for dolphin_read_range including inputSchema (address, length) and description.
    {
      name: "dolphin_read_range",
      description:
        "PURPOSE: Read a contiguous range of bytes from PowerPC memory as a hex dump. " +
        "USAGE: For >4 bytes — far cheaper than looping dolphin_read8 (one bridge round-trip vs N). Max 65536 bytes/call; chunk larger reads in 64 KiB. Powers snapshot-diff RAM hunting, unknown-struct inspection, and region capture. " +
        "BEHAVIOR: No side effects. The bridge reads byte-by-byte via Felk's memory.read_u8 then returns hex over the wire. No alignment requirement.\n\n" +
        GC_WII_MEMORY_MAP + "\n\n" +
        "RETURNS: 'ADDR_HEX [N bytes]:' header + space-separated 2-digit uppercase hex bytes.",
      inputSchema: {
        type: "object",
        required: ["address", "length"],
        properties: {
          address: {
            type: "integer",
            minimum: 0,
            description: "Starting absolute PowerPC address. Bytes [address, address+length) are read. No alignment requirement.",
          },
          length: {
            type: "integer",
            minimum: 1,
            maximum: 65536,
            description: "Number of consecutive bytes to read (1-65536). Hard cap is the bridge's max; chunk larger reads yourself.",
          },
        },
        additionalProperties: false,
      },
    },
  • Input schema for dolphin_read_range requiring address and length (1-65536).
    {
      name: "dolphin_read_range",
      description:
        "PURPOSE: Read a contiguous range of bytes from PowerPC memory as a hex dump. " +
        "USAGE: For >4 bytes — far cheaper than looping dolphin_read8 (one bridge round-trip vs N). Max 65536 bytes/call; chunk larger reads in 64 KiB. Powers snapshot-diff RAM hunting, unknown-struct inspection, and region capture. " +
        "BEHAVIOR: No side effects. The bridge reads byte-by-byte via Felk's memory.read_u8 then returns hex over the wire. No alignment requirement.\n\n" +
        GC_WII_MEMORY_MAP + "\n\n" +
        "RETURNS: 'ADDR_HEX [N bytes]:' header + space-separated 2-digit uppercase hex bytes.",
      inputSchema: {
        type: "object",
        required: ["address", "length"],
        properties: {
          address: {
            type: "integer",
            minimum: 0,
            description: "Starting absolute PowerPC address. Bytes [address, address+length) are read. No alignment requirement.",
          },
          length: {
            type: "integer",
            minimum: 1,
            maximum: 65536,
            description: "Number of consecutive bytes to read (1-65536). Hard cap is the bridge's max; chunk larger reads yourself.",
          },
        },
        additionalProperties: false,
      },
    },
  • Python bridge helper that performs the actual byte-by-byte memory read via Felk's memory.read_u8 and returns hex string.
    def _read_bytes(p):
        address, length = p[0], p[1]
        if length < 1 or length > 65536:
            raise ValueError(f"length must be 1..65536, got {length}")
        out = bytearray(length)
        for i in range(length):
            out[i] = memory.read_u8(address + i)
        return out.hex()
Behavior5/5

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

With no annotations, the description fully discloses behavior: no side effects, no alignment requirement, real-time bridge byte-by-byte reading, big-endian byte swap handled by helpers, address truncation for 64-bit addresses, and memory region characteristics. It also describes the return format in detail.

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?

The description is well-structured with clear headers (PURPOSE, USAGE, BEHAVIOR, RETURNS) and front-loaded purpose. However, the memory region table is extensive and could be summarized or linked externally; it adds context but increases length. Still, every sentence earns its place for a complex 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?

The description is complete for a read tool with no output schema: it explains return format, covers edge cases (e.g., GameCube vs Wii memory, truncation), and provides enough context for safe and effective use. No gaps remain.

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 coverage is 100%, but the description adds significant meaning beyond the schema: explains address as absolute with no alignment requirement, length max 65536 with chunking advice, and provides a comprehensive memory region table to assist in choosing valid addresses. This adds substantial value for correct parameter selection.

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 explicitly states the purpose: 'Read a contiguous range of bytes from PowerPC memory as a hex dump.' It uses specific verbs ('read') and resources ('PowerPC memory') and distinguishes from siblings by noting it is cheaper for >4 bytes compared to looping dolphin_read8.

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

Usage Guidelines5/5

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

The description provides clear usage guidance: use for >4 bytes as it is far cheaper; specifies maximum size (65536 bytes) and recommends chunking larger reads; warns about reading MEM2 on GameCube (returns garbage) and avoiding Hollywood I/O. It explicitly compares to dolphin_read8, helping the agent choose between tools.

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/dmang-dev/mcp-dolphin'

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