Skip to main content
The 3ngram MCP server exposes the following entities tools. Every entry is generated from the tool’s source signature and docstring, so this page never drifts from the backend.
Required parameters are marked with the required attribute. Optional parameters show their default value.

merge_entities

Merge Entities · writes · destructive · non-idempotent · closed-world Merge duplicate entity rows into a canonical target. Every entity_mentions row belonging to a source entity is reassigned to target_entity_id; the source rows are deleted and their canonical names are preserved as entity_aliases so the upsert path won’t resurrect them on the next NER pass. Extra alias strings supplied via aliases_to_add (e.g. misspellings the user noticed in passing) are recorded the same way. Returns: dict[str, Any] Source: backend/src/engram/mcp/tools/entities/merge.py

Parameters

source_entity_ids
list[int]
required
Integer entities.id values to fold into the target. Must be non-empty and must not include the target.
target_entity_id
int
required
Integer entities.id value of the surviving canonical row.
aliases_to_add
list[str] | None
default:"None"
Optional free-form strings to record as aliases pointing at the target. Whitespace-only entries are skipped and duplicates of existing aliases are ignored.Returns a dict shaped like MergeEntitiesResult: {target_entity_id, merged_source_ids, aliases_added, mentions_reassigned, target_mention_count}.