bizhawk_list_memory_domains
List memory domains recognized by the loaded emulator core. Use to find valid domain names for memory read/write operations.
Instructions
PURPOSE: List the memory domains available on the loaded core (e.g. 'WRAM', 'CARTRAM', 'VRAM', 'System Bus' on SNES; 'RAM', 'PPU', 'OAM' on NES). USAGE: Call before any memory r/w tool when you don't know the domain layout for the loaded system. The returned names are exactly what to pass as the domain parameter on bizhawk_read*/write* tools (case-sensitive). BEHAVIOR: No side effects — pure read. Returns an error if the loaded BizHawk core doesn't implement memory.getmemorydomainlist (extremely rare). RETURNS: Newline-formatted list of domain names, one per line.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:69-77 (registration)Tool registration in the TOOLS array defining the name, description, and input schema (no parameters required).
{ name: "bizhawk_list_memory_domains", description: "PURPOSE: List the memory domains available on the loaded core (e.g. 'WRAM', 'CARTRAM', 'VRAM', 'System Bus' on SNES; 'RAM', 'PPU', 'OAM' on NES). " + "USAGE: Call before any memory r/w tool when you don't know the domain layout for the loaded system. The returned names are exactly what to pass as the `domain` parameter on bizhawk_read*/write* tools (case-sensitive). " + "BEHAVIOR: No side effects — pure read. Returns an error if the loaded BizHawk core doesn't implement memory.getmemorydomainlist (extremely rare). " + "RETURNS: Newline-formatted list of domain names, one per line.", inputSchema: { type: "object", properties: {} }, }, - src/tools.ts:532-535 (handler)Handler in the CallToolRequestSchema switch-case: calls the BizHawk bridge with method 'list_memory_domains' and formats the returned array as a newline-separated list.
case "bizhawk_list_memory_domains": { const r = await bh.call<string[]>("list_memory_domains"); return ok("Memory domains:\n " + r.join("\n ")); } - src/bizhawk.ts:235-264 (helper)BizhawkServer.call() method — enqueues the 'list_memory_domains' RPC command via TCP to the Lua bridge and returns a promise that resolves with the result.
async call<T = unknown>(method: string, params: Record<string, unknown> = {}): Promise<T> { return new Promise<T>((resolve, reject) => { const id = this.nextId++; const pending: PendingCmd = { id, method, params, resolve: (r) => resolve(r as T), reject, }; const timer = setTimeout(() => { // Drop from queue if still waiting; from inflight if already sent. this.queue = this.queue.filter((p) => p.id !== id); this.inflight.delete(id); if (this.inflight.size === 0) this.awaitingResult = false; reject(new Error( `BizHawk call "${method}" timed out (${this.timeoutMs}ms) — ` + `is the bridge.lua script still polling?`, )); }, this.timeoutMs); // Wrap so the timer always clears const origResolve = pending.resolve, origReject = pending.reject; pending.resolve = (r) => { clearTimeout(timer); origResolve(r); }; pending.reject = (e) => { clearTimeout(timer); origReject(e); }; this.queue.push(pending); }); }