Skip to main content
Glama

bizhawk_read32

Read an unsigned 32-bit little-endian value from emulator memory at a given address. Use for 32-bit fields like timestamps, pointers, or RGBA colors.

Instructions

PURPOSE: Read an unsigned 32-bit little-endian value from emulator memory at the given address. USAGE: Use for 32-bit fields (timestamps, large counters, pointers on 32-bit systems, RGBA colors). For 8/16-bit reads use bizhawk_read8/read16; for big-endian or unaligned multi-word reads use bizhawk_read_range and decode yourself. BEHAVIOR: No side effects — pure read. Reads four consecutive bytes starting at address and combines them as little-endian (LSB at address, MSB at address+3). Returns an error if the domain doesn't exist, address+4 exceeds the domain, or the core lacks memory.read_u32_le. RETURNS: Single line 'ADDR_HEX: VAL_DEC (0xVAL_HEX)'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesByte offset within the chosen memory domain. Per-domain offsets are 0-based and INDEPENDENT of system bus addresses (e.g. SNES WRAM uses 0x09C6, NOT 0x7E09C6). Reads 4 consecutive bytes starting here. Returns an error if address < 0 or address + 4 exceeds the domain's size.
domainNoOptional case-sensitive memory domain name. Omit to use BizHawk's currently selected domain (see bizhawk_get_info → current_memory_domain). Discover available names with bizhawk_list_memory_domains; they vary per system (WRAM on SNES, RAM on NES, RDRAM on N64, 68K RAM on Genesis, MainRAM on PSX, EWRAM/IWRAM on GBA). Returns an error if the name doesn't match any domain on the loaded core.

Implementation Reference

  • src/tools.ts:115-131 (registration)
    Tool definition/registration for bizhawk_read32 in the TOOLS array, including its description, purpose, usage guidance, behavior notes, and input schema (address required, domain optional).
    {
      name: "bizhawk_read32",
      description:
        "PURPOSE: Read an unsigned 32-bit little-endian value from emulator memory at the given address. " +
        "USAGE: Use for 32-bit fields (timestamps, large counters, pointers on 32-bit systems, RGBA colors). For 8/16-bit reads use bizhawk_read8/read16; for big-endian or unaligned multi-word reads use bizhawk_read_range and decode yourself. " +
        "BEHAVIOR: No side effects — pure read. Reads four consecutive bytes starting at `address` and combines them as little-endian (LSB at `address`, MSB at `address+3`). Returns an error if the domain doesn't exist, address+4 exceeds the domain, or the core lacks memory.read_u32_le. " +
        "RETURNS: Single line 'ADDR_HEX: VAL_DEC (0xVAL_HEX)'.",
      inputSchema: {
        type: "object",
        required: ["address"],
        properties: {
          address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC(4) },
          domain:  { type: "string", description: DOMAIN_PARAM_DESC },
        },
        additionalProperties: false,
      },
    },
  • Input schema for bizhawk_read32: requires 'address' (integer ≥0, reading 4 bytes), optional 'domain' string.
      inputSchema: {
        type: "object",
        required: ["address"],
        properties: {
          address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC(4) },
          domain:  { type: "string", description: DOMAIN_PARAM_DESC },
        },
        additionalProperties: false,
      },
    },
  • Handler in the CallToolRequestSchema switch: calls bh.call('read32', { address, domain? }) via BizhawkServer's RPC bridge, then formats result as 'ADDR_HEX: VAL_DEC (0xVAL_HEX)'.
    case "bizhawk_read32": return ok(`${addrHex(a())}: ${fmtHex(await bh.call<number>("read32", { address: a(), ...dom() }))}`);
Behavior5/5

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

With no annotations, the description fully covers behavioral traits: it declares 'No side effects — pure read', explains endianness handling (LSB at address, MSB at address+3), and lists error conditions (domain missing, address out of bounds, core lacking capability). No contradictions with absent annotations.

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?

The description is structured into clear sections (PURPOSE, USAGE, BEHAVIOR, RETURNS) with no redundant sentences. Every sentence provides unique, useful information, earning its place. It is appropriately sized for a tool of this complexity.

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?

Given the absence of an output schema, the description fully explains the return value format and error conditions. It covers all relevant aspects for a read tool: side effects, endianness, address semantics, domain usage, and alternatives. No gaps identified.

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?

Schema coverage is 100% and already describes parameters well. The description adds value by explaining that offsets are per-domain and independent of system bus addresses, and gives examples of domain names per system. It also clarifies the return format, which the schema does not cover.

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 clearly states it reads a 32-bit little-endian value from emulator memory. It distinguishes itself from siblings by explicitly referencing read8/read16 and read_range for other use cases, providing a clear, specific verb+resource.

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 explicitly states when to use this tool (32-bit fields) and when not to (8/16-bit reads, big-endian, unaligned multi-word), naming alternative tools (bizhawk_read8/16, bizhawk_read_range). This provides clear guidance for tool selection.

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-bizhawk'

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