Skip to main content
Glama

Import memories

import_memory

Import memories from a JSON array or .json export file with validation, duplicate checks, and dry-run default; set apply=true to insert without overwriting active memory.

Instructions

Import memories from a JSON array or a .json file inside data/exports/. Validates type, dedupes against existing memories, and never overwrites active memory blindly. Dry-run by default; pass apply=true to insert.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "import_memory"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoPath to a .json export file (must be inside data/exports/)
jsonNoInline JSON: an array of memory objects, or { memories: [...] }
applyNoActually insert memories (default false = dry run, just report)
userIdNoScope imported memories to a user (USER scope); overrides per-item userId
trustedNoTrusted import (default false). Auxiliary data (preferences/lessons/profile) is restored only when true; per-item trusted flags are ignored

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv2.4.2
    • removedInput schema / additionalProperties
      Removed value: -false
  2. Changed4 schema fields changedv2.3.5
    • addedInput schema / properties / file / maxLength
      Added value: +500
    • addedInput schema / properties / json / maxLength
      Added value: +8388608
    • addedInput schema / properties / trusted
      Added value: +{
      +  "description": "Trusted import (default false). Auxiliary data (preferences/lessons/profile) is restored only when true; per-item trusted flags are ignored",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / userId / description
      Previous value: -"Scope imported memories to a user (USER scope)"New value: +"Scope imported memories to a user (USER scope); overrides per-item userId"
  3. First observedv2.2.1

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does real work: it discloses validation of type, deduplication against existing memories, that active memory is never blindly overwritten, and that the operation is non-mutating unless apply=true. It omits what a skipped/duplicate item looks like in the result and any size or permission constraints, which keeps it below the top tier.

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?

Three short sentences, front-loaded with what is imported and from where, followed by behavior and then the safety/dry-run rule. Every clause carries information an agent needs; nothing is padding.

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?

For a 5-parameter mutation tool with no annotations and no output schema, the description covers inputs, validation, dedupe, overwrite safety and the dry-run gate, which is the critical surface. It leaves the result shape (counts, per-item errors) unexplained, which an agent would need to interpret the dry-run report, but the omission is narrow.

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%, so file, json, apply, userId and trusted are already documented, including the non-obvious trusted behavior around auxiliary data. The description restates the dry-run/apply behavior and the input shapes but adds no syntax, precedence, or edge-case meaning beyond the schema, so baseline 3 applies.

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 a specific verb and resource ('Import memories') plus the two accepted input forms ('a JSON array or a .json file inside data/exports/'). The inverse relationship to export_memory and the distinction from remember/save_lesson (bulk vs single) is implicit in the scope, and the name/schema line up without ambiguity.

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?

Gives concrete operational guidance: 'Dry-run by default; pass apply=true to insert', which tells the agent the calling pattern and that a safe preview exists. It stops short of naming when to prefer remember/save_lesson over a bulk import, or what the source of the export must be, so no explicit exclusions are stated.

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