Skip to main content
Glama

pine_save_state

Save the current emulator state (RAM, registers, GPU, audio, timing) to a numbered slot for rollback or sharing. Overwrites the target slot without confirmation.

Instructions

PURPOSE: Trigger the emulator to save complete state (RAM, registers, GPU, audio, timing) to a numbered slot. USAGE: Rollback point before risky writes, bookmarks, repro sharing. Companion pine_load_state restores from the same slot. PINE savestates are SLOT-BASED (0-255), not file-path-based — PCSX2 picks the disk location. BEHAVIOR: DESTRUCTIVE TO TARGET SLOT: silently overwrites prior contents — no prompt, no backup, no recovery. Bound to the exact game disc and PCSX2 version; loading mismatched usually crashes the core. The call returns when PCSX2 schedules the save, NOT when the file is on disk — brief half-written window possible. Errors on no game loaded, unwritable folder, or PINE FAIL.

RETURNS: 'Save state triggered for slot N'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
slotYesSave state slot number (0-255). The PINE protocol accepts the full 0-255 range. PCSX2 slot files live in PCSX2's per-game savestate folder (typically %USERPROFILE%/Documents/PCSX2/sstates on Windows, ~/.config/PCSX2/sstates on Linux) with filenames like '<serial> (<crc>).<slot>.p2s'. Slot numbers are independent of any path.

Implementation Reference

  • The handler/case for 'pine_save_state' in the CallToolRequestSchema switch. It calls pine.saveState(slot) and returns a success message.
    case "pine_save_state": {
      await pine.saveState(p.slot as number);
      return ok(`Save state triggered for slot ${p.slot}`);
    }
  • The tool definition (schema) for 'pine_save_state', including description and inputSchema with required 'slot' parameter (0-255 integer).
    {
      name: "pine_save_state",
      description:
        "PURPOSE: Trigger the emulator to save complete state (RAM, registers, GPU, audio, timing) to a numbered slot. " +
        `USAGE: Rollback point before risky writes, bookmarks, repro sharing. Companion pine_load_state restores from the same slot. PINE savestates are SLOT-BASED (0-255), not file-path-based — ${EMU_NAME} picks the disk location. ` +
        `BEHAVIOR: DESTRUCTIVE TO TARGET SLOT: silently overwrites prior contents — no prompt, no backup, no recovery. Bound to the exact game disc and ${EMU_NAME} version; loading mismatched usually crashes the core. The call returns when ${EMU_NAME} schedules the save, NOT when the file is on disk — brief half-written window possible. Errors on no game loaded, unwritable folder, or PINE FAIL.\n\n` +
        "RETURNS: 'Save state triggered for slot N'.",
      inputSchema: {
        type: "object",
        required: ["slot"],
        properties: {
          slot: { type: "integer", minimum: 0, maximum: 255, description: slotParamDesc(target) },
        },
        additionalProperties: false,
      },
    },
  • src/tools.ts:345-347 (registration)
    The registerTools function where tools are registered with the MCP server via setRequestHandler.
    export function registerTools(server: Server, pine: PineClient, target: TargetInfo): void {
      const TOOLS = buildTools(target);
      server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
  • The saveState helper method on PineClient that sends the SaveState opcode (0x09) with the slot argument over the PINE protocol.
    async saveState(slot: number): Promise<void> {
      const args = Buffer.alloc(1); args.writeUInt8(slot, 0);
      await this.call(Op.SaveState, args);
    }
  • The slotParamDesc helper function that generates the description for the slot parameter, used by the pine_save_state schema.
    function slotParamDesc(target: TargetInfo): string {
      return (
        `Save state slot number (0-255). The PINE protocol accepts the full 0-255 range. ` +
        target.savestateInfo +
        ` Slot numbers are independent of any path.`
      );
    }
Behavior4/5

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

With no annotations, the description carries full burden. It discloses destructive behavior (silently overwrites target slot), environment constraints (bound to game disc and PCSX2 version), timing behavior (returns when save scheduled, not when on disk), and error conditions. This is comprehensive but could mention performance implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description uses clear headings (PURPOSE, USAGE, BEHAVIOR, RETURNS) and is well-structured. However, it is somewhat verbose for a simple tool, with some redundancy and unnecessary detail about paths that could be streamlined.

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?

Given no output schema, the description includes return value format and error conditions. It covers the half-written window and dependencies. For a state-saving tool, it is sufficiently complete, though it lacks details about async execution or cancellation.

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 schema covers 100% of the parameter (slot) with a detailed description including range, protocol, and path info. The description adds minimal additional semantic value beyond restating the slot-based nature. 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 clearly states 'Trigger the emulator to save complete state (RAM, registers, GPU, audio, timing) to a numbered slot.' It specifies the verb, resource, and distinguishes the tool from siblings like pine_load_state. The slot-based nature is explicitly highlighted.

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 provides explicit usage guidance: 'Rollback point before risky writes, bookmarks, repro sharing' and mentions the companion tool pine_load_state. It gives clear context but does not fully list when not to use it beyond implying 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-pine'

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