delete_relations
Remove specific relationships from a knowledge graph stored in a remote memory system. This tool deletes connections between entities to maintain accurate data structures for collaborative projects.
Instructions
특정 관계를 삭제합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relations | Yes |
Implementation Reference
- src/memory-graph.ts:110-120 (handler)Core implementation of deleteRelations that removes matching relations from the graph by filtering the relations array based on from, to, and relationType.deleteRelations(relations: Relation[]): void { relations.forEach(targetRel => { this.graph.relations = this.graph.relations.filter( rel => !(rel.from === targetRel.from && rel.to === targetRel.to && rel.relationType === targetRel.relationType) ); }); this.updateMetadata(); }
- src/index.ts:528-544 (handler)MCP server handler for 'delete_relations' tool. Calls memoryManager.deleteRelations, optionally syncs to GitHub, and returns success response.private async handleDeleteRelations(args: any) { this.memoryManager.deleteRelations(args.relations); const commitMessage = `feat: Delete ${args.relations.length} relations`; await this.syncWithMessage(commitMessage); return { content: [{ type: 'text', text: JSON.stringify({ success: true, message: `Deleted ${args.relations.length} relations`, deletedRelations: args.relations, }, null, 2), }], }; }
- src/index.ts:192-213 (registration)Registration of the 'delete_relations' tool in the MCP server's tool list, including name, description, and input schema definition.{ name: 'delete_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/memory-graph.ts:9-14 (schema)TypeScript interface defining the Relation type used by delete_relations for input validation and data structure.export interface Relation { from: string; to: string; relationType: string; createdAt: string; }
- src/index.ts:390-391 (handler)Switch case routing the 'delete_relations' tool call to the appropriate handler function.case 'delete_relations': return await this.handleDeleteRelations(args);