Skip to content

Commit 4d7c8c4

Browse files
committed
Merge #5393 (v2/feat/5202-memory-read-tool-descriptions) into rollup
2 parents 1208e04 + 942d8f1 commit 4d7c8c4

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@modelcontextprotocol/server-memory": patch
3+
---
4+
5+
The `search_nodes` and `open_nodes` tool descriptions now say when to use each one and which sibling read tool to prefer instead, so a model looks an entity up by name with `open_nodes`, searches by keyword with `search_nodes`, and leaves `read_graph` for when it needs the whole graph.

‎src/memory/__tests__/tools.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ const expectedTools = [
285285
{
286286
name: "search_nodes",
287287
title: "Search Nodes",
288-
description: "Search for nodes in the knowledge graph based on a query",
288+
description:
289+
"Search the knowledge graph for entities whose name, type or observations contain the query (case-insensitive). Use this when you have a keyword, a topic or part of a name but not the exact entity names. Prefer open_nodes when you already know the exact names, and use read_graph only when you need the whole graph. Returns the matching entities and every relation that touches one of them.",
289290
inputSchema: {
290291
type: "object",
291292
properties: {
@@ -306,7 +307,8 @@ const expectedTools = [
306307
{
307308
name: "open_nodes",
308309
title: "Open Nodes",
309-
description: "Open specific nodes in the knowledge graph by their names",
310+
description:
311+
"Retrieve specific entities by their exact names, with every relation that touches one of them. Use this when you already know the names (from the conversation, or from an earlier search_nodes or read_graph result); it is the cheapest way to read entities you can name. Prefer search_nodes when you only have a keyword or part of a name. Names that do not exist are skipped.",
310312
inputSchema: {
311313
type: "object",
312314
properties: {

‎src/memory/index.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,8 @@ export function createServer(
11491149
"search_nodes",
11501150
{
11511151
title: "Search Nodes",
1152-
description: "Search for nodes in the knowledge graph based on a query",
1152+
description:
1153+
"Search the knowledge graph for entities whose name, type or observations contain the query (case-insensitive). Use this when you have a keyword, a topic or part of a name but not the exact entity names. Prefer open_nodes when you already know the exact names, and use read_graph only when you need the whole graph. Returns the matching entities and every relation that touches one of them.",
11531154
inputSchema: z.object({
11541155
query: SearchNodesQuerySchema,
11551156
}),
@@ -1180,7 +1181,8 @@ export function createServer(
11801181
"open_nodes",
11811182
{
11821183
title: "Open Nodes",
1183-
description: "Open specific nodes in the knowledge graph by their names",
1184+
description:
1185+
"Retrieve specific entities by their exact names, with every relation that touches one of them. Use this when you already know the names (from the conversation, or from an earlier search_nodes or read_graph result); it is the cheapest way to read entities you can name. Prefer search_nodes when you only have a keyword or part of a name. Names that do not exist are skipped.",
11841186
inputSchema: z.object({
11851187
names: z
11861188
.array(z.string())

0 commit comments

Comments
 (0)