Skip to main content
Glama
suhitanantula

LLV Helix Framework

save_data

Save your current lines, loops, vibes, and contexts to persistent storage with an optional custom filename.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameNoOptional custom filename (without extension)

Implementation Reference

  • Main handler for save_data tool - serializes lines, loops, vibes, and contexts to a JSON file in the data directory
    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}`,
            },
          ],
        };
      }
    }
  • Schema definition for save_data tool with optional filename parameter
    {
      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-358 (registration)
    Registration of save_data in CallToolRequestSchema switch-case handler
        case 'save_data':
          return this.saveData(args);
        case 'load_data':
          return this.loadDataTool(args);
        default:
          throw new Error(`Unknown tool: ${name}`);
      }
    });
  • Helper method that creates the data directory if it doesn't exist
    async ensureDataDir() {
      try {
        await fs.mkdir(this.dataDir, { recursive: true });
      } catch (error) {
        console.error('Failed to create data directory:', error);
      }
    }
  • Helper method converting Map to plain object for JSON serialization
    mapToObj(map) {
      return Object.fromEntries(map);
    }
    
    objToMap(obj) {
      return new Map(Object.entries(obj || {}));
    }
Behavior2/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 states it saves data but does not disclose whether it overwrites existing data, whether it requires prior data, or what happens on failure. This is insufficient for a write operation.

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?

Single sentence with no unnecessary words. Effectively communicates the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (single optional parameter, no output schema), the description is adequate but could elaborate on save behavior (e.g., overwrite, append) to be fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Input schema coverage is 100%, so the description does not need to add much. It mentions 'filename' but no additional semantic detail beyond the schema.

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 uses the specific verb 'Save' and lists the resources (lines, loops, vibes, contexts) being saved. It clearly distinguishes itself from siblings like load_data (the inverse operation).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for persisting state but does not provide explicit guidance on when to use it versus alternatives or any prerequisites. The context is clear but not comprehensive.

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

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