delete_relations
Remove specific relationships between entities in a knowledge graph managed by the Remote Memory MCP Server. This tool deletes defined connections to maintain accurate data synchronization with GitHub repositories.
Instructions
특정 관계를 삭제합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| relations | Yes |
Implementation Reference
- src/index.ts:528-544 (handler)The main handler function for the 'delete_relations' tool. It calls the memory manager to delete the relations, optionally syncs to GitHub if autoPush is enabled, and returns a formatted 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/memory-graph.ts:110-120 (handler)Core logic that implements relation deletion by filtering matching relations from the graph's relations array based on from, to, and relationType, then updates metadata.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:192-213 (registration)MCP tool registration defining the 'delete_relations' tool, including its name, description, and input schema for the relations array.{ 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 structure of a Relation, used by the delete_relations tool.export interface Relation { from: string; to: string; relationType: string; createdAt: string; }