Skip to main content
Glama

gb_decode_opcode

Disassemble SM83 bytecode into instructions with mnemonics, operands, cycle counts, and flag effects. Identify invalid opcodes that halt the CPU.

Instructions

Disassemble SM83 bytes into instructions.

Mnemonics, operands and encoding come from Pan Docs; cycle counts and flag effects come from gbdev.io/gb-opcodes (Pan Docs documents neither), and each field says which. Invalid opcodes that hard-lock the CPU are flagged.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
baseNoAddress the first byte sits at, for the listing.0
dataYesHex bytes, e.g. '3E 91 E0 40' or '3e91e040'.
limitNoMaximum instructions to decode.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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. It discloses what output fields are produced (mnemonics, operands, encoding, cycle counts, flag effects) and explicitly flags invalid opcodes that would hard-lock the CPU. It does not explicitly state that the operation is read-only, but that is strongly implied by 'Disassemble' and the described output.

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 concise and front-loaded with the primary purpose. It uses only two sentences, with the second sentence adding relevant source attributions and invalid-opcode behavior. No redundant or filler content.

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?

Given there is no output schema, the description provides useful context about the output fields (mnemonics, operands, encoding, cycle counts, flag effects) and edge-case handling (invalid opcodes flagged). It does not specify the exact output structure or types, but it gives enough context for an agent to understand what will be returned.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema descriptions already fully cover all three parameters (base, data, limit) with clear examples and constraints. The tool description adds no additional parameter semantics beyond what is in the schema, so a baseline score of 3 is appropriate.

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 the tool's purpose: 'Disassemble SM83 bytes into instructions.' It uses a specific verb ('Disassemble') and resource ('SM83 bytes'), and it distinguishes itself from nearby lookup/table tools by focusing on decoding raw bytes into instructions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is given on when to use this tool versus alternatives like gb_lookup_instruction or gb_opcode_table. The description mentions data sources and invalid opcode handling, but does not state conditions such as 'use when you have raw bytes to decode' or contrast with sibling tools.

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