Skip to main content
Glama
simen

VICE C64 Emulator MCP Server

by simen

saveSnapshot

Save the complete Commodore 64 emulator state 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

  • src/index.ts:944-978 (registration)
    MCP server registration of the 'saveSnapshot' tool, including full description, Zod input schema requiring a filename string, and the handler function.
    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);
        }
      }
    );
  • The handler function for the saveSnapshot MCP tool. It takes the filename argument, calls the underlying ViceClient.saveSnapshot method, formats success/error responses with metadata.
    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 validation for the saveSnapshot tool, requiring a single 'filename' string parameter.
    inputSchema: z.object({
      filename: z.string().describe("Filename for the snapshot (e.g., 'debug-state.vsf')"),
    }),
  • ViceClient helper method that implements the snapshot save by encoding the filename length-prefixed buffer and sending the VICE 'Dump' command over the protocol.
    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);
    }
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It describes what the tool does (saves state to a file) and what is included in the snapshot, but lacks details on behavioral traits like file format constraints, error handling, or performance implications. It adequately conveys the core operation but misses deeper behavioral context.

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 well-structured and front-loaded with the core purpose, followed by bullet points for details and usage guidelines. Every sentence adds value without redundancy, making it efficient and easy to parse for an AI agent.

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 the tool's complexity (saving full machine state) and lack of annotations or output schema, the description does a good job explaining what is saved and usage contexts. However, it could improve by mentioning output behavior (e.g., success confirmation or file path return) to be fully complete for an agent.

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?

The input schema has 100% description coverage, documenting the single 'filename' parameter. The description does not add parameter-specific semantics beyond the schema, but with only one parameter and high schema coverage, the baseline is strong. No additional param info is needed, so it scores above the minimum.

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 the specific action ('Save the complete machine state to a file') and resource ('machine state'), distinguishing it from siblings like 'loadSnapshot' (which loads) and 'screenshot' (which captures only screen). It explicitly lists what is included in the snapshot (memory, CPU registers, etc.), making the purpose unambiguous and distinct.

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 description provides explicit usage scenarios ('Save state before risky debugging', 'Create restore points', 'Share exact machine state') and names a related alternative tool ('loadSnapshot'), clearly indicating when to use this tool versus others. This gives clear context for application without ambiguity.

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

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