create_relations
Creates relationships between entities in a knowledge graph stored remotely on GitHub for collaborative data management.
Instructions
엔티티 간의 관계를 생성합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relations | Yes |
Implementation Reference
- src/index.ts:108-129 (registration)Tool registration in the list of tools provided to 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)MCP tool handler function that processes the create_relations tool call: delegates to memoryManager, handles sync, and formats 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/index.ts:382-383 (handler)Switch case in CallToolRequestSchema handler that routes 'create_relations' to its handler function.case 'create_relations': return await this.handleCreateRelations(args);
- src/memory-graph.ts:69-80 (helper)Core implementation in MemoryGraphManager that adds relations to the 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/index.ts:111-128 (schema)Input schema definition for the create_relations tool, specifying the expected arguments structure.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'], },