Skip to main content
Glama

ppsspp_read_range

Read a contiguous range of bytes from PSP memory and return them as a hex dump. Avoid multiple round-trips for large data by reading up to 16 KiB at once.

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

  • Schema definition for ppsspp_read_range tool — declares 'address' and 'size' integer parameters with PSP memory description.
    {
      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,
      },
    },
  • Handler for ppsspp_read_range — calls PPSSPP's 'memory.read' via WebSocket, decodes base64 response, formats as space-separated hex bytes with address header.
    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}`);
  • src/tools.ts:110-126 (registration)
    Tool registered in the TOOLS array (line 38-392) which is exposed via ListToolsRequestSchema handler at registerTools (line 406).
    {
      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,
      },
    },
  • Helper functions: ok() wraps text in MCP content response, addrHex() formats numbers as 0x-padded uppercase hex (used by the handler).
    function ok(text: string) {
      return { content: [{ type: "text" as const, text }] };
    }
    function fmtHex(n: unknown): string {
      if (typeof n !== "number") return String(n);
      return `${n} (0x${n.toString(16).toUpperCase()})`;
    }
Behavior5/5

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

The description thoroughly discloses behavior: no side effects ('pure read'), internal decoding/formatting, error conditions for invalid addresses, and no hard size limits but a recommended cap. Since no annotations are provided, the description carries full burden and meets it exceptionally.

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 well-organized with clear sections (PURPOSE, USAGE, BEHAVIOR, RETURNS), uses no redundant words, and is appropriately concise for the complexity of the tool.

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?

Despite no output schema, it fully describes the return format and error conditions, covers the tool's scope and limitations, and provides all necessary context for correct invocation.

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 input schema already has 100% coverage with detailed descriptions for both parameters. The tool description adds practical guidance (e.g., memory layout, recommended size limit) but does not introduce critical semantics beyond the schema, so baseline 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 explicitly states 'Read a contiguous range of bytes from PSP memory and return as a hex dump' and differentiates from sibling typed-read tools by noting its use for more than ~4 bytes, making it a specific verb+resource with clear distinction.

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?

It clearly advises using this tool for reads of more than ~4 bytes to avoid multiple round-trips and recommends a practical size limit (≤16 KiB). It does not explicitly exclude use cases for smaller reads, but the advice implies the alternatives.

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