Skip to main content
Glama

gb_memory_diff

Compare memory between two Game Boy save states to return changed bytes with addresses and old/new values.

Instructions

Compare memory between two save states and return changed bytes.

    Loads each state, dumps the requested memory regions, restores the
    original emulator state, and diffs the two dumps. Returns a list of
    ``(address, old_value, new_value)`` changes.

    The optional *regions* parameter accepts region names (e.g.
    ``["WRAM", "HRAM"]``). Prefix matching is supported: ``"WRAM"``
    matches both WRAM0 and WRAMX. Defaults to WRAM0 + WRAMX + HRAM.
    

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "state_id_a": "<state_id_a>",
      "state_id_b": "<state_id_b>"
    },
    "name": "gb_memory_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
regionsNo
state_id_aYes
state_id_bYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the internal sequence of loading each state, dumping regions, restoring the original emulator state, and diffing. That restore guarantee is real behavioral context an agent needs, since loading states is otherwise a mutating side effect. It stops short of covering failure modes (invalid state ids, non-existent region names).

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?

Front-loaded with the outcome in the first line, followed by mechanics and then parameter detail in a logical order. Slightly verbose with the loaded/restore narrative, but every clause conveys distinct information.

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?

No output schema exists, and the description compensates by naming the return shape as (address, old_value, new_value) tuples. With all three parameters effectively addressed and the side-effect behavior disclosed, little is missing apart from error conditions.

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 0%, so the description must compensate, and it does for the non-obvious parameter: 'regions' is explained with an example value, prefix-matching semantics ('WRAM' matches WRAM0 and WRAMX), and its default. The two state_id integers are left to their self-explanatory names, which is a minor remaining gap.

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?

States a specific verb and resource ('Compare memory between two save states') plus the result ('changed bytes'), which clearly separates it from siblings like gb_read_memory or gb_write_memory that operate on a single snapshot.

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?

The description implies this is the tool for diffing two save states but never explicitly says when to choose it over gb_read_memory or gb_list_states, nor does it give preconditions (e.g. states must already exist via gb_save_state). Usage is inferable rather than stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.