Skip to main content
Glama
AstralVoidZ
by AstralVoidZ

ppsspp_session

Manage PPSSPP debug sessions: start, stop, list, or inspect them, and wait until the emulated CPU boots before any memory or disassembly call.

Instructions

PURPOSE: Start / stop / inspect PPSSPP debug sessions — action=list / start / stop / get / wait_ready; wait_ready blocks until the emulated CPU is up.

USAGE: action='list' takes no other params and returns {sessions, count} (idle sessions >30min are auto-GC'd as a side effect; NOT a per-session health probe — use ppsspp_health(session_id=...) for that); action='start' needs iso_path (pass wait_ready=true to block until the CPU is up in the same call); stop/get/wait_ready need session_id. Call wait_ready AFTER start and BEFORE any memory tool — PPSSPP answers WebSocket before the CPU boots. start(resilient=true) self-heals boot wedges (blacklist quarantine + relaunch with the same session_id, ≤2 retries).

BEHAVIOR: STATE-CHANGE. start spawns a PPSSPP subprocess + WS debugger; stop terminates it (never taskkill the process yourself); wait_ready polls the probe lock-free and fails [BOOT_TIMEOUT] on wedge suspicion; list/get are read-only.

RETURNS: action=start/get → SessionResponse {session_id, iso_path, pid, ws_url, created_at, last_active_at, exec_count, ws_connected, recovered, restored (1 = session record was restored from sessions.json after a server restart, 0 = created in this process), ppsspp_version}; action=wait_ready → {action, ready, elapsed_s, probe_addr, probe_value, note} — elapsed_s is THIS call's wait duration, not the start→ready total; action=list → {sessions: [SessionResponse...], count}.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesSession operation. Valid values: - 'list': list all active sessions (no other params). Idle sessions (>30 min) are auto-GC'd as a side effect; returns {sessions, count}. NOT a per-session health probe — use ppsspp_health(session_id=…) for that. - 'start': launch a new PPSSPP session (requires iso_path). Set wait_ready=true to block until the emulated CPU is up (same probe/budget semantics as 'wait_ready'). - 'stop': terminate an existing session (requires session_id). - 'get': query session health (requires session_id). - 'wait_ready': block until the emulated CPU has started (requires session_id). Call this after 'start' BEFORE any memory/disassembly tool — PPSSPP answers WebSocket before the ISO finishes booting, and early reads fail with 'CPU not started'.
iso_pathNoAbsolute path to the ISO file (required when action=start).
resilientNoaction=start only: self-healing boot — on wedge evidence (CPU-ready probe exhausted, handshake never accepted, process died) the launcher is torn down, the GPU-backend failure blacklist is quarantined (rename), and the session relaunches with the SAME session_id up to 2 retries; the response carries recovered=N (0 = first launch). Exhaustion raises [BOOT_TIMEOUT]. Ignored in fake mode.
timeout_sNoBoot budget in seconds (action=wait_ready, action=start with wait_ready=true, or the per-attempt CPU-ready budget when action=start with resilient=true; default 75, clamped to [1, 300]).
probe_addrNoHex address polled by the readiness probe (action=wait_ready, action=start with wait_ready=true, or the resilient-start gate; default '0x08804000', the project's top.prx load base).0x08804000
session_idNoSession ID (required when action=stop / get / wait_ready).
wait_readyNoaction=start only: block until the emulated CPU is ready before returning (same probe/budget as action=wait_ready; raises [BOOT_TIMEOUT] on wedge suspicion). Fake test mode is ready immediately. Default true: start() returns a session that is ready to use, so the first tool call does not fail with a version-handshake timeout. Pass false only when you want the raw launch without waiting.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidNoPPSSPP process PID (None if stopped).
noteNoOptional human context (e.g. fake-mode short-circuit).
countNoNumber of sessions.
readyNoTrue when the CPU-start probe succeeded.
actionNoLiteral 'wait_ready' (echoes the session action).
ws_urlNoWebSocket URL (ws://host:port/debugger).
iso_pathNoAbsolute path to the ISO file.
restoredNo1 when this session was restored from sessions.json (a previous server run left it behind) rather than started fresh in this process — its game state may be stale.
sessionsNoActive sessions.
elapsed_sNoWall-clock seconds spent polling.
recoveredNoresilient-start relaunch count (0 = the first launch succeeded; >0 means the game state was reset by a wedge heal — breakpoints need re-arming).
created_atNoISO 8601 timestamp of session creation.
exec_countNoNumber of tool calls made against this session.
probe_addrNoPolled address, hex string (default top.prx base).
session_idNoSession UUID-like identifier.
probe_valueNou32 read at probe_addr once ready, hex string (None in fake mode).
ws_connectedNoTrue if WebSocket is currently connected.
last_active_atNoISO 8601 timestamp of last tool call.
ppsspp_versionNoPPSSPP build fingerprint captured from the version handshake (None until the session transport binds).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.7
    • changedInput schema / properties / wait_ready / default
      Previous value: -falseNew value: +true
    • changedInput schema / properties / wait_ready / description
      Previous value: -"action=start only: block until the emulated CPU is ready before returning (same probe/budget as action=wait_ready; raises [BOOT_TIMEOUT] on wedge suspicion). Fake test mode is ready immediately. Default false keeps the historical two-call flow."New value: +"action=start only: block until the emulated CPU is ready before returning (same probe/budget as action=wait_ready; raises [BOOT_TIMEOUT] on wedge suspicion). Fake test mode is ready immediately. Default true: start() returns a session that is ready to use, so the first tool call does not fail with a version-handshake timeout. Pass false only when you want the raw launch without waiting."
    • changedOutput schema / $defs / SessionResponse / properties / recovered / description
      Previous value: -"H2: resilient-start relaunch count (0 = the first launch succeeded; >0 means the game state was reset by a wedge heal — breakpoints need re-arming)."New value: +"resilient-start relaunch count (0 = the first launch succeeded; >0 means the game state was reset by a wedge heal — breakpoints need re-arming)."
    • changedOutput schema / $defs / SessionResponse / properties / restored / description
      Previous value: -"F-6(a): 1 when this session was restored from sessions.json (a previous server run left it behind) rather than started fresh in this process — its game state may be stale."New value: +"1 when this session was restored from sessions.json (a previous server run left it behind) rather than started fresh in this process — its game state may be stale."
    • changedOutput schema / properties / recovered / description
      Previous value: -"H2: resilient-start relaunch count (0 = the first launch succeeded; >0 means the game state was reset by a wedge heal — breakpoints need re-arming)."New value: +"resilient-start relaunch count (0 = the first launch succeeded; >0 means the game state was reset by a wedge heal — breakpoints need re-arming)."
    • changedOutput schema / properties / restored / description
      Previous value: -"F-6(a): 1 when this session was restored from sessions.json (a previous server run left it behind) rather than started fresh in this process — its game state may be stale."New value: +"1 when this session was restored from sessions.json (a previous server run left it behind) rather than started fresh in this process — its game state may be stale."
  2. Changed11 schema fields changedv0.1.6
    • changedInput schema / properties / action / description
      Previous value: -"Session operation. Valid values:\n- 'start': launch a new PPSSPP session (requires iso_path). Set wait_ready=true to block until the emulated CPU is up (same probe/budget semantics as 'wait_ready').\n- 'stop': terminate an existing session (requires session_id).\n- 'get': query session health (requires session_id).\n- 'wait_ready': block until the emulated CPU has started (requires session_id). Call this after 'start' BEFORE any memory/disassembly tool — PPSSPP answers WebSocket before the ISO finishes booting, and early reads fail with 'CPU not started'."New value: +"Session operation. Valid values:\n- 'list': list all active sessions (no other params). Idle sessions (>30 min) are auto-GC'd as a side effect; returns {sessions, count}. NOT a per-session health probe — use ppsspp_health(session_id=…) for that.\n- 'start': launch a new PPSSPP session (requires iso_path). Set wait_ready=true to block until the emulated CPU is up (same probe/budget semantics as 'wait_ready').\n- 'stop': terminate an existing session (requires session_id).\n- 'get': query session health (requires session_id).\n- 'wait_ready': block until the emulated CPU has started (requires session_id). Call this after 'start' BEFORE any memory/disassembly tool — PPSSPP answers WebSocket before the ISO finishes booting, and early reads fail with 'CPU not started'."
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "start",
      -  "stop",
      -  "get",
      -  "wait_ready"
      -]New value: +[
      +  "list",
      +  "start",
      +  "stop",
      +  "get",
      +  "wait_ready"
      +]
    • addedOutput schema / $defs
      Added value: +{
      +  "SessionResponse": {
      +    "additionalProperties": false,
      +    "description": "Response view for a single session (start/stop/get).",
      +    "properties": {
      +      "created_at": {
      +        "description": "ISO 8601 timestamp of session creation.",
      +        "title": "Created At",
      +        "type": "string"
      +      },
      +      "exec_count": {
      +        "default": 0,
      +        "description": "Number of tool calls made against this session.",
      +        "title": "Exec Count",
      +        "type": "integer"
      +      },
      +      "iso_path": {
      +        "description": "Absolute path to the ISO file.",
      +        "title": "Iso Path",
      +        "type": "string"
      +      },
      +      "last_active_at": {
      +        "description": "ISO 8601 timestamp of last tool call.",
      +        "title": "Last Active At",
      +        "type": "string"
      +      },
      +      "pid": {
      +        "anyOf": [
      +          {
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "PPSSPP process PID (None if stopped).",
      +        "title": "Pid"
      +      },
      +      "ppsspp_version": {
      +        "anyOf": [
      +          {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "PPSSPP build fingerprint captured from the version handshake (None until the session transport binds).",
      +        "title": "Ppsspp Version"
      +      },
      +      "recovered": {
      +        "default": 0,
      +        "description": "H2: resilient-start relaunch count (0 = the first launch succeeded; >0 means the game state was reset by a wedge heal — breakpoints need re-arming).",
      +        "title": "Recovered",
      +        "type": "integer"
      +      },
      +      "restored": {
      +        "default": 0,
      +        "description": "F-6(a): 1 when this session was restored from sessions.json (a previous server run left it behind) rather than started fresh in this process — its game state may be stale.",
      +        "title": "Restored",
      +        "type": "integer"
      +      },
      +      "session_id": {
      +        "description": "Session UUID-like identifier.",
      +        "title": "Session Id",
      +        "type": "string"
      +      },
      +      "ws_connected": {
      +        "default": false,
      +        "description": "True if WebSocket is currently connected.",
      +        "title": "Ws Connected",
      +        "type": "boolean"
      +      },
      +      "ws_url": {
      +        "description": "WebSocket URL (ws://host:port/debugger).",
      +        "title": "Ws Url",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "session_id",
      +      "iso_path",
      +      "ws_url",
      +      "created_at",
      +      "last_active_at"
      +    ],
      +    "title": "SessionResponse",
      +    "type": "object"
      +  }
      +}
    • addedOutput schema / properties / action
      Added value: +{
      +  "description": "Literal 'wait_ready' (echoes the session action).",
      +  "title": "Action",
      +  "type": "string"
      +}
    • addedOutput schema / properties / count
      Added value: +{
      +  "description": "Number of sessions.",
      +  "title": "Count",
      +  "type": "integer"
      +}
    • addedOutput schema / properties / elapsed_s
      Added value: +{
      +  "description": "Wall-clock seconds spent polling.",
      +  "title": "Elapsed S",
      +  "type": "number"
      +}
    • addedOutput schema / properties / note
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Optional human context (e.g. fake-mode short-circuit).",
      +  "title": "Note"
      +}
    • addedOutput schema / properties / probe_addr
      Added value: +{
      +  "description": "Polled address, hex string (default top.prx base).",
      +  "title": "Probe Addr",
      +  "type": "string"
      +}
    • addedOutput schema / properties / probe_value
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "u32 read at probe_addr once ready, hex string (None in fake mode).",
      +  "title": "Probe Value"
      +}
    • addedOutput schema / properties / ready
      Added value: +{
      +  "description": "True when the CPU-start probe succeeded.",
      +  "title": "Ready",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / sessions
      Added value: +{
      +  "description": "Active sessions.",
      +  "items": {
      +    "$ref": "#/$defs/SessionResponse"
      +  },
      +  "title": "Sessions",
      +  "type": "array"
      +}
  3. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: declares START spawns a subprocess + WS debugger, STOP terminates it with an explicit 'never taskkill the process yourself' warning, wait_ready's lock-free polling and [BOOT_TIMEOUT] failure mode, the 30-min idle GC side effect, and resilient self-heal behavior. None of this is recoverable from the readOnlyHint=false/destructiveHint=false hints alone.

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?

Labeled PURPOSE/USAGE/BEHAVIOR/RETURNS sections are front-loaded and scannable. Some content (the RETURNS breakdown) is duplicated by the schema and output schema, so a few sentences do not strictly earn their place.

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 7-parameter, multi-action tool with no idempotency and open-world behavior, the description covers triggers, ordering, failure modes, and state semantics. An output schema exists, yet the description pre-explains the return shapes, leaving no gap an agent would need to fill.

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?

With 100% schema coverage the schema already documents each parameter, so the baseline is 3, but the description adds cross-parameter semantics the schema does not: which action consumes which argument, and the resilient-start reinterpretation of timeout_s as a per-attempt budget. It restates some field meanings rather than extending all of them, keeping it off a 5.

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 PURPOSE line names a specific resource (PPSSPP debug sessions) and enumerates the exact verb set (list/start/stop/get/wait_ready), so the agent knows the tool's scope instantly. It also explicitly differentiates from the sibling ppsspp_health for per-session health probing.

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?

USAGE spells out per-action parameter requirements and a hard ordering rule ('Call wait_ready AFTER start and BEFORE any memory tool') with the reason (WS answers before CPU boots). It names the alternative (ppsspp_health) and the fallback (pass wait_ready=true on start) rather than leaving routing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.