Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
romYesPath to your legally obtained Game Boy ROM file, passed with the --rom option (e.g. --rom your-game.gb).

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
pingA

Health check. Returns server status and whether a ROM is loaded.

gb_load_romB

Load a Game Boy ROM file into the emulator.

    Returns status, the parsed ROM title, and the resolved path.
    Supports headless mode (default: true).
    
get_session_infoB

Return current emulator session state.

Works whether or not a ROM is loaded.

gb_resetA

Reset the emulator to initial state (reloads the current ROM).

Returns error if no ROM is loaded.

get_rom_headerB

Parse and return the ROM header (0x0100-0x014F).

    Delegates to domain/rom_header.parse(). Returns error if no ROM loaded.
    
get_memory_mapA

Return the static Game Boy memory map.

Works without a loaded ROM (static data).

read_rom_bytesA

Read bytes from ROM at the given address and format as a hex dump.

length must be between 1 and 4096. Use bank for banked ROM reads. Returns error if no ROM loaded or parameters are invalid.

get_vector_tableA

Return RST vectors, interrupt vectors, and entry point with first bytes.

Returns error if no ROM loaded.

gb_read_memoryA

Read bytes from any memory address and return as a hex dump.

    Reads from live emulator memory (RAM, VRAM, I/O, ROM). For banked regions
    the current bank is used. Use gb_read_banked for explicit bank selection.
    length must be between 1 and 4096. Returns error if no ROM loaded.
    
gb_read_bankedB

Read bytes from a specific memory bank and return as a hex dump.

    Uses pyboy.memory[bank, address] syntax for explicit bank selection.
    length must be between 1 and 4096. Returns error if no ROM loaded.
    
gb_get_bank_infoB

Return MBC type, total bank count, and current ROM bank.

    Reads cartridge type (0x0147) and ROM size (0x0148) from the header,
    delegates to domain/bank_info for interpretation.
    Returns error if no ROM loaded.
    
gb_get_interrupt_statusA

Read IE (0xFFFF) and IF (0xFF0F) registers and interpret interrupt flags.

Delegates to domain/interrupts for flag parsing. Returns structured JSON with individual flag states (vblank, stat, timer, serial, joypad). Returns error if no ROM loaded.

gb_write_memoryA

Write bytes to a writable memory region (RAM, HRAM, VRAM, OAM).

Data is a hex string (e.g., "FF0042"). Address must be in a writable range. Returns confirmation with address and byte count written.

gb_disassemble_rangeA

Disassemble SM83 instructions starting at address.

    Decodes forward until *length* bytes are consumed, *end_address* is reached,
    or the 256-instruction safety cap is hit. At least one of *length* or
    *end_address* must be provided. Returns error if no ROM loaded.
    
gb_disassemble_functionA

Trace a function from entry_point to its terminal instruction.

    Stops at unconditional RET (0xC9), RETI (0xD9), or JP nn (0xC3) that jumps
    outside the traced range. Safety cap: 1024 instructions. Returns error if no
    ROM loaded.
    
gb_disassemble_at_pcA

Show instructions around the current program counter.

    Uses a backward-scan heuristic to find *before* instructions preceding PC,
    then decodes *after* instructions following it. The instruction at PC is
    marked with "current": true. Returns error if no ROM loaded.
    
kb_annotateC

Annotate a ROM address with a label, type, and/or comment.

    UPSERT: updates the existing annotation if address+bank already exists.
    Type must be one of: code, data, gfx, audio, text.
    
kb_define_functionC

Define a function at the given address.

Stores the function's name, parameter list (JSON), description, and return info. UPSERT on address+bank.

kb_define_variableB

Name a RAM variable at the given address.

    Type must be one of: u8, u16, bool, enum. UPSERT on address.
    
kb_searchB

Search the knowledge base.

    Searches across annotations, functions, and variables.
    Optional filter: label, comment, address, type.
    Returns max 50 results sorted by relevance.
    
kb_get_function_infoA

Retrieve all information about a function by name or address.

Accepts a function name (string match) or address (integer or hex string like "0x0150"). Returns function definition, local variables, cross-references, and comments.

kb_statsA

Statistics on decompilation progress.

    Returns total ROM addresses, annotated count (ROM-only), function
    count, variable count, and coverage percentage. Non-ROM annotations
    (address >= 0x8000) are excluded from the annotated count and
    coverage calculation.
    
kb_define_structB

Define a data structure with typed fields.

    Each field dict must have: name, offset, type, size.
    Optional: comment. Valid types: u8, u16, s8, s16, bool, bytes.
    Struct names must be unique — duplicates are rejected.
    
kb_apply_structA

Apply a struct definition to a memory region.

Reads live memory at the given address and decodes fields according to the struct layout. If count is provided, decodes that many consecutive struct instances (array of structs).

kb_define_enumB

Define a named enumeration with name-to-value mappings.

Enum names must be unique. All numeric values must be unique within the enum. Names must be non-empty.

kb_import_symbolsA

Import symbols from an external .sym file into the knowledge base.

Supports 'sym' (RGBDS), 'pokered' (pokered/pokecrystal), or 'auto' (auto-detect) format. Returns count of imported, skipped, and error symbols.

gb_stepA

Advance emulation by count steps and return CPU state.

    Modes:
    - "frame": advance *count* frames (fast, default).
    - "instruction": advance *count* individual CPU instructions via
      hook-based stepping (slower, precise).

    Returns current PC, decoded instruction at the new PC, and full
    register state.
    
gb_run_untilA

Execute until target_address is hit or timeout_frames exceeded.

    Registers a hook at the target address and ticks until the hook fires
    or the frame budget runs out. Returns registers at the breakpoint or
    {"error": "TIMEOUT", ...} if the target was not reached.
    
gb_get_registersB

Read all CPU registers and return them in spec format.

Returns the full SM83 register set including composite registers (AF, BC, DE, HL) and individual flag bits.

gb_set_registerA

Set a CPU register to a specific value.

    Supported registers: A, B, C, D, E, F, H, L, SP, PC.
    8-bit registers accept 0x00-0xFF, 16-bit (SP, PC) accept
    0x0000-0xFFFF. Writing to F masks to upper nibble (0xF0).
    
gb_press_buttonA

Press or release a Game Boy button.

    Validates the button name and action via domain functions. Does NOT
    automatically advance a frame — the caller controls timing.

    Valid buttons: a, b, start, select, up, down, left, right.
    Valid actions: press, release.
    
gb_save_stateA

Save the current emulator state to memory.

    States are stored in-memory (lost on server restart). Each save gets
    an auto-incrementing integer ID. Supports an optional human-readable
    name. Returns the state_id and metadata.
    
gb_load_stateB

Restore a previously saved emulator state.

    Returns registers as they are after restoration. Returns
    {"error": "NOT_FOUND", ...} if the state_id does not exist.
    
gb_list_statesA

List all saved emulator states with metadata.

    Returns state_id, name, frame_count, pc, and timestamp for each
    saved state. Does not include the raw state buffer.
    
gb_delete_stateB

Delete a previously saved emulator state.

    Returns {"error": "NOT_FOUND", ...} if the state_id does not exist.
    
gb_memory_diffA

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.
    
gb_screenshotA

Capture the Game Boy screen as a base64-encoded image.

Returns the screen buffer via MCP's image content type for multimodal display. Supports PNG and WebP formats, with optional integer scaling (nearest-neighbor interpolation preserves pixel art).

gb_get_lcd_statusA

Read LCD/PPU registers and return parsed state.

Reads LCDC (0xFF40), STAT (0xFF41), SCY/SCX, LY/LYC, WY/WX. LCDC and STAT bits are decoded into named fields. Returns error if no ROM loaded.

gb_get_timer_stateA

Read timer registers and return parsed state.

Reads DIV (0xFF04), TIMA (0xFF05), TMA (0xFF06), TAC (0xFF07). TAC is decoded into enabled flag and frequency. Returns error if no ROM loaded.

gb_get_audio_stateA

Read audio registers and return parsed state.

Optional channel param (1-4) for a single channel. Without channel, returns all channels plus master control. Channel 3 includes wave RAM (0xFF30-0xFF3F). Returns error if no ROM loaded or invalid channel.

gb_get_serial_stateA

Read serial port registers and return parsed state.

    Reads SB (0xFF01) and SC (0xFF02). SC is decoded into
    transfer_in_progress and clock_source fields.
    Returns error if no ROM loaded.
    
find_byte_patternB

Search for a byte pattern in ROM memory with wildcard support.

    Pattern syntax: hex bytes separated by spaces, '??' for wildcard.
    Example: 'CD ?? 40' matches any CALL to 0x40xx.
    Returns up to 100 matching addresses.
    
find_stringsB

Find text strings in ROM memory.

    Scans the ROM area for runs of decodable text characters.
    Supports 'ascii' and 'gb_custom' encodings.
    Returns up to 200 results.
    

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.3/5.0

Scored across 43 tools

Disambiguation4/5

Most tools are clearly distinct by domain: emulator control, memory access, hardware-state readers, disassembly, and knowledge-base operations. There is some overlap among read_rom_bytes, gb_read_memory, and gb_read_banked, but the descriptions explain the intended differences well enough to avoid most misselection.

Naming Consistency3/5

The set is mostly snake_case and often follows verb_noun patterns, but prefixes are inconsistent: many tools use gb_ or kb_, while others such as get_session_info, read_rom_bytes, find_strings, and ping do not. The names remain readable, but the mixed prefixing and occasional noun-only names reduce predictability.

Tool Count2/5

At 43 tools, the surface is heavy for a single MCP server and exceeds the typical well-scoped range. A complex emulator/debugger domain can justify breadth, but many operations could be grouped or consolidated, and the count makes discovery and selection harder.

Completeness4/5

Coverage is strong: ROM loading/reset, memory and register access, stepping, save states, hardware-state inspection, disassembly, search, screenshots, and a knowledge base are all present. Minor gaps exist around breakpoint/watchpoint lifecycle and persistent state export/import, but core debugging workflows are covered.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues