localnest_memory_add_relation
Link two memory entries with a named relation to build a traversable knowledge graph. Use for connections like 'depends_on', 'contradicts', or 'supersedes'.
Instructions
Link two memory entries with a named relation. Use to build a traversable knowledge graph (e.g. "depends_on", "contradicts", "supersedes", "related").
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_id | Yes | ||
| target_id | Yes | ||
| relation_type | No | related | |
| response_format | No | json |
Implementation Reference
- src/mcp/tools/memory-store.js:271-274 (handler)The handler function for the localnest_memory_add_relation tool, which calls the memory service to create the relation.
async ({ source_id, target_id, relation_type }) => { const result = await memory.addRelation(source_id, target_id, relation_type); return normalizeRelationResult(result, { source_id, target_id, relation_type }); } - src/mcp/tools/memory-store.js:254-275 (registration)Registration of the localnest_memory_add_relation tool in the memory store toolset.
registerJsonTool( ['localnest_memory_add_relation'], { title: 'Memory Add Relation', description: 'Link two memory entries with a named relation. Use to build a traversable knowledge graph (e.g. "depends_on", "contradicts", "supersedes", "related").', inputSchema: { source_id: z.string().min(1), target_id: z.string().min(1), relation_type: z.string().min(1).max(60).default('related') }, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false } }, async ({ source_id, target_id, relation_type }) => { const result = await memory.addRelation(source_id, target_id, relation_type); return normalizeRelationResult(result, { source_id, target_id, relation_type }); } );