Skip to main content
Glama
AstralVoidZ
by AstralVoidZ

ppsspp_assemble

Destructive

Assemble MIPS instructions and write bytes to PPSSPP emulator memory using a session ID, address, and code; protected regions require force.

Instructions

PURPOSE: Assemble MIPS instruction(s) and write the resulting bytes to memory.

USAGE: session_id + address + code ('

' or ';' separated — PPSSPP assembles one line per call so the tool loops; armips-style ';' comments are NOT supported here).

BEHAVIOR: DESTRUCTIVE. Protected ranges (kernel, top.prx code) need force=true. A partial write is reported with an error directing you to disassemble and inspect.

RETURNS: {address, code, bytes_written, response, text}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesMIPS assembly source. May be a single instruction ('nop', 'addiu r5, r0, 0x10') or multiple instructions separated by '\n' or ';'. The assembler is PPSSPP's built-in MIPS encoder.
forceNoSet to True to write assembled bytes to protected code/data regions of the modules loaded in THIS session (kernel memory below 0x08800000, plus the top.prx code section as reported by the live module list); declared data addresses from addresses.yaml are exempt. Writing to those ranges without force=True raises ToolError to prevent accidental crashes.
addressYesTarget address where assembled bytes will be written, as a hex string (e.g. '0x08804000'). Must be a valid MIPS-aligned address for the ISA.
session_idYesActive session ID.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesAssembly source string passed in.
textYesUnified text representation: 'Assembled N bytes → 0x{ADDR:08X}'.
addressYesTarget address, hex string (e.g. '0x08804000').
responseYesRaw PPSSPP WebSocket response.
bytes_writtenYesNumber of bytes written. Best-effort: derived from response['bytes'] length when available, else 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.7
    • changedInput schema / properties / force / description
      Previous value: -"Set to True to write assembled bytes to protected code-section addresses (kernel memory < 0x08800000 or top.prx code section 0x08804000-0x08D34000). Writing to these ranges without force=True raises ToolError to prevent accidental crashes."New value: +"Set to True to write assembled bytes to protected code/data regions of the modules loaded in THIS session (kernel memory below 0x08800000, plus the top.prx code section as reported by the live module list); declared data addresses from addresses.yaml are exempt. Writing to those ranges without force=True raises ToolError to prevent accidental crashes."
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so safety is partly covered. The description goes further by naming the protected ranges (kernel, top.prx code), the force=true escape hatch, and the partial-write error directing the agent to disassemble and inspect — meaningful operational detail beyond the annotations.

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?

Structured as PURPOSE/USAGE/BEHAVIOR/RETURNS with no filler; the critical constraint (one line per call) is front-loaded. The RETURNS line slightly duplicates the existing output schema, which is the only wasted sentence.

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?

For a destructive mutation tool, the description covers the force requirement, protected-range behavior, comment syntax limits, invocation loop, and error path; return values are already documented by the output schema and annotations cover the safety profile. Nothing essential to correct invocation is missing.

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 description coverage is 100%, so baseline is 3. The description adds value the schema does not: the assembler loops one line per call, ';' comments are not supported, and the partial-write/force semantics are summarized as an operational consequence rather than just a field definition.

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 (assemble) plus resource (MIPS instructions) and the side effect (write resulting bytes to memory). An agent can immediately distinguish this from ppsspp_write_memory (raw bytes) and ppsspp_disassemble (reverse direction) without opening a schema.

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 USAGE line names the required parameter triple and warns that ';' comments are unsupported and that PPSSPP assembles one line per call, so the tool loops. However, it never states when to prefer this over ppsspp_write_memory or ppsspp_run_script, and gives no exclusions or alternative routing.

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