diff --git a/src/mcp/ToolSchemas.json b/src/mcp/ToolSchemas.json index 3520c10..ed3d8cb 100644 --- a/src/mcp/ToolSchemas.json +++ b/src/mcp/ToolSchemas.json @@ -5,10 +5,6 @@ "description": "Defines the tools exported by the Kompanion memory daemon.", "type": "object", "properties": { - "namespace": { - "type": "string", - "description": "Default namespace applied to relative tool names." - }, "tools": { "type": "object", "additionalProperties": { @@ -34,7 +30,6 @@ } }, "required": [ - "namespace", "tools" ], "additionalProperties": false, @@ -52,7 +47,6 @@ }, "examples": [ { - "namespace": "kom.memory.v1", "tools": { "save_context": { "description": "Persist context payload in the namespace-backed memory store.", @@ -110,10 +104,19 @@ "tags": { "$ref": "#/$defs/stringList" }, + "newest_first": { + "type": "boolean" + }, "limit": { "type": "integer" }, - "since": { + "offset": { + "type": "integer" + }, + "min_timestamp": { + "type": "string" + }, + "max_timestamp": { "type": "string" } }, @@ -164,6 +167,9 @@ "input": { "type": "object", "properties": { + "namespace": { + "type": "string" + }, "model": { "type": "string" }, @@ -172,6 +178,7 @@ } }, "required": [ + "namespace", "texts" ], "additionalProperties": false @@ -429,6 +436,7 @@ "type": "boolean" } }, + "required": [], "additionalProperties": false }, "output": { diff --git a/tests/contract/test_mcp_tools.cpp b/tests/contract/test_mcp_tools.cpp index 3af9bcd..0f3d1e2 100644 --- a/tests/contract/test_mcp_tools.cpp +++ b/tests/contract/test_mcp_tools.cpp @@ -30,6 +30,10 @@ std::string saveResp = server.dispatch("kom.memory.v1.save_context", saveReq); if (!expect_contains(saveResp, "\"id\"", "save_context id")) return 1; if (!expect_contains(saveResp, "\"created_at\"", "save_context timestamp")) return 1; + const std::string saveReqNoNamespace = R"({"key":"nogreeting","content":{"text":"remember this without namespace"},"tags":["context","demo"]})"; + std::string saveRespNoNamespace = server.dispatch("kom.memory.v1.save_context", saveReqNoNamespace); + if (!expect_contains(saveRespNoNamespace, "\"error\":{\"code\":\"bad_request\",\"message\":\"namespace is required\"}", "save_context without namespace should fail")) return 1; + const std::string recallReq = R"({"namespace":"tests","key":"greeting","limit":2})"; std::string recallResp = server.dispatch("kom.memory.v1.recall_context", recallReq); if (!expect_contains(recallResp, "\"items\"", "recall_context items")) return 1;