create_relations
Creates relationships between entities in a knowledge graph to establish connections and structure data for remote memory management and collaboration.
Instructions
엔티티 간의 관계를 생성합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relations | Yes |
Implementation Reference
- src/index.ts:108-129 (registration)Registration of the 'create_relations' tool in the MCP server, including name, description, and input schema definition.{ name: 'create_relations', description: '엔티티 간의 관계를 생성합니다', inputSchema: { type: 'object', properties: { relations: { type: 'array', items: { type: 'object', properties: { from: { type: 'string' }, to: { type: 'string' }, relationType: { type: 'string' }, }, required: ['from', 'to', 'relationType'], }, }, }, required: ['relations'], }, },
- src/index.ts:453-469 (handler)Primary MCP tool handler for 'create_relations' that invokes the memory manager, performs sync if enabled, and returns success response.private async handleCreateRelations(args: any) { this.memoryManager.createRelations(args.relations); const commitMessage = `feat: Add ${args.relations.length} relations`; await this.syncWithMessage(commitMessage); return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: `Created ${args.relations.length} relations`, relations: args.relations, }, null, 2), }], }; }
- src/memory-graph.ts:69-80 (handler)Core handler logic in MemoryGraphManager that adds the provided relations to the in-memory graph with timestamps and updates metadata.createRelations(relations: Omit<Relation, 'createdAt'>[]): void { const now = new Date().toISOString(); relations.forEach(relation => { this.graph.relations.push({ ...relation, createdAt: now, }); }); this.updateMetadata(); }
- src/memory-graph.ts:9-14 (schema)TypeScript interface defining the structure of a Relation, used in the tool's input schema and graph storage.export interface Relation { from: string; to: string; relationType: string; createdAt: string; }
- src/index.ts:382-383 (registration)Dispatch registration in the CallToolRequestSchema handler switch statement that routes to the specific handler.case 'create_relations': return await this.handleCreateRelations(args);