Skip to main content
Glama

storeMemory

Persist a decision, fact, warning, or summary to the local SQLite store so it stays available in future sessions. Each call creates a new record that is written to disk immediately.

Instructions

Persist a single memory unit to the local SQLite store. Accepts decisions, facts, architectural choices, warnings, and session summaries. NOT idempotent — each call creates a new record even with identical content. Writes to disk immediately.

WHEN TO CALL: After any significant decision, discovery, or conclusion that should be available in a future session. Good candidates: technology choices, non-obvious constraints, bug root-causes, architectural decisions, key facts about the codebase.

WHEN NOT TO CALL: For trivial observations, transient state, or content that duplicates what was just retrieved. Do not store entire files or full conversation transcripts.

kind categories: 'decision', 'fact', 'summary', 'warning', 'preference'. Write content to be self-contained — it must be useful without any surrounding conversation context. importance 1-10 (10 = most critical); directly affects retrieval ranking in future sessions.

RESPONSE may include warningCodes: 'session_write_limit_warning' (this session has stored many memories — stop storing trivia and prefer batchStoreMemory) and 'redaction_partial_failure' (a redaction rule errored; the write still succeeded). Treat them as advisory signals, not errors.

Input Schema

NameRequiredDescriptionDefault
kindYesCategory of this memory. One of: 'decision', 'fact', 'warning', 'preference', 'summary'. These are the only recognized kinds — others are rejected.
tagsNoOptional array of tag strings (max 10, each max 50 chars) for categorizing this memory. Example: ['auth', 'db-schema']. Tags are filterable via retrieveMemories.
contentYesThe memory text. Must be self-contained and specific — written so it is useful without surrounding conversation context. Avoid vague phrases like 'the user decided to...'.
memoryIdYesCaller-supplied unique UUID for this memory (e.g. crypto.randomUUID()). Used for deduplication and for later retrieval by ID via getMemory.
expiresAtNoOptional UTC ISO timestamp (e.g. '2026-12-31T00:00:00Z') after which this memory is excluded from retrieval. Use for time-limited context like a temporary workaround.
sessionIdYesIdentifier for the current session. Used to group memories by session for diagnostics. Use a consistent ID within a single session.
importanceYesInteger 1-10 indicating criticality (10 = most important). Directly affects ranking in future retrieveMemories calls. Use 8-10 for decisions that must not be forgotten; 3-5 for useful but non-critical facts.
sourceAdapterYesName of the adapter or host creating this memory (e.g. 'claude-code', 'cursor', 'generic'). Used for provenance tracking.
redactionEnabledNoIf true, PII is stripped from content before storage. Omit to use the project-level redaction setting from config.json.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.6.0
    • addedInput schema / properties / expiresAt
      Added value: +{
      +  "description": "Optional UTC ISO timestamp (e.g. '2026-12-31T00:00:00Z') after which this memory is excluded from retrieval. Use for time-limited context like a temporary workaround.",
      +  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$",
      +  "type": "string"
      +}
    • addedInput schema / properties / tags
      Added value: +{
      +  "description": "Optional array of tag strings (max 10, each max 50 chars) for categorizing this memory. Example: ['auth', 'db-schema']. Tags are filterable via retrieveMemories.",
      +  "items": {
      +    "maxLength": 50,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  "maxItems": 10,
      +  "type": "array"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "memoryId",
      -  "sessionId",
      -  "sourceAdapter",
      -  "content",
      -  "importance"
      -]New value: +[
      +  "memoryId",
      +  "sessionId",
      +  "sourceAdapter",
      +  "kind",
      +  "content",
      +  "importance"
      +]
  2. Changed9 schema fields changedv1.1.2
    • addedInput schema / properties / content / maxLength
      Added value: +10000
    • changedInput schema / properties / kind / description
      Previous value: -"Category of this memory. Recommended values: 'decision', 'fact', 'summary', 'warning', 'architecture'. Any non-empty string is valid."New value: +"Category of this memory. One of: 'decision', 'fact', 'warning', 'preference', 'summary'. These are the only recognized kinds — others are rejected."
    • addedInput schema / properties / kind / enum
      Added value: +[
      +  "decision",
      +  "fact",
      +  "warning",
      +  "preference",
      +  "summary"
      +]
    • removedInput schema / properties / kind / minLength
      Removed value: -1
    • addedInput schema / properties / memoryId / maxLength
      Added value: +200
    • addedInput schema / properties / sessionId / maxLength
      Added value: +200
    • addedInput schema / properties / sourceAdapter / maxLength
      Added value: +100
    • addedInput schema / properties / sourceAdapter / pattern
      Added value: +"^[^\\n\\r\\x00-\\x08\\x0e-\\x1f\\x7f]*$"
    • changedInput schema / required
      Previous value: -[
      -  "memoryId",
      -  "sessionId",
      -  "sourceAdapter",
      -  "kind",
      -  "content",
      -  "importance"
      -]New value: +[
      +  "memoryId",
      +  "sessionId",
      +  "sourceAdapter",
      +  "content",
      +  "importance"
      +]
  3. Changed7 schema fields changedv1.0.6
    • addedInput schema / properties / content / description
      Added value: +"The memory text. Must be self-contained and specific — written so it is useful without surrounding conversation context. Avoid vague phrases like 'the user decided to...'."
    • addedInput schema / properties / importance / description
      Added value: +"Integer 1-10 indicating criticality (10 = most important). Directly affects ranking in future retrieveMemories calls. Use 8-10 for decisions that must not be forgotten; 3-5 for useful but non-critical facts."
    • addedInput schema / properties / kind / description
      Added value: +"Category of this memory. Recommended values: 'decision', 'fact', 'summary', 'warning', 'architecture'. Any non-empty string is valid."
    • addedInput schema / properties / memoryId / description
      Added value: +"Caller-supplied unique UUID for this memory (e.g. crypto.randomUUID()). Used for deduplication and for later retrieval by ID via getMemory."
    • addedInput schema / properties / redactionEnabled / description
      Added value: +"If true, PII is stripped from content before storage. Omit to use the project-level redaction setting from config.json."
    • addedInput schema / properties / sessionId / description
      Added value: +"Identifier for the current session. Used to group memories by session for diagnostics. Use a consistent ID within a single session."
    • addedInput schema / properties / sourceAdapter / description
      Added value: +"Name of the adapter or host creating this memory (e.g. 'claude-code', 'cursor', 'generic'). Used for provenance tracking."
  4. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only carry idempotentHint=false and destructiveHint=false; the description adds material context beyond them — immediate disk writes, the non-idempotent duplicate-record behavior, redaction behavior, and the meaning of advisory warningCodes. Nothing contradicts the annotations.

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 with the core operation, then cleanly partitioned into WHEN TO CALL / WHEN NOT TO CALL / parameter notes / response notes. Despite its length, each block carries distinct, actionable information.

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 9-parameter mutation tool with no output schema, the description covers invocation context, behavioral caveats, and return-signal semantics (warningCodes). An agent has everything needed to call it correctly and interpret the response.

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 the schema already documents all 9 parameters. The description's notes on kind categories and importance's effect on retrieval ranking largely restate the schema rather than adding syntax or format detail, so the 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 ('Persist a single memory unit to the local SQLite store') and immediately scopes it as single-unit, which distinguishes it from the sibling batchStoreMemory. An agent can identify the operation without opening the schema.

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

Usage Guidelines5/5

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

Explicit WHEN TO CALL and WHEN NOT TO CALL sections with concrete examples (technology choices, bug root-causes vs. trivial observations, transcripts). It also routes to the alternative (batchStoreMemory) inside the write-limit warning, giving a clear switch condition.

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