Skip to main content
Glama
vjsr007
by vjsr007

index-backup

Export all indexed notes to a JSON backup file, preserving full-text search data, tags, and semantic connections for easy retrieval and archiving.

Instructions

Export all notes to a JSON backup file and return the path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dirNo

Implementation Reference

  • src/mcp.ts:134-142 (registration)
    Registration of the 'index-backup' tool in the MCP server, including name, description, and input schema.
      name: 'index-backup',
      description: 'Export all notes to a JSON backup file and return the path.',
      inputSchema: {
        type: 'object',
        properties: {
          dir: { type: 'string' },
        },
      },
    },
  • Handler for 'index-backup' tool call: parses args, calls writeBackup on all notes, returns the backup file path.
    case 'index-backup': {
      const parsed = z.object({ dir: z.string().optional() }).parse(args ?? {});
      const file = writeBackup(db.exportAll(), parsed.dir);
      return { content: [{ type: 'text', text: JSON.stringify({ file }) }] };
    }
  • Core helper function writeBackup that creates the JSON backup file in the specified or default directory and returns the file path.
    export function writeBackup(notes: Note[], dir?: string): string {
      const backupDir = dir || path.resolve(process.cwd(), 'backups');
      if (!fs.existsSync(backupDir)) {
        fs.mkdirSync(backupDir, { recursive: true });
      }
      const file = path.join(
        backupDir,
        `notes-backup-${new Date().toISOString().replace(/[:.]/g, '-')}.json`
      );
      logger.info({ file, count: notes.length }, 'Writing JSON backup');
      fs.writeFileSync(file, JSON.stringify({ generatedAt: new Date().toISOString(), notes }, null, 2), 'utf8');
      return file;
    }
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 of behavioral disclosure. It states the action ('Export all notes') and output ('JSON backup file'), but lacks details on permissions required, whether it overwrites existing files, error handling, or performance implications (e.g., time/large datasets). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence that front-loads the core action ('Export all notes') and specifies key details (output format, return value). There is zero waste, and every word earns its place by clarifying the tool's function concisely.

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

Completeness2/5

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

Given the tool's complexity (a mutation operation exporting all notes), lack of annotations, no output schema, and low schema coverage, the description is incomplete. It doesn't cover parameter meaning, behavioral traits like file overwriting or errors, or output details beyond the path. For a backup tool with significant implications, more context is needed.

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?

The schema has 1 parameter ('dir') with 0% description coverage, so the description must compensate. It doesn't mention the parameter at all, failing to explain what 'dir' represents (e.g., output directory path). However, with only one parameter and a clear overall action, the baseline is moderate, but the description adds no value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Export') and resource ('all notes'), specifying the output format ('JSON backup file') and what's returned ('path'). It distinguishes from siblings like 'index-restore' (import) and 'index-upsert' (update), though it doesn't explicitly contrast with them. The purpose is unambiguous but lacks explicit sibling differentiation.

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., notes must exist), exclusions (e.g., not for partial backups), or comparisons to siblings like 'index-restore' for importing or 'image-export' for different data types. The description implies usage for full backups but offers no contextual advice.

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/vjsr007/mcp-index-notes'

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