Skip to main content
Glama

ppsspp_step

Step the MIPS CPU forward by one instruction for instruction-level debugging. Use after pausing emulation to execute single code steps.

Instructions

PURPOSE: Step the MIPS CPU forward by ONE instruction (cpu.stepInto). USAGE: For instruction-level debugging — set a breakpoint, hit it, then step. NOT a frame-advance — one MIPS instruction is much smaller than one frame. To advance a frame's worth of execution, set a breakpoint at the start of the next frame's render and use ppsspp_resume. BEHAVIOR: Modifies emulator run state. Executes one MIPS instruction, then returns to stepping mode. Returns an error if emulation isn't currently in stepping mode (call ppsspp_pause first). RETURNS: Single line 'Stepped one instruction. PC: 0xADDR'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/tools.ts:299-307 (registration)
    Registration of the 'ppsspp_step' tool — defines its name, description (purpose/usage/behavior/returns), and empty input schema (no parameters required).
    {
      name: "ppsspp_step",
      description:
        "PURPOSE: Step the MIPS CPU forward by ONE instruction (cpu.stepInto). " +
        "USAGE: For instruction-level debugging — set a breakpoint, hit it, then step. NOT a frame-advance — one MIPS instruction is much smaller than one frame. To advance a frame's worth of execution, set a breakpoint at the start of the next frame's render and use ppsspp_resume. " +
        "BEHAVIOR: Modifies emulator run state. Executes one MIPS instruction, then returns to stepping mode. Returns an error if emulation isn't currently in stepping mode (call ppsspp_pause first). " +
        "RETURNS: Single line 'Stepped one instruction. PC: 0xADDR'.",
      inputSchema: { type: "object", properties: {} },
    },
  • Handler for the 'ppsspp_step' tool — calls PPSSPP's 'cpu.stepInto' WebSocket RPC, which executes one MIPS instruction and returns the new program counter. On success, returns a single-line string showing the PC address.
    case "ppsspp_step": {
      const r = await pp.call<{ pc?: number }>("cpu.stepInto");
      return ok(`Stepped one instruction. PC: ${r.pc !== undefined ? addrHex(r.pc) : "(unknown)"}`);
    }
  • Helper function 'addrHex' used in the handler to format the program counter as a zero-padded 8-digit hex address (e.g., 0x08900000).
    function addrHex(n: number): string {
      return `0x${n.toString(16).toUpperCase().padStart(8, "0")}`;
    }
  • The PpssppClient.call() method used by the step handler — sends a ticketed request (cpu.stepInto) over WebSocket and awaits the correlated response. This is the transport mechanism for the RPC call.
      /**
       * Send a request and wait for the ticketed response. `event` is the
       * PPSSPP method name (e.g. "memory.read_u16"). `params` is merged into
       * the request object alongside `event` and `ticket`.
       *
       * The returned object is the FULL response (including `event` and
       * `ticket` fields); callers usually want a specific field like
       * `value` or `base64` — pull it from the result.
       */
      async call<T extends Record<string, unknown> = Record<string, unknown>>(
        event: string,
        params: Record<string, unknown> = {},
      ): Promise<T> {
        // Auto-(re)connect on demand. PPSSPP can be launched, closed, relaunched
        // at any point during the MCP server's lifetime; ensureConnected() will
        // bring the socket back up (or throw a clear error if PPSSPP isn't
        // reachable). Without this, a single failed connect at MCP boot would
        // leave every subsequent tool call broken until MCP-client restart.
        await this.ensureConnected();
        return new Promise<T>((resolve, reject) => {
          const ticket = `t${this.nextTicket++}`;
          const pending: PendingCmd = {
            ticket,
            resolve: (r) => resolve(r as T),
            reject,
          };
    
          const timer = setTimeout(() => {
            this.inflight.delete(ticket);
            reject(new Error(
              `PPSSPP call "${event}" timed out (${this.timeoutMs}ms) — ` +
              `is PPSSPP running with "Allow remote debugger" enabled?`,
            ));
          }, this.timeoutMs);
          const origResolve = pending.resolve, origReject = pending.reject;
          pending.resolve = (r) => { clearTimeout(timer); origResolve(r); };
          pending.reject  = (e) => { clearTimeout(timer); origReject(e); };
    
          this.inflight.set(ticket, pending);
          const msg = JSON.stringify({ event, ticket, ...params });
          if (process.env.MCP_PPSSPP_DEBUG) {
            process.stderr.write(`[trace] TX: ${msg}\n`);
          }
          this.ws!.send(msg);
        });
      }
    }
Behavior5/5

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

Discloses state modification, execution of one instruction, return to stepping mode, and error condition (must be in stepping mode, requiring prior ppsspp_pause call). No annotations provided, so description fully carries the burden.

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?

Structured with labeled sections (PURPOSE, USAGE, BEHAVIOR, RETURNS), each sentence non-redundant and informative.

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?

Complete for a zero-parameter tool with no output schema; covers purpose, usage context, behavioral caveats, error conditions, and return format. References sibling tools for alternative behaviors.

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?

Input schema has zero parameters and 100% coverage; description adds no param info as none needed.

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?

Description uses specific verb 'step' and resource 'MIPS CPU', clearly distinguishes from sibling tools like ppsspp_resume by clarifying it's instruction-level, not frame-advance.

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?

Explicitly states when to use (instruction-level debugging after breakpoint), when not to use (not frame-advance), and provides alternative (ppsspp_resume for frame advance).

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