Skip to main content
Glama

Agent memory: save

memory_set

Save, overwrite, or delete persistent key-value memory for AI agents across sessions, keys, and wallets, with optional expiry. Store text or JSON under a key and read it back later.

Instructions

Persistent memory for AI agents that survives across sessions, keys and wallets: save, overwrite or delete a value (text or JSON, up to 16,384 characters) under a key, with an optional expiry. Up to 500 keys per memory. Read it back with memory_get. Costs $0.002 per call.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "secret": "<secret>",
      "key": "<key>"
    },
    "name": "memory_set"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyYesKey, e.g. "user:42:preferences".
valueNoAny JSON value or text. Omit (or use delete: true) to delete the key.
deleteNoDelete this key.
secretYesYour private memory secret (16+ chars). The same secret always opens the same memory; share it to share memory between agents. Keep it secret: anyone with it can read and write.
ttl_secondsNoExpire after this many seconds (60 s to 1 year). Default: never.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Adds real behavior beyond the annotations: persistence across sessions, keys and wallets, a 16,384-character value cap, a 500-key per-memory limit, optional expiry, and a $0.002 per-call price. Note the tension that the description openly supports deletion while destructiveHint=false, but the description is the honest party here, so this is not an annotation contradiction. It stops short of describing what a successful write returns or what error occurs when the 500-key cap is hit.

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 tight sentences, front-loaded with the resource and operations, then limits and cost. Every clause carries information an agent would otherwise have to guess.

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 write tool with no output schema and full schema coverage, the description covers persistence, capacity, expiry, secret sharing, and pricing — enough to call it correctly. The remaining gap is response/error behavior (what a successful set returns, what happens at the 500-key limit), which matters for retry logic.

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 coverage is 100%, so the schema already documents key, value, delete, secret, and ttl_seconds, including the 60s–1yr ttl bounds and the shared-secret semantics. The description's only added parameter meaning is the 16,384-character value limit, which is a useful but modest supplement over a fully documented schema.

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 resource (persistent agent memory) and enumerates the exact operations: save, overwrite, delete a value under a key, with optional expiry. It explicitly names the read counterpart memory_get, so an agent can separate write from read without opening either schema.

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?

The description tells the agent to use memory_get to read values back and implies set/overwrite/delete are all handled here, plus it discloses the per-call cost so the agent can weigh repeated calls. It does not state explicit when-not conditions (e.g., don't use for transient scratch data) or alternatives beyond memory_get.

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