Skip to main content
Glama

memory_import

Import memory data from JSON format to the Memora server. Choose import strategy: replace existing memories, merge with duplicates skipped, or append all new entries.

Instructions

Import memories from JSON format. Rate limited: 60s cooldown.

Args: data: List of memory dictionaries with content, metadata, tags, created_at strategy: "replace" (clear all first), "merge" (skip duplicates), or "append" (add all)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYes
strategyNoappend

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • Implementation of the memory_import MCP tool.
    async def memory_import(
        data: List[Dict[str, Any]],
        strategy: str = "append",
    ) -> Dict[str, Any]:
        """Import memories from JSON format. Rate limited: 60s cooldown.
    
        Args:
            data: List of memory dictionaries with content, metadata, tags, created_at
            strategy: "replace" (clear all first), "merge" (skip duplicates), or "append" (add all)
        """
        # Validate inputs before consuming cooldown
        if strategy not in ("replace", "merge", "append"):
            return {"error": "invalid_input", "message": f"Unknown strategy: {strategy}"}
        if not data:
            return {"error": "invalid_input", "message": "No data provided"}
    
        if msg := _check_tool_cooldown("memory_import"):
            return {"error": "rate_limited", "message": msg}
        try:
            result = _import_memories(data, strategy)
            _schedule_cloud_graph_sync()
            return result
        except ValueError as exc:
            return {"error": "invalid_input", "message": str(exc)}
        finally:
            _finish_tool("memory_import")
Behavior4/5

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

With no annotations provided, the description carries full burden and successfully discloses rate limiting and the behavioral differences between strategies (e.g., 'replace' clears all first). Could mention atomicity or error handling.

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?

Front-loaded purpose statement followed by critical constraint (rate limit), then structured Args section. No redundant text; every sentence provides necessary information given the schema deficiencies.

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

Completeness4/5

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

Given 0% schema coverage and complex nested input structure, the description adequately documents parameters and behavioral constraints. Output schema exists so return values need not be described; only missing potential error conditions or validation rules.

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

Parameters5/5

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

Schema has 0% description coverage, but the Args section fully compensates by detailing 'data' structure (content, metadata, tags, created_at) and explaining each strategy option's semantics.

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?

States specific verb 'Import' with resource 'memories' and format 'JSON', clearly distinguishing it from sibling tools like memory_export, memory_create, or memory_merge.

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?

Provides clear context through the strategy options (replace/merge/append) and rate limit warning (60s cooldown), though it doesn't explicitly contrast with alternatives like memory_create_batch.

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/agentic-box/memora'

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