Skip to main content
Glama

mgba_read16

Read a 16-bit unsigned integer from emulated GBA or GB/GBC memory at a given bus address, returning the value in decimal and hex. Use for game state fields like HP, score, or coordinates.

Instructions

PURPOSE: Read an unsigned 16-bit little-endian value from emulated memory at the given system bus address. USAGE: Use for 16-bit fields (most game-state values: HP, score, coordinates on 16-bit-flavoured layouts). For single bytes use mgba_read8; for 32-bit values use mgba_read32; for non-aligned spans, big-endian fields, or arbitrary structures use mgba_read_range and decode the bytes yourself (this tool always interprets bytes as little-endian, which matches both GBA and GB/GBC native endianness). BEHAVIOR: No side effects — pure read. Reads two consecutive bytes (low byte at address, high byte at address+1) and combines them as little-endian. Returns an error if the address is unmapped, the read straddles a region boundary, or the bridge method is missing on this build. RETURNS: Single line 'ADDR_HEX: VAL_DEC (0xVAL_HEX)'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesSystem bus address. On GBA pass full 32-bit addresses (e.g. 0x02000000 for EWRAM start, 0x03000000 for IWRAM, 0x08000000 for ROM); on GB/GBC pass 16-bit addresses (e.g. 0xC000 for WRAM, 0xA000 for cartridge SRAM). Reads 2 consecutive bytes starting here. Should be 2-byte aligned (multiple of 2); misaligned reads on ARM-class regions can return zero or stale bus values without raising an error. Returns an error if the address is outside the platform's mapped regions or if the named bridge method is missing on this mGBA build (check mgba_get_info → capabilities).
Behavior5/5

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

Despite no annotations, the description fully discloses behavior: pure read with no side effects, memory access details (two bytes, little-endian), and error conditions for unmapped addresses or region boundaries.

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 well-organized into clear sections (PURPOSE, USAGE, BEHAVIOR, RETURNS) and is concise with no extraneous information. Every sentence adds value.

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 simple tool with one parameter and no output schema, the description is complete: covers purpose, usage, behavior, return format, and error conditions. No gaps.

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?

The schema already covers the single parameter well (100% coverage), but the description adds valuable context about alignment, region-specific address hints, and error scenarios, going beyond the schema.

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 tool reads an unsigned 16-bit little-endian value from emulated memory, with a specific verb and resource. It distinguishes itself from siblings by naming alternative tools (mgba_read8, mgba_read32, mgba_read_range) uses.

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 when-to-use guidance: for 16-bit fields, and explicitly states when to use alternatives for different data sizes or endianness. It also mentions alignment considerations.

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

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