create_relations
Add multiple connections between entities in a knowledge graph memory system. Define relationships with type, strength, confidence, and metadata to organize information.
Instructions
Create multiple new relations between entities in your Memento MCP knowledge graph memory. Relations should be in active voice
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relations | Yes |
Implementation Reference
- The handler function that executes the create_relations tool logic by calling createRelations on the KnowledgeGraphManager and returning the result as JSON.export async function handleCreateRelations( args: Record<string, unknown>, // eslint-disable-next-line @typescript-eslint/no-explicit-any knowledgeGraphManager: any ): Promise<{ content: Array<{ type: string; text: string }> }> { const result = await knowledgeGraphManager.createRelations(args.relations); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- The input schema definition and description for the create_relations tool, including properties for relations array with from, to, relationType, etc.{ name: 'create_relations', description: 'Create multiple new relations between entities in your Memento MCP knowledge graph memory. Relations should be in active voice', inputSchema: { type: 'object', properties: { relations: { type: 'array', items: { type: 'object', properties: { from: { type: 'string', description: 'The name of the entity where the relation starts', }, to: { type: 'string', description: 'The name of the entity where the relation ends', }, relationType: { type: 'string', description: 'The type of the relation', }, strength: { type: 'number', description: 'Optional strength of relation (0.0 to 1.0)', }, confidence: { type: 'number', description: 'Optional confidence level in relation accuracy (0.0 to 1.0)', }, metadata: { type: 'object', description: 'Optional metadata about the relation (source, timestamps, tags, etc.)', additionalProperties: true, }, // Temporal fields - optional id: { type: 'string', description: 'Optional relation ID' }, version: { type: 'number', description: 'Optional relation version' }, createdAt: { type: 'number', description: 'Optional creation timestamp' }, updatedAt: { type: 'number', description: 'Optional update timestamp' }, validFrom: { type: 'number', description: 'Optional validity start timestamp' }, validTo: { type: 'number', description: 'Optional validity end timestamp' }, changedBy: { type: 'string', description: 'Optional user/system identifier' }, }, required: ['from', 'to', 'relationType'], }, }, }, required: ['relations'], }, },
- src/server/handlers/callToolHandler.ts:44-45 (registration)The dispatch case in the main callToolHandler that routes create_relations calls to the specific handler.case 'create_relations': return await toolHandlers.handleCreateRelations(args, knowledgeGraphManager);
- src/server/handlers/toolHandlers/index.ts:6-6 (registration)Re-export of the handleCreateRelations handler function for use in the tool dispatch system.export { handleCreateRelations } from './createRelations.js';
- Explicit tool name registration in the listToolsHandler.name: 'create_relations',