Skip to main content
Glama
simen
by simen

saveSnapshot

Save the complete state of a Commodore 64 emulation session to a file for debugging, creating restore points, or sharing exact machine configurations.

Instructions

Save the complete machine state to a file.

Creates a VICE snapshot file containing:

  • All memory (RAM, I/O states)

  • CPU registers

  • VIC-II, SID, CIA states

  • Disk drive state (if attached)

Use to:

  • Save state before risky debugging

  • Create restore points

  • Share exact machine state

Related tools: loadSnapshot

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesFilename for the snapshot (e.g., 'debug-state.vsf')

Implementation Reference

  • MCP tool handler for 'saveSnapshot'. Extracts filename argument and calls the ViceClient saveSnapshot method, formats success/error response.
    async (args) => { try { await client.saveSnapshot(args.filename); return formatResponse({ success: true, filename: args.filename, message: `Snapshot saved to ${args.filename}`, hint: "Use loadSnapshot() to restore this state later", }); } catch (error) { return formatError(error as ViceError); } }
  • Zod input schema defining the 'filename' string parameter for the saveSnapshot tool.
    inputSchema: z.object({ filename: z.string().describe("Filename for the snapshot (e.g., 'debug-state.vsf')"), }),
  • src/index.ts:932-966 (registration)
    Registration of the 'saveSnapshot' tool with the MCP server using server.registerTool, including description, schema, and handler.
    server.registerTool( "saveSnapshot", { description: `Save the complete machine state to a file. Creates a VICE snapshot file containing: - All memory (RAM, I/O states) - CPU registers - VIC-II, SID, CIA states - Disk drive state (if attached) Use to: - Save state before risky debugging - Create restore points - Share exact machine state Related tools: loadSnapshot`, inputSchema: z.object({ filename: z.string().describe("Filename for the snapshot (e.g., 'debug-state.vsf')"), }), }, async (args) => { try { await client.saveSnapshot(args.filename); return formatResponse({ success: true, filename: args.filename, message: `Snapshot saved to ${args.filename}`, hint: "Use loadSnapshot() to restore this state later", }); } catch (error) { return formatError(error as ViceError); } } );
  • ViceClient method that implements the VICE binary monitor protocol to save a snapshot by sending the Dump command with filename.
    async saveSnapshot(filename: string): Promise<void> { const filenameBuffer = Buffer.from(filename, "utf8"); const body = Buffer.alloc(1 + filenameBuffer.length); body[0] = filenameBuffer.length; filenameBuffer.copy(body, 1); await this.sendCommand(Command.Dump, body); }

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/simen/vice-mcp'

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