Skip to main content
Glama

ppsspp_read_range

Read a contiguous range of bytes from PSP memory and return as a space-separated hex dump. Fetches multiple bytes in a single call, reducing round trips.

Instructions

PURPOSE: Read a contiguous range of bytes from PSP memory and return as a hex dump. USAGE: Use whenever you need more than ~4 bytes — one round-trip vs N typed reads. PPSSPP returns the data base64-encoded over the wire; this tool decodes and formats as space-separated hex bytes. No hard size limit from the WebSocket but stay reasonable (≤16 KiB per call) for response sizes. BEHAVIOR: No side effects — pure read. Reads size consecutive bytes starting at address. Returns an error if any byte in the range is outside the valid PSP memory map. RETURNS: 'ADDR_HEX [N bytes]:' header + space-separated 2-digit uppercase hex bytes.

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.
sizeYesNumber of bytes to read (1-65536). Larger reads work but produce big responses.

Implementation Reference

  • src/tools.ts:110-126 (registration)
    Tool registration in TOOLS array — defines name, description, inputSchema (address + size params). Registered with the MCP server via ListToolsRequestSchema handler.
    {
      name: "ppsspp_read_range",
      description:
        "PURPOSE: Read a contiguous range of bytes from PSP memory and return as a hex dump. " +
        "USAGE: Use whenever you need more than ~4 bytes — one round-trip vs N typed reads. PPSSPP returns the data base64-encoded over the wire; this tool decodes and formats as space-separated hex bytes. No hard size limit from the WebSocket but stay reasonable (≤16 KiB per call) for response sizes. " +
        "BEHAVIOR: No side effects — pure read. Reads `size` consecutive bytes starting at `address`. Returns an error if any byte in the range is outside the valid PSP memory map. " +
        "RETURNS: 'ADDR_HEX [N bytes]:' header + space-separated 2-digit uppercase hex bytes.",
      inputSchema: {
        type: "object",
        required: ["address", "size"],
        properties: {
          address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC },
          size:    { type: "integer", minimum: 1, maximum: 65536, description: "Number of bytes to read (1-65536). Larger reads work but produce big responses." },
        },
        additionalProperties: false,
      },
    },
  • Input schema — requires address (integer >=0) and size (integer 1-65536). No additional properties allowed.
    inputSchema: {
      type: "object",
      required: ["address", "size"],
      properties: {
        address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC },
        size:    { type: "integer", minimum: 1, maximum: 65536, description: "Number of bytes to read (1-65536). Larger reads work but produce big responses." },
      },
      additionalProperties: false,
    },
  • Handler implementation — calls PPSSPP's memory.read via WebSocket with address and size, decodes base64 response, formats as space-separated uppercase hex bytes, returns with header showing address and byte count.
    case "ppsspp_read_range": {
      const r = await pp.call<{ base64: string }>("memory.read", { address: a(), size: p.size });
      const bytes = Buffer.from(r.base64 ?? "", "base64");
      const hex = Array.from(bytes).map((b) => b.toString(16).padStart(2, "0").toUpperCase()).join(" ");
      return ok(`${addrHex(a())} [${bytes.length} bytes]:\n${hex}`);
    }
Behavior5/5

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

The description fully discloses behavior: no side effects, returns an error if address or bytes are outside valid memory, and returns base64-decoded hex bytes. It explains the return format and decoding process, making it transparent.

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 well-structured with labeled sections (PURPOSE, USAGE, BEHAVIOR, RETURNS). Every sentence provides essential information without redundancy.

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 tool's simplicity (2 parameters, no output schema), the description fully covers purpose, usage, behavior, and return format. It also explains error conditions and the decoding process, making it complete.

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 both parameters (address and size) with descriptions and constraints. The description adds practical guidance (≤16 KiB recommendation) and notes that larger reads work but produce big responses, adding value 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 clearly states the tool reads a contiguous range of bytes from PSP memory and returns a hex dump. It distinguishes from sibling tools by specifying its use for more than ~4 bytes, providing a one-round-trip alternative to multiple typed reads.

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 description advises using this tool when more than ~4 bytes are needed, emphasizing efficiency. It also recommends staying at most 16 KiB for response sizes, but does not explicitly exclude other scenarios or specify when not to use it.

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