Skip to main content
Glama

ppsspp_write_range

Write a contiguous byte sequence to PSP memory at a specified address. Use for installing cheat tables, patching code blocks, or seeding memory regions.

Instructions

PURPOSE: Write a contiguous byte sequence to PSP memory starting at the given address. USAGE: Use for installing cheat tables, patching code blocks, or seeding regions. Bytes are sent base64-encoded over the wire. BEHAVIOR: DESTRUCTIVE: overwrites N bytes with no undo. Direct memory write. Returns an error if address+N exceeds valid memory or any byte value is outside 0-255. RETURNS: Single line 'Wrote N bytes → ADDR_HEX'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesPSP physical address. PSP memory layout: user RAM starts at 0x08800000 (or 0x08000000 — varies by firmware allocation), kernel RAM at 0x08000000-0x087FFFFF, VRAM at 0x04000000-0x041FFFFF, scratchpad at 0x00010000-0x00013FFF, hardware regs at 0xBC000000+. Most game state lives in user RAM. Note PPSSPP may also accept 0x88xxxxxx kernel-mode mirrors of the same physical memory.
bytesYesByte values (each 0-255), written sequentially from `address`.

Implementation Reference

  • Handler for ppsspp_write_range: converts the 'bytes' array to a Buffer, base64-encodes it, sends a 'memory.write' call to PPSSPP via WebSocket, and returns a confirmation with byte count and address.
    case "ppsspp_write_range": {
      const bytes = Buffer.from(p.bytes as number[]);
      const base64 = bytes.toString("base64");
      await pp.call("memory.write", { address: a(), base64 });
      return ok(`Wrote ${bytes.length} bytes → ${addrHex(a())}`);
    }
  • Input schema for ppsspp_write_range: requires 'address' (integer) and 'bytes' (array of integers 0-255, 1-65536 items).
    inputSchema: {
      type: "object",
      required: ["address", "bytes"],
      properties: {
        address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC },
        bytes: {
          type: "array",
          items: { type: "integer", minimum: 0, maximum: 255 },
          minItems: 1,
          maxItems: 65536,
          description: "Byte values (each 0-255), written sequentially from `address`.",
        },
      },
      additionalProperties: false,
    },
  • src/tools.ts:198-219 (registration)
    Tool registration entry for ppsspp_write_range in the TOOLS array, defining its name, description (PURPOSE/USAGE/BEHAVIOR/RETURNS), and input schema.
      name: "ppsspp_write_range",
      description:
        "PURPOSE: Write a contiguous byte sequence to PSP memory starting at the given address. " +
        "USAGE: Use for installing cheat tables, patching code blocks, or seeding regions. Bytes are sent base64-encoded over the wire. " +
        "BEHAVIOR: DESTRUCTIVE: overwrites N bytes with no undo. Direct memory write. Returns an error if address+N exceeds valid memory or any byte value is outside 0-255. " +
        "RETURNS: Single line 'Wrote N bytes → ADDR_HEX'.",
      inputSchema: {
        type: "object",
        required: ["address", "bytes"],
        properties: {
          address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC },
          bytes: {
            type: "array",
            items: { type: "integer", minimum: 0, maximum: 255 },
            minItems: 1,
            maxItems: 65536,
            description: "Byte values (each 0-255), written sequentially from `address`.",
          },
        },
        additionalProperties: false,
      },
    },
Behavior5/5

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

With no annotations, the description carries full burden. It explicitly states 'DESTRUCTIVE: overwrites N bytes with no undo' and 'Direct memory write.' It also describes error conditions: 'Returns an error if address+N exceeds valid memory or any byte value is outside 0-255.' This fully discloses the tool's behavioral traits.

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 structured into labeled sections (PURPOSE, USAGE, BEHAVIOR, RETURNS) making it highly scannable. Every sentence is informative with no redundancy. It is concise yet complete.

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?

The description covers purpose, usage, destructive behavior, error conditions, return format, and notes encoding. Given the complexity (memory write, address range validation) it is fairly complete. A minor gap: it does not mention if the PSP emulator needs to be paused, but sibling tools ppsspp_pause/resume likely handle that. Overall, it provides sufficient context.

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 coverage is 100%, so the baseline is 3. The description adds value by noting that bytes are 'base64-encoded over the wire' and specifying the return format: 'Single line "Wrote N bytes → ADDR_HEX"'. This provides semantic information beyond the schema's descriptions.

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 starts with a clear purpose statement: 'Write a contiguous byte sequence to PSP memory starting at the given address.' It specifies the verb (write), resource (PSP memory), and scope (contiguous byte sequence). It also lists specific use cases like 'installing cheat tables, patching code blocks, or seeding regions,' which distinguishes it from sibling tools that write single bytes/words or read memory.

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

Usage Guidelines4/5

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

The USAGE section provides explicit use cases: 'Use for installing cheat tables, patching code blocks, or seeding regions.' This gives context for when to use the tool. However, it does not explicitly contrast with alternatives like ppsspp_write8/16/32 for single-value writes or mention when not to use it. Still, the guidance is clear and helpful.

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

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