MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / toolUpsertMemoryNode

Function toolUpsertMemoryNode

src/tools/memory-tools.ts:59–69  ·  view source on GitHub ↗
(options: UpsertMemoryNodeOptions)

Source from the content-addressed store, hash-verified

57}
58
59export async function toolUpsertMemoryNode(options: UpsertMemoryNodeOptions): Promise<string> {
60 const node = await upsertNode(options.rootDir, options.type, options.label, options.content, options.metadata);
61 const stats = await getGraphStats(options.rootDir);
62 return [
63 `✅ Memory node upserted: ${node.label}`,
64 ` ID: ${node.id}`,
65 ` Type: ${node.type}`,
66 ` Access count: ${node.accessCount}`,
67 `\nGraph: ${stats.nodes} nodes, ${stats.edges} edges`,
68 ].join("\n");
69}
70
71export async function toolCreateRelation(options: CreateRelationOptions): Promise<string> {
72 const edge = await createRelation(options.rootDir, options.sourceId, options.targetId, options.relation, options.weight, options.metadata);

Callers 2

index.tsFile · 0.85

Calls 2

upsertNodeFunction · 0.85
getGraphStatsFunction · 0.85

Tested by

no test coverage detected