Skip to main content
Glama

gb_disassemble_function

Trace a Game Boy function from an entry point to its terminal instruction, stopping at return or out-of-range jump instructions to analyze ROM code.

Instructions

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.
    

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": {
      "entry_point": "<entry_point>"
    },
    "name": "gb_disassemble_function"
  }
}

Input Schema

NameRequiredDescriptionDefault
entry_pointYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/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 so well: it discloses concrete termination conditions (RET 0xC9, RETI 0xD9, JP nn 0xC3 jumping outside the traced range), a 1024-instruction safety cap, and the no-ROM error case. It stops short of describing the returned representation or whether the operation has side effects, but the behavioral contract is unusually explicit.

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?

The traced action is front-loaded in the first sentence, with termination rules, safety cap, and error condition following in a logical order. Every sentence carries information; only the formatting line breaks are slightly awkward.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description should say what a trace returns (instruction list, address/mnemonic pairs, error object) — that gap matters for an agent trying to consume the result. Address-space semantics for entry_point are also unaddressed, though the termination and cap details cover most of the operational risk.

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?

Only one parameter and 0% schema description coverage, so the description must compensate. It names entry_point in context but never says what form it takes — ROM address, banked address, or symbolic label from kb_define_function — which is the main ambiguity for this tool. Partial credit for framing it as the trace start.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource combination: trace a function starting at the given entry point. This is clearly distinct from a raw range or single-PC disassembly, but it never names or contrasts with the sibling tools (gb_disassemble_range, gb_disassemble_at_pc), leaving the agent to infer the difference.

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?

Usage is implied by 'trace a function... to its terminal instruction', which suggests whole-function extraction rather than one-off decoding, and the 'error if no ROM loaded' prerequisite is useful. There is no explicit when-to-use vs. when-not guidance or reference to the alternative disassembly siblings.

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