Skip to main content
Glama

pine_read8

Read a single unsigned byte from PlayStation 2 emulated memory at a specified address, covering EE main RAM, hardware registers, VU memory, and more.

Instructions

Read a single unsigned byte (u8) from emulated memory.

PlayStation 2 main address space landmarks: 0x00000000 EE main RAM (32 MiB) — game code & data 0x10000000 Hardware registers (DMA, GIF, VIF, etc.) 0x11000000 VU0 / VU1 memory 0x12000000 GS privileged registers 0x1C000000 IOP RAM (2 MiB) 0x1F800000 IOP scratchpad 0x70000000 EE scratchpad (16 KiB) PINE memory operations target the EE address space.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesMemory address

Implementation Reference

  • Definition and inputSchema for the pine_read8 tool: reads a single unsigned byte (u8) from emulated memory, with an 'address' integer parameter.
    {
      name: "pine_read8",
      description: `Read a single unsigned byte (u8) from emulated memory.\n\n${PS2_REGIONS}`,
      inputSchema: {
        type: "object",
        required: ["address"],
        properties: { address: { type: "integer", description: "Memory address" } },
      },
    },
  • Handler for pine_read8 tool: calls pine.read8(addr()), formats the result as 'ADDR: VALUE (0xHEX)' via addrHex/fmtHex helpers.
    case "pine_read8":  return ok(`${addrHex(addr())}: ${fmtHex(await pine.read8(addr()))}`);
  • PineClient.read8() method: sends a PINE Read8 opcode (0x00) with the address as a 4-byte LE argument, returns the response as a single unsigned byte.
    async read8(addr: number): Promise<number> {
      const args = Buffer.alloc(4); args.writeUInt32LE(addr, 0);
      const r = await this.call(Op.Read8, args);
      return r.readUInt8(0);
    }
  • Opcode constant Read8 = 0x00, used by the PINE protocol client to request a single byte read.
    Read8:        0x00,
  • src/tools.ts:171-250 (registration)
    registerTools() sets up the CallToolRequestSchema handler with a switch-case that dispatches tool names including 'pine_read8'.
    export function registerTools(server: Server, pine: PineClient): void {
      server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
    
      server.setRequestHandler(CallToolRequestSchema, async (req) => {
        const { name, arguments: args = {} } = req.params;
        const p = args as Record<string, unknown>;
        const addr = () => p.address as number;
    
        switch (name) {
          case "pine_ping": {
            const v = await pine.getVersion();
            return ok(`OK — emulator: ${v}`);
          }
    
          case "pine_get_info": {
            const [title, id, uuid, gameVer, status] = await Promise.all([
              pine.getTitle().catch(() => "(unavailable)"),
              pine.getId().catch(() => "(unavailable)"),
              pine.getUuid().catch(() => "(unavailable)"),
              pine.getGameVersion().catch(() => "(unavailable)"),
              pine.getStatus(),
            ]);
            return ok(
              `Title:        ${title}\n` +
              `Serial:       ${id}\n` +
              `Disc CRC:     ${uuid}\n` +
              `Game version: ${gameVer}\n` +
              `Status:       ${status}`,
            );
          }
    
          case "pine_get_status": {
            return ok(`Status: ${await pine.getStatus()}`);
          }
    
          case "pine_read8":  return ok(`${addrHex(addr())}: ${fmtHex(await pine.read8(addr()))}`);
          case "pine_read16": return ok(`${addrHex(addr())}: ${fmtHex(await pine.read16(addr()))}`);
          case "pine_read32": return ok(`${addrHex(addr())}: ${fmtHex(await pine.read32(addr()))}`);
          case "pine_read64": return ok(`${addrHex(addr())}: ${fmtHex(await pine.read64(addr()))}`);
    
          case "pine_write8": {
            await pine.write8(addr(), p.value as number);
            return ok(`Wrote ${fmtHex(p.value as number)} → ${addrHex(addr())}`);
          }
          case "pine_write16": {
            await pine.write16(addr(), p.value as number);
            return ok(`Wrote ${fmtHex(p.value as number)} → ${addrHex(addr())}`);
          }
          case "pine_write32": {
            await pine.write32(addr(), p.value as number);
            return ok(`Wrote ${fmtHex(p.value as number)} → ${addrHex(addr())}`);
          }
          case "pine_write64": {
            const v = BigInt(p.value as string);
            await pine.write64(addr(), v);
            return ok(`Wrote ${fmtHex(v)} → ${addrHex(addr())}`);
          }
    
          case "pine_read_range": {
            const bytes = await pine.readRange(p.address as number, p.length as number);
            const hex = Array.from(bytes)
              .map((b) => b.toString(16).padStart(2, "0").toUpperCase())
              .join(" ");
            return ok(`${addrHex(p.address as number)} [${bytes.length} bytes]:\n${hex}`);
          }
    
          case "pine_save_state": {
            await pine.saveState(p.slot as number);
            return ok(`Save state triggered for slot ${p.slot}`);
          }
          case "pine_load_state": {
            await pine.loadState(p.slot as number);
            return ok(`Load state triggered for slot ${p.slot}`);
          }
    
          default:
            throw new Error(`Unknown tool: ${name}`);
        }
      });
    }
Behavior4/5

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

With no annotations, the description carries full burden. It explains the operation reads from emulated memory and lists address space landmarks. It does not mention side effects (likely none) or error conditions, but is honest and straightforward.

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?

Compact and efficiently structured: main action in first sentence, followed by a helpful memory map list. No redundant or vague sentences.

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 simple tool with one parameter and no output schema, the description is complete: it specifies what is read, from which address space, and provides a reference map. Return value is obvious (byte).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema provides 100% coverage for 'address' with basic description. The description adds significant value by including the memory map and noting that operations target the EE address space, enriching understanding 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?

Clearly states 'Read a single unsigned byte (u8) from emulated memory.' The verb and resource are explicit, and it distinguishes from siblings (read16, read32, etc.) by specifying the size (byte) and address space.

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?

Provides a memory map that contextualizes valid addresses, but does not explicitly state when to use this tool versus siblings (e.g., read16). The context is clear, but no exclusions or alternatives are mentioned.

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

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