fix(mcp): align discovery identity guidance

This commit is contained in:
HumbleTurtle
2026-08-22 19:39:39 -03:00
parent 4254cac826
commit e410b5d4a5
2 changed files with 13 additions and 5 deletions
+8 -5
View File
@@ -15726,14 +15726,17 @@ def all_tools():
if canonical_name == "nap_discover": if canonical_name == "nap_discover":
item["description"] = ( item["description"] = (
"Discover compact project memory with keywords, structured filters, " "Discover compact project memory with keywords, structured filters, "
"deterministic sorting, and returned-item facets. Omit q with " "deterministic sorting, returned-item facets, and node_id on every row. "
"sort='updated_desc' for recent memory." "Pass a selected row's node_id directly to nap_node_get; use "
"nap_node_by_path only for an external path without identity. Omit q "
"with sort='updated_desc' for recent memory."
) )
if canonical_name == "nap_node_get": if canonical_name == "nap_node_get":
item["description"] = ( item["description"] = (
"Read one node by canonical node_id or nap:// URI. Use content for a lean " "Read one node by canonical node_id or nap:// URI, including node_id "
"reading view, outline for headings without the body, or edit to obtain " "returned by nap_discover. Use content for a lean reading view, outline "
"revision and read_fingerprint before nap_node_patch." "for headings without the body, or edit to obtain revision and "
"read_fingerprint before nap_node_patch."
) )
category = tool_category(canonical_name) category = tool_category(canonical_name)
if not item.get("description", "").startswith("["): if not item.get("description", "").startswith("["):
@@ -263,6 +263,11 @@ def test_tools_include_node_by_path_descriptor(mod):
assert "node_id" in get_tool["inputSchema"]["properties"] assert "node_id" in get_tool["inputSchema"]["properties"]
assert "uri" in get_tool["inputSchema"]["properties"] assert "uri" in get_tool["inputSchema"]["properties"]
assert "path" not in get_tool["inputSchema"]["properties"] assert "path" not in get_tool["inputSchema"]["properties"]
assert "node_id returned by nap_discover" in get_tool["description"]
discover_tool = next(item for item in mod.tools() if item["name"] == "nap_discover")
assert "node_id on every row" in discover_tool["description"]
assert "directly to nap_node_get" in discover_tool["description"]
tool = next(item for item in mod.tools() if item["name"] == "nap_node_by_path") tool = next(item for item in mod.tools() if item["name"] == "nap_node_by_path")
assert tool["inputSchema"]["required"] == ["path"] assert tool["inputSchema"]["required"] == ["path"]