Skip to main content
Glama

relationship_upsert

Create or update a directed relationship between two entities in the graph. Identify endpoints by entity key or ID, and define the connection with a relation type.

Instructions

Create or update one directed relationship in the graph: subject --relation_type--> object. Mutating. Identify each endpoint by entity_key (preferred) or internal entity_id. The graph is a rebuildable projection over memories — curate structure here, store facts with remember.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
spaceNoMemory space (namespace) the relationship belongs to.
statusNoLifecycle status (e.g. active, tombstoned).
metadataNoArbitrary key/value attributes to attach to the relationship.
valid_toNoRFC 3339 timestamp the relationship stops being valid.
memory_idNoId of the memory this relationship was derived from, if any.
confidenceNoConfidence in the relationship, 0.0–1.0.
valid_fromNoRFC 3339 timestamp the relationship starts being valid.
observed_atNoRFC 3339 timestamp of when this was observed.
relation_typeYesThe relationship type/predicate (e.g. depends_on, works_with, part_of). Required.
include_sourceNoIf true, reveal provenance/source metadata in the response. Default false.
object_entity_idNoInternal id of the object endpoint (alternative to object_entity_key).
object_entity_keyNoEntity key of the object (target) endpoint. Preferred over object_entity_id.
source_episode_idNoId of the source episode this relationship was derived from, if any.
subject_entity_idNoInternal id of the subject endpoint (alternative to subject_entity_key).
subject_entity_keyNoEntity key of the subject (source) endpoint. Preferred over subject_entity_id.
Behavior3/5

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

The description states 'Mutating' and describes the graph as a rebuildable projection, but does not detail conflict resolution on upsert (replace/merge), required permissions, or side effects on the projection. Without annotations, these omissions limit transparency.

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?

The description is two concise sentences: the first communicates the core action, the second adds context about the graph's relationship to memories. No fluff, front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (15 params, no output schema), the description adequately covers purpose and endpoint identification but omits return value details, conflict resolution behavior, and impact on the graph projection. More completeness is needed for a complex mutation tool.

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?

The input schema covers 100% of parameters with descriptions, so the baseline is 3. The description adds minimal value by noting endpoint identification preference, but does not elaborate on parameter semantics beyond what the schema provides.

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?

The description clearly states it creates or updates a directed relationship in the graph, specifying the structure subject --relation_type--> object. It distinguishes itself from sibling tools like entity_upsert (entity focus) and remember (fact storage).

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 explains when to use this tool ('curate structure here') versus remember ('store facts'). It also instructs on endpoint identification (entity_key preferred over entity_id). However, it lacks explicit when-not-to-use scenarios or alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/teflon07/memkeeper'

If you have feedback or need assistance with the MCP directory API, please join our Discord server