Skip to main content
Glama

Memoria — Deterministic AI Memory & Code Intelligence MCP

Encode Memory

encode_memory

Store a single memory record in Memoreal Cloud (consumes 1 Write API call; non-idempotent: encoding identical text twice creates separate IDs until consolidate is run) and return { id, namespace, salience }. Defaults type to "episodic", salience to 0.5 (items >=0.7 or semantic/core surface in memory://rules), and namespace to "default" while rejecting reserved "org:" prefixes. Use when persisting one architectural decision, bug root cause, or user rule; use batch_encode instead for 2+ memories at once, or handoff_to_agent for cross-wing task handoffs.

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

Input Schema

NameRequiredDescriptionDefault
typeNoMemory tier classification (core and semantic receive 1.5x/1.25x recall boosts).episodic
contentYesNon-empty memory text to persist.
contextNoOptional [key, value] string pairs (for example [["file", "src/auth.js"]]) targetable by delete_by_context.
salienceNoImportance weight from 0.0 to 1.0 (use >=0.7 for durable team rules).
namespaceYesLogical project or workspace namespace (defaults to "default"; never prefix with "org:").

Output Schema

NameRequiredDescriptionDefault
idYesNewly created memory UUID.
salienceYesStored salience weight (0.0-1.0).
namespaceYesResolved client namespace.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changed
    • changedInput schema / properties / content / description
      Previous value: -"Memory text to persist."New value: +"Non-empty memory text to persist."
    • changedInput schema / properties / context / description
      Previous value: -"Optional array of [key, value] metadata pairs."New value: +"Optional [key, value] string pairs (for example [[\"file\", \"src/auth.js\"]]) targetable by delete_by_context."
    • addedInput schema / properties / context / items
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / namespace / description
      Previous value: -"Project or workspace namespace (for example \"my-project\")."New value: +"Logical project or workspace namespace (defaults to \"default\"; never prefix with \"org:\")."
    • addedInput schema / properties / salience / default
      Added value: +0.5
    • changedInput schema / properties / salience / description
      Previous value: -"Importance weight between 0.0 and 1.0."New value: +"Importance weight from 0.0 to 1.0 (use >=0.7 for durable team rules)."
    • addedInput schema / properties / type / default
      Added value: +"episodic"
    • changedInput schema / properties / type / description
      Previous value: -"Memory tier classification."New value: +"Memory tier classification (core and semantic receive 1.5x/1.25x recall boosts)."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "id": {
      +      "description": "Newly created memory UUID.",
      +      "type": "string"
      +    },
      +    "namespace": {
      +      "description": "Resolved client namespace.",
      +      "type": "string"
      +    },
      +    "salience": {
      +      "description": "Stored salience weight (0.0-1.0).",
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "namespace",
      +    "salience"
      +  ],
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare non-idempotent and non-destructive, but the description adds quota cost (1 Write API call), the concrete consequence of non-idempotency (duplicate IDs until consolidate runs), the reserved "org:" prefix rejection, and the salience threshold at which items surface in memory://rules. These are operational facts not derivable from the annotation block.

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?

Two sentences, front-loaded with the action and its cost, with usage guidance trailing. The parenthetical stack in sentence one is dense but each clause carries operational meaning; nothing is filler.

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?

Covers write cost, non-idempotency and its remedy, defaults, reserved-prefix rejection, and sibling routing; return fields are named even though an output schema exists. Nothing an agent needs to call this single-record write correctly is missing.

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 coverage is 100%, so the baseline is 3; the description still earns a bump by explaining the behavioral consequence of salience (>=0.7 or semantic/core surface in memory://rules) rather than restating the 0.0-1.0 range. Defaults it repeats (episodic, 0.5, "default") are already in the schema, so the gain is modest.

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 ("Store a single memory record in Memoreal Cloud") and immediately contrasts the singular scope with batch_encode for 2+ memories. An agent can distinguish it from siblings 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?

Explicitly names the triggering cases (one architectural decision, bug root cause, or user rule) and routes two alternatives: batch_encode for multi-record writes and handoff_to_agent for cross-wing handoffs. Both the when and the when-not are present.

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.