Skip to main content
Glama
suhitanantula

LLV Helix Framework

save_data

Store lines, loops, vibes, and contexts to persistent storage for later retrieval in the LLV Helix Framework's creativity workflows.

Instructions

Save current lines, loops, vibes, and contexts to persistent storage

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoOptional custom filename (without extension)

Implementation Reference

  • Schema definition for the save_data tool, including input schema for optional filename.
    { name: 'save_data', description: 'Save current lines, loops, vibes, and contexts to persistent storage', inputSchema: { type: 'object', properties: { filename: { type: 'string', description: 'Optional custom filename (without extension)', }, }, }, },
  • index.js:351-352 (registration)
    Registration and dispatch in the CallToolRequestSchema handler switch statement.
    case 'save_data': return this.saveData(args);
  • The core handler function that executes the save_data tool: checks persistence, ensures dir, serializes Maps to JSON, writes to file, returns success/error message.
    async saveData(args) { if (!this.persistenceEnabled) { return { content: [ { type: 'text', text: `❌ Data persistence is disabled. Set LLV_PERSISTENCE=true to enable.`, }, ], }; } try { await this.ensureDataDir(); const filename = args.filename || 'llv-session'; const filepath = join(this.dataDir, `${filename}.json`); const data = { timestamp: new Date().toISOString(), lines: this.mapToObj(this.lines), loops: this.mapToObj(this.loops), vibes: this.mapToObj(this.vibes), contexts: this.mapToObj(this.contexts), version: '1.0.0', }; await fs.writeFile(filepath, JSON.stringify(data, null, 2)); return { content: [ { type: 'text', text: `💾 Data saved successfully!\n\nFile: ${filepath}\nLines: ${this.lines.size}\nLoops: ${this.loops.size}\nVibes: ${this.vibes.size}\nContexts: ${this.contexts.size}\n\nTimestamp: ${data.timestamp}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `❌ Failed to save data: ${error.message}`, }, ], }; } }
  • Helper function used by saveData to convert internal Map data structures to plain objects for JSON serialization.
    mapToObj(map) { return Object.fromEntries(map); }
  • Helper function called by saveData to ensure the data persistence directory exists.
    async ensureDataDir() { try { await fs.mkdir(this.dataDir, { recursive: true }); } catch (error) { console.error('Failed to create data directory:', error); } }

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/suhitanantula/llv-helix'

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