Skip to main content
Glama

ppsspp_write16

Write a 16-bit little-endian value to PSP memory for cheats or pokes. Overwrites two bytes without undo, returns confirmation or error.

Instructions

PURPOSE: Write an unsigned 16-bit little-endian value to PSP memory. USAGE: Use for 16-bit cheats and pokes (HP, score, coordinates). For single bytes use ppsspp_write8; for 32/larger use ppsspp_write32/write_range. BEHAVIOR: DESTRUCTIVE: overwrites two bytes with no undo. PSP is little-endian (low byte at address, high at address+1). Returns an error if address+2 exceeds valid memory or value > 65535. RETURNS: Single line 'Wrote VAL → 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.
valueYes16-bit value (0-65535).

Implementation Reference

  • Tool definition and input schema for ppsspp_write16: accepts 'address' (integer >=0) and 'value' (integer 0-65535). Registered in the TOOLS array alongside other tools.
    {
      name: "ppsspp_write16",
      description:
        "PURPOSE: Write an unsigned 16-bit little-endian value to PSP memory. " +
        "USAGE: Use for 16-bit cheats and pokes (HP, score, coordinates). For single bytes use ppsspp_write8; for 32/larger use ppsspp_write32/write_range. " +
        "BEHAVIOR: DESTRUCTIVE: overwrites two bytes with no undo. PSP is little-endian (low byte at `address`, high at address+1). Returns an error if address+2 exceeds valid memory or value > 65535. " +
        "RETURNS: Single line 'Wrote VAL → ADDR_HEX'.",
      inputSchema: {
        type: "object",
        required: ["address", "value"],
        properties: {
          address: { type: "integer", minimum: 0, description: ADDRESS_PARAM_DESC },
          value:   { type: "integer", minimum: 0, maximum: 65535, description: "16-bit value (0-65535)." },
        },
        additionalProperties: false,
      },
    },
  • Handler case in the CallToolRequestSchema switch: calls pp.call('memory.write_u16', {address, value}) to write a 16-bit value to PSP memory, returns 'Wrote VAL → ADDR_HEX'.
    case "ppsspp_write16": {
      await pp.call("memory.write_u16", { address: a(), value: p.value });
      return ok(`Wrote ${fmtHex(p.value)} → ${addrHex(a())}`);
    }
  • src/tools.ts:405-406 (registration)
    The registerTools function is exported and called from src/index.ts. It sets up the ListToolsRequestSchema handler (which returns the TOOLS array including ppsspp_write16) and the CallToolRequestSchema handler (which includes the ppsspp_write16 case).
    export function registerTools(server: Server, pp: PpssppClient): void {
      server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
Behavior5/5

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

With no annotations, the description fully discloses behavior: 'DESTRUCTIVE: overwrites two bytes with no undo', little-endian ordering, error conditions (address+2 exceeds memory or value > 65535), and return format. This is comprehensive beyond what annotations might provide.

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 clear sections (PURPOSE, USAGE, BEHAVIOR, RETURNS). Every sentence adds distinct value; no 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 covers all necessary aspects: purpose, usage, behavior, error conditions, and return format. It is complete for the agent to select and invoke correctly.

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% with descriptions already detailing memory layout and firmware variations. The description adds value by explaining little-endian implication ('low byte at `address`, high at address+1') and error condition for address+2, though these could be inferred.

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 'Write an unsigned 16-bit little-endian value to PSP memory', clearly identifying the verb, resource, and byte order. This differentiates the tool from siblings ppsspp_write8, ppsspp_write32, and ppsspp_write_range.

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

Usage Guidelines5/5

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

The USAGE section provides explicit guidance: 'Use for 16-bit cheats and pokes (HP, score, coordinates). For single bytes use ppsspp_write8; for 32/larger use ppsspp_write32/write_range.' This directly tells when to use the tool and when to choose 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