Skip to main content
Glama

create_relations

Define relationships between entities in the Memento MCP knowledge graph, specifying type, strength, confidence, and metadata for enhanced data organization and analysis.

Instructions

Create multiple new relations between entities in your Memento MCP knowledge graph memory. Relations should be in active voice

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
relationsYes

Implementation Reference

  • The handler function that implements the core logic for the 'create_relations' MCP tool. It extracts relations from args and delegates to KnowledgeGraphManager.createRelations, then formats the result as MCP content.
    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 and description for the 'create_relations' tool, defining the expected arguments structure including relations array with from, to, relationType, and optional fields.
    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'], },
  • Registration and dispatch logic in the main callToolHandler switch statement that routes 'create_relations' calls to the specific handler.
    case 'create_relations': return await toolHandlers.handleCreateRelations(args, knowledgeGraphManager);
  • Re-export of the handleCreateRelations handler function to make it available via the toolHandlers index module.
    export { handleCreateRelations } from './createRelations.js';

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/gannonh/memento-mcp'

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