Skip to main content
Glama

import_memories

Bulk import memories from Mem0 API or local JSON files with duplicate detection. Restore backups or migrate external memories into the knowledge base, returning counts of imported, skipped, and failed items.

Instructions

Bulk import memories from external sources. Supports Mem0 API export or local JSON files. Processes in batches with duplicate detection. Use for migration or backup restoration. Returns: summary with imported/skipped/failed counts. Side effects: creates multiple memory records, updates search index.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesImport source. 'mem0_api': fetch from Mem0 cloud (requires api_key). 'json_file': read local file (requires file_path).
api_keyNoMem0 API token for authentication. Required when source='mem0_api'. Get from https://mem0.ai dashboard.
user_idNoUser namespace for imported memories. Default: "oliver".
priorityNoCache priority for all imported memories. Default: high (L1 cache).
file_pathNoAbsolute path to JSON file. Required when source='json_file'. Must be array of memory objects or {memories: [...]}.
batch_sizeNoMemories per batch. Lower values are safer but slower. Range: 10-200. Default: 50.
skip_duplicatesNoCheck each memory for duplicates before import. Slower but prevents bloat. Default: true.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changedv1.3.2
    • changedInput schema / properties / api_key / description
      Previous value: -"Mem0 API key (required for mem0_api source)"New value: +"Mem0 API token for authentication. Required when source='mem0_api'. Get from https://mem0.ai dashboard."
    • removedInput schema / properties / batch_size / default
      Removed value: -50
    • changedInput schema / properties / batch_size / description
      Previous value: -"Number of memories to import per batch"New value: +"Memories per batch. Lower values are safer but slower. Range: 10-200. Default: 50."
    • changedInput schema / properties / file_path / description
      Previous value: -"Path to JSON file (required for json_file source)"New value: +"Absolute path to JSON file. Required when source='json_file'. Must be array of memory objects or {memories: [...]}."
    • removedInput schema / properties / priority / default
      Removed value: -"high"
    • changedInput schema / properties / priority / description
      Previous value: -"Cache priority for imported memories"New value: +"Cache priority for all imported memories. Default: high (L1 cache)."
    • removedInput schema / properties / skip_duplicates / default
      Removed value: -true
    • changedInput schema / properties / skip_duplicates / description
      Previous value: -"Skip duplicate memories during import"New value: +"Check each memory for duplicates before import. Slower but prevents bloat. Default: true."
    • changedInput schema / properties / source / description
      Previous value: -"Source of memories to import"New value: +"Import source. 'mem0_api': fetch from Mem0 cloud (requires api_key). 'json_file': read local file (requires file_path)."
    • removedInput schema / properties / user_id / default
      Removed value: -"oliver"
    • changedInput schema / properties / user_id / description
      Previous value: -"User ID for mem0 API"New value: +"User namespace for imported memories. Default: \"oliver\"."
  2. First observedv1.3.1

TDQS

A4.5/5.0
Behavior5/5

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

The description explicitly discloses side effects: 'creates multiple memory records, updates search index' and states the return summary with imported/skipped/failed counts. This goes well beyond annotations, which only mark readOnly=false and idempotent=false, and is consistent with the lack of readOnlyHint.

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?

Each sentence serves a distinct purpose: scope, supported sources, processing behavior, intended use, return value, and side effects. The description is front-loaded with the core purpose and contains no filler.

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

Completeness5/5

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

For a tool with seven parameters and no output schema, the description covers the essential missing pieces: return summary and side effects, while the schema handles parameter semantics. It also directs to migration/backup use, and the sibling list provides enough separation for correct tool selection.

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?

Schema description coverage is 100%, and the schema already details enums, defaults, conditional requirements, and ranges. The description does not add new parameter-level meaning beyond restating batch/duplicate behavior, so the baseline 3 is appropriate.

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 opens with 'Bulk import memories from external sources', naming a specific verb, resource, and scope. It further specifies Mem0 API export or local JSON files and duplicate detection, which clearly differentiates it from siblings like add_memory and deduplicate_memories.

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

Usage Guidelines4/5

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

Explicitly states 'Use for migration or backup restoration', giving clear context for when to invoke the tool. It does not explicitly rule out alternatives such as add_memory for single inserts or deduplicate_memories for deduping existing stores, so it stops short of full when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.