Skip to main content
Glama
vjsr007
by vjsr007

index-restore

Restore notes from a JSON backup file to the MCP Index Notes server. Imports data and returns the count of successfully restored notes for efficient backup recovery.

Instructions

Restore notes from a JSON backup file. Returns imported count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYes

Implementation Reference

  • The core handler logic for the 'index-restore' tool. Parses the input arguments using RestoreSchema, reads the backup file using readBackup function, imports the notes into the database store via importMany, and returns the count of imported notes.
    case 'index-restore': {
      const parsed = RestoreSchema.parse(args);
      const notes = readBackup(parsed.file);
      db.importMany(notes);
      return { content: [{ type: 'text', text: JSON.stringify({ imported: notes.length }) }] };
  • Zod schema defining the input for 'index-restore' tool, requiring a 'file' string path to the JSON backup.
    export const RestoreSchema = z.object({
      file: z.string(),
    });
    
    export type RestoreInput = z.infer<typeof RestoreSchema>;
  • src/mcp.ts:144-153 (registration)
    MCP tool registration object defining the name, description, and input schema for 'index-restore' in the tools array.
      name: 'index-restore',
      description: 'Restore notes from a JSON backup file. Returns imported count.',
      inputSchema: {
        type: 'object',
        properties: {
          file: { type: 'string' },
        },
        required: ['file'],
      },
    },
  • Helper function readBackup that reads and parses the JSON backup file provided to index-restore, returning an array of notes.
    export function readBackup(file: string): Note[] {
      logger.info({ file }, 'Reading JSON backup');
      const raw = fs.readFileSync(file, 'utf8');
      const data = JSON.parse(raw) as { notes?: Note[] } | Note[];
      if (Array.isArray(data)) return data;
      return data.notes ?? [];
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that the tool 'Returns imported count,' which adds some context about the output, but fails to describe critical behaviors like whether this operation is destructive (e.g., overwrites existing notes), requires specific permissions, or has side effects like validation errors.

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 extremely concise with two sentences that directly state the action and result, with no wasted words. It is front-loaded, immediately conveying the core purpose, making it efficient and well-structured.

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 complexity of a restore operation (potentially destructive), no annotations, no output schema, and low schema coverage, the description is incomplete. It lacks details on error handling, what 'imported count' means (e.g., success vs. partial failures), and how it interacts with existing data, making it inadequate for safe and effective use.

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

Parameters2/5

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

The input schema has 0% description coverage, so the description must compensate. It implies that the 'file' parameter should be a JSON backup file, but doesn't specify the expected format, path, or content structure (e.g., whether it's a file path or raw JSON data). This leaves significant gaps in understanding how to use the parameter effectively.

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 verb ('Restore') and resource ('notes from a JSON backup file'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'index-backup' or 'graph-import-from-notes', which prevents a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'index-backup' (for creating backups) or 'graph-import-from-notes' (for importing notes in a different format). It also lacks prerequisites, such as needing an existing backup file, leaving usage context unclear.

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