Skip to main content
Glama

kb_retain

Store a fact, rule or event in your team's memory. For the CURRENT STATE of something that changes (a version, which model is in use, who owns what, where something runs) pass key: each key keeps only its current value, older values move to history, and lookups always return the latest. Make the key a short name for the thing (e.g. "production app version") and reuse the same key when it changes. For values that change (prices, stock, rankings, balances) ALWAYS set snapshot=true or an expiry: expired facts are retired automatically. To replace older memories (duplicates, or a state that has changed) pass replaces: they are retired once this is saved. The result lists the closest older memories (similar, id/date/first 80 characters by default; verbose=true for the full texts and the full note); you decide which to retire and leave the rest.

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": {
      "content": "<content>"
    },
    "name": "kb_retain"
  }
}

Input Schema

NameRequiredDescriptionDefault
keyNoKey of a current state (2-80 characters, e.g. "production app version"): content is the current value; saving the same key again replaces it. A new key that looks like an existing one is held back (similar_key) with the existing ones listed; if it is the same thing, use the existing key
bankNoMemory bank (leave empty for your space's default)
tagsNoOptional short tags
contentYesThe fact, in a sentence or two
contextNoOptional: where it came from
expiresNoExpires on this date (YYYY-MM-DD)
new_keyNoOnly with key: set true to save after a similar_key hold-back when it really is a different thing
similarNoList the closest older memories in the result (takes a few seconds). Default: off when replaces is given, on otherwise. Set false for bulk saves
verboseNotrue: the closest older memories in full (up to 300 characters each) and the full how-to note; default false: id, date and first 80 characters only, with a one-line note
replacesNoIds of older memories this one replaces (the id at the end of each result line, up to 10): they are retired once this is saved, and can be restored
snapshotNoA value that will change: expires in 30 days
valid_daysNoExpires after this many days (1-3650)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / verbose
      Added value: +{
      +  "default": false,
      +  "description": "true: the closest older memories in full (up to 300 characters each) and the full how-to note; default false: id, date and first 80 characters only, with a one-line note",
      +  "type": "boolean"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / key
      Added value: +{
      +  "description": "Key of a current state (2-80 characters, e.g. \"production app version\"): content is the current value; saving the same key again replaces it. A new key that looks like an existing one is held back (similar_key) with the existing ones listed; if it is the same thing, use the existing key",
      +  "type": "string"
      +}
    • addedInput schema / properties / new_key
      Added value: +{
      +  "description": "Only with key: set true to save after a similar_key hold-back when it really is a different thing",
      +  "type": "boolean"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / replaces
      Added value: +{
      +  "description": "Ids of older memories this one replaces (the id at the end of each result line, up to 10): they are retired once this is saved, and can be restored",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / similar
      Added value: +{
      +  "description": "List the closest older memories in the result (takes a few seconds). Default: off when replaces is given, on otherwise. Set false for bulk saves",
      +  "type": "boolean"
      +}
  4. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Beyond the annotations, the description discloses substantial behavior: keyed values keep only the current value while older ones move to history, expired facts retire automatically, replaces retire older memories but can be restored, similar-key hold-backs occur, and similar/verbose control what the result lists. These reversible-retirement behaviors are consistent with destructiveHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, then groups key, snapshot/expiry, replaces, and result semantics in a readable sequence. It is dense and occasionally run-on, and could be more scannable with structure, but each part is relevant to this complex 12-parameter tool.

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 write/memory-retention tool with 12 parameters and no output schema, the description covers the critical lifecycle and return behavior: current state, automatic expiry, replacement/retirement, similar-key handling, and result listing. Remaining fields such as bank, tags, context, and valid_days are documented in the schema, so there is no critical completeness gap.

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

Parameters4/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 explains each parameter. The description still adds decision-level meaning: how to choose a short reusable key, when to force snapshot or expiry for changing values, how replaces should be used, and how similar/verbose shape the returned older-memory list. Some of this overlaps with schema text, so it is strong but not maximally additive.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence states a specific verb and resource: 'Store a fact, rule or event in your team's memory.' The following sentences narrow it to current-state values and change-tracking use. Sibling differentiation is implicit rather than explicit; it never names an alternative such as kb_write or kb_recall.

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 gives clear contextual rules: use key for current state, set snapshot or expiry for volatile values, and pass replaces to retire older memories. It does not explicitly state when not to use this tool or name an alternative tool, so it falls short of full when/when-not/alternative guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources