Skip to main content
Glama

memory_upsert_fact

Record structured entity-relationship facts with automatic bi-temporal conflict detection, superseding stale data to keep a persistent knowledge graph memory accurate over time.

Instructions

Record a structured entity-relationship fact (subject_id, predicate, object) with automatic bi-temporal conflict detection and supersession of stale facts.

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": {
      "subject_id": "<subject_id>",
      "predicate": "<predicate>"
    },
    "name": "memory_upsert_fact"
  }
}

Input Schema

NameRequiredDescriptionDefault
singularNoIf true, supersedes any prior active fact with the same (subject_id, predicate).
object_idNoTarget entity identifier (if relational).
predicateYesRelationship or attribute predicate.
confidenceNoConfidence score in [0.0, 1.0].
subject_idYesSource entity identifier.
valid_fromNoOptional ISO-8601 UTC timestamp when fact became true.
object_valueNoTarget literal value (if attribute).
source_episode_idNoOptional episode ID that established this fact.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose genuine behavior beyond the schema: automatic bi-temporal conflict detection and supersession of stale facts. However, it omits whether the call is idempotent, what permissions are needed, and what the operation returns when a supersession occurs, leaving meaningful gaps for a mutation tool.

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?

It is a single front-loaded sentence with the core behavior and the most important side effect (supersession) stated up front. The parenthetical triple is efficient rather than wasteful; only minor tightening would be possible.

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 an 8-parameter write tool with no annotations and no output schema, the definition covers purpose and the key side effect adequately, and the schema itself is fully described. Missing are return-value expectations and mutual-exclusivity guidance between object_id and object_value, which are small but real gaps.

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 all 8 parameters are already documented with defaults and guidance (e.g. singular controlling supersession). The description adds only the relational framing of subject/predicate/object and does not clarify the object_id versus object_value choice or interaction between singular and confidence.

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 description gives a specific verb (Record) and resource (structured entity-relationship fact) and even enumerates the triple's shape (subject_id, predicate, object). It does not distinguish itself from siblings such as memory_record_episode or memory_query_entity, which is the only reason it falls short of a 5.

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

Usage Guidelines2/5

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

There is no statement of when to use this versus alternatives: nothing says whether to prefer memory_record_episode for raw events or memory_query_entity for reads, and no prerequisites or exclusions are given. Usage is only implied by the verb 'Record'.

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