MCPcopy
hub / github.com/modelcontextprotocol/servers / createRelations

Method createRelations

src/memory/index.ts:127–137  ·  view source on GitHub ↗
(relations: Relation[])

Source from the content-addressed store, hash-verified

125 }
126
127 async createRelations(relations: Relation[]): Promise<Relation[]> {
128 const graph = await this.loadGraph();
129 const newRelations = relations.filter(r => !graph.relations.some(existingRelation =>
130 existingRelation.from === r.from &&
131 existingRelation.to === r.to &&
132 existingRelation.relationType === r.relationType
133 ));
134 graph.relations.push(...newRelations);
135 await this.saveGraph(graph);
136 return newRelations;
137 }
138
139 async addObservations(observations: { entityName: string; contents: string[] }[]): Promise<{ entityName: string; addedObservations: string[] }[]> {
140 const graph = await this.loadGraph();

Callers 2

index.tsFile · 0.80

Calls 2

loadGraphMethod · 0.95
saveGraphMethod · 0.95

Tested by

no test coverage detected