You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bb8aa6f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(memory): say in create_entities' description that existing names are skipped
Follow-up to the cherry-picked fix for #4887, for v2/main:
- The tool description now says an entity whose name already exists (or
repeats earlier in the call) is skipped, that its observations are not
added, that the skipped names come back in `skipped`, and to use
add_observations for an existing entity.
- `skipped` is optional in the output schema and present only when
something was skipped, so a call that skips nothing returns the same
structured content as before.
- The two KNOWN BUG #4887 pinning tests in tools.test.ts now assert the
reported skip; the markers are gone. The tool-list test pins the new
description and output schema.
- README describes the skip report; changeset added.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: cliffhall <[email protected]>
`create_entities` now reports the entities it skipped because their name already exists (or repeats earlier in the same call): the structured result lists them in a new optional `skipped` array, a second text item names them and points to `add_observations`, and the tool description says so. Skipped entities are still not created and their observations are still not added (#4887).
- Ignores entities with existing names, and lists them in `skipped` (use `add_observations` to extend an existing entity)
65
+
- Ignores entities with existing names (and repeats of a name earlier in the same call); their observations are not added
66
+
- Returns the created entities. When any were skipped, the structured result also lists their names in `skipped`, and a second text item says which were skipped (use `add_observations` to extend an existing entity)
Copy file name to clipboardExpand all lines: src/memory/__tests__/tools.test.ts
+35-13Lines changed: 35 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,8 @@ const expectedTools = [
92
92
{
93
93
name: "create_entities",
94
94
title: "Create Entities",
95
-
description: "Create multiple new entities in the knowledge graph",
95
+
description:
96
+
"Create multiple new entities in the knowledge graph. An entity whose name already exists, or repeats an earlier entity in the same call, is skipped and its observations are not added; the result lists the skipped names in `skipped`. Use add_observations to add observations to an existing entity.",
return`Skipped ${skipped.length}${one ? "entity that already exists" : "entities that already exist"}: `+
118
+
return(
119
+
`Skipped ${skipped.length}${one ? "entity that already exists" : "entities that already exist"}: `+
116
120
`${skipped.join(", ")}. ${one ? "Its" : "Their"} observations were not added; `+
117
-
"use add_observations for existing entities.";
121
+
"use add_observations for existing entities."
122
+
);
118
123
}
119
124
120
125
// The KnowledgeGraphManager class contains all operations to interact with the knowledge graph
@@ -503,13 +508,15 @@ export function createServer(memoryFilePath: string): McpServer {
503
508
"create_entities",
504
509
{
505
510
title: "Create Entities",
506
-
description: "Create multiple new entities in the knowledge graph",
511
+
description:
512
+
"Create multiple new entities in the knowledge graph. An entity whose name already exists, or repeats an earlier entity in the same call, is skipped and its observations are not added; the result lists the skipped names in `skipped`. Use add_observations to add observations to an existing entity.",
507
513
inputSchema: {
508
514
entities: z.array(EntitySchema),
509
515
},
510
516
outputSchema: {
511
517
entities: z.array(EntitySchema),
512
-
skipped: z.array(z.string()),
518
+
// Present only when at least one requested entity was skipped.
519
+
skipped: z.array(z.string()).optional(),
513
520
},
514
521
annotations: {
515
522
readOnlyHint: false,
@@ -535,7 +542,10 @@ export function createServer(memoryFilePath: string): McpServer {
0 commit comments