Skip to main content
Glama

Relate two entities

relate_entities
Idempotent

Record a directed relation between two entities identified by name, creating either entity if it does not exist.

Behavior:
- Each name is matched case-insensitively against entity names and
  aliases. With the type omitted ('unclassified'), any same-name entity
  is reused. With a real type, a same-name entity of a compatible type
  (or an unclassified one, which is then given that type) is reused, and
  type-prefixed names are recognized ("Atlas" can match "Project Atlas"
  of type project). Otherwise the entity is created and linked to the
  NEXUS root entity.
- If a current relation of the same type already exists between the two,
  it is reused and its evidence reinforced; otherwise a new one is
  created.
- 'same_as' does not create a relation: the entities are resolved (and
  created if missing) and a merge proposal is opened for them (the
  response carries its id).
- For works_for, reports_to and located_in (one current value per
  subject), a conflicting current relation opens a contradiction unless
  supersede_previous is true.
- To record that a relation stopped being true, use ``end_relation``.

A person employed by an organization is modeled as works_for
(person -> organization).

Returns {source_entity, target_entity, relation, source_created,
target_created, relation_created, superseded_relation_ids,
contradiction_id}.

Args:
    source_name: Name of the source entity.
    target_name: Name of the target entity.
    relation_type: Relation type from the closed ontology (schema enum).
        Use 'related_to' if none fits.
    source_type: Entity type of the source, if known. Omit rather than
        guessing; 'concept' is a real (abstract) type, not "unknown".
    target_type: Same as source_type, for the target.
    source_attributes: Extra attributes used only if the source is created.
    target_attributes: Extra attributes used only if the target is created.
    weight: Relation weight in [0.0, 1.0].
    valid_from: ISO 8601 date from which the relation holds. Defaults to now.
    supersede_previous: Only for works_for, reports_to and located_in.
        True when the information says the value changed; the previous
        current relation is closed and kept in history.
    epistemic_status: How it is known: 'reported' (default), 'observed',
        'measured' or 'inferred'.
    evidence_ref: Optional source (URL, file, person) stored as evidence.
        Without it the relation is recorded but counted as unjustified.

Input Schema

NameRequiredDescriptionDefault
weightNo
valid_fromNo
source_nameYes
source_typeNounclassified
target_nameYes
target_typeNounclassified
evidence_refNo
relation_typeYes
epistemic_statusNo
source_attributesNo
target_attributesNo
supersede_previousNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations, which only cover readOnly/idempotent/destructive. It discloses case-insensitive name/alias matching, type-compatibility reuse, type-prefix recognition, NEXUS-root linkage on creation, evidence reinforcement for existing relations, merge-proposal behavior for same_as, contradiction creation for single-valued relations, and 'unjustified' counting without evidence_ref.

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?

Long but justified for a 12-parameter tool with complex semantics. It is front-loaded with purpose, then cleanly partitioned into Behavior, Returns, and Args sections, with no filler sentences.

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?

No output schema exists, yet the description enumerates the return fields (source_entity, target_entity, relation, creation flags, superseded_relation_ids, contradiction_id). Combined with annotations covering safety and the Args block covering all 12 parameters, an agent has everything needed to invoke it correctly.

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

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage across 12 parameters, the description carries the full load and succeeds: it explains source_type ('omit rather than guessing', 'concept' is real not unknown), supersede_previous scoping, weight range [0.0,1.0], valid_from default, epistemic_status default, and that evidence_ref omission marks the relation unjustified.

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?

States a precise verb+resource ('Record a directed relation between two entities') and adds the side effect of creating missing entities. It distinguishes itself from end_relation explicitly, but does not differentiate from the sibling create_relation, leaving genuine overlap unaddressed.

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?

Provides clear routing context: use end_relation to record a relation stopping, use 'related_to' when no ontology type fits, and supersede_previous when the value changed. It stops short of explaining when to prefer this over create_relation or create_entity, which are the nearest siblings.

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