@centrali-io/centrali-mcp 9.15.0 → 9.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,7 +44,7 @@ function registerInsightTools(server, sdk) {
44
44
  try {
45
45
  const options = {};
46
46
  if (recordSlug)
47
- options.structureSlug = recordSlug;
47
+ options.recordSlug = recordSlug;
48
48
  if (status)
49
49
  options.status = status;
50
50
  if (severity)
@@ -60,7 +60,7 @@ function registerValidationTools(server, sdk) {
60
60
  try {
61
61
  const options = {};
62
62
  if (recordSlug)
63
- options.structureSlug = recordSlug;
63
+ options.recordSlug = recordSlug;
64
64
  if (status)
65
65
  options.status = status;
66
66
  if (issueType)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@centrali-io/centrali-mcp",
3
- "version": "9.15.0",
3
+ "version": "9.16.0",
4
4
  "description": "Centrali MCP Server - AI assistant integration for Centrali workspaces",
5
5
  "main": "dist/index.js",
6
6
  "type": "commonjs",
@@ -26,7 +26,7 @@
26
26
  "author": "Blueinit",
27
27
  "license": "ISC",
28
28
  "dependencies": {
29
- "@centrali-io/centrali-sdk": "^9.15.0",
29
+ "@centrali-io/centrali-sdk": "^9.16.0",
30
30
  "@modelcontextprotocol/sdk": "^1.28.0"
31
31
  },
32
32
  "devDependencies": {
@@ -53,7 +53,7 @@ export function registerInsightTools(server: McpServer, sdk: CentraliSDK) {
53
53
  async ({ recordSlug, status, severity }) => {
54
54
  try {
55
55
  const options: Record<string, any> = {};
56
- if (recordSlug) options.structureSlug = recordSlug;
56
+ if (recordSlug) options.recordSlug = recordSlug;
57
57
  if (status) options.status = status;
58
58
  if (severity) options.severity = severity;
59
59
 
@@ -77,7 +77,7 @@ export function registerValidationTools(server: McpServer, sdk: CentraliSDK) {
77
77
  async ({ recordSlug, status, issueType, minConfidence }) => {
78
78
  try {
79
79
  const options: ListValidationSuggestionsOptions = {};
80
- if (recordSlug) options.structureSlug = recordSlug;
80
+ if (recordSlug) options.recordSlug = recordSlug;
81
81
  if (status) options.status = status;
82
82
  if (issueType) options.issueType = issueType;
83
83
  if (minConfidence !== undefined) options.minConfidence = minConfidence;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * The insight and validation list tools pass the collection to the SDK as
3
+ * `recordSlug`. `structureSlug` is the deprecated SDK option for the same
4
+ * value, so the MCP server must not be one of its callers.
5
+ */
6
+ const test = require("node:test");
7
+ const assert = require("node:assert/strict");
8
+
9
+ const { registerInsightTools } = require("../dist/tools/insights.js");
10
+ const { registerValidationTools } = require("../dist/tools/validation.js");
11
+
12
+ function makeFakeServer() {
13
+ const handlers = new Map();
14
+ return {
15
+ handlers,
16
+ tool: (name, _desc, _schema, handler) => {
17
+ handlers.set(name, handler);
18
+ },
19
+ };
20
+ }
21
+
22
+ function capture() {
23
+ const calls = [];
24
+ const record = async (options) => {
25
+ calls.push(options);
26
+ return { data: [] };
27
+ };
28
+ return { calls, record };
29
+ }
30
+
31
+ test("list_insights filters by recordSlug, not the deprecated structureSlug", async () => {
32
+ const server = makeFakeServer();
33
+ const { calls, record } = capture();
34
+ registerInsightTools(server, { anomalyInsights: { list: record } });
35
+ await server.handlers.get("list_insights")({ recordSlug: "orders", status: "active" });
36
+ assert.deepEqual(calls, [{ recordSlug: "orders", status: "active" }]);
37
+ });
38
+
39
+ test("list_validation_suggestions filters by recordSlug, not the deprecated structureSlug", async () => {
40
+ const server = makeFakeServer();
41
+ const { calls, record } = capture();
42
+ registerValidationTools(server, { validation: { listSuggestions: record } });
43
+ await server.handlers.get("list_validation_suggestions")({ recordSlug: "orders", status: "pending" });
44
+ assert.deepEqual(calls, [{ recordSlug: "orders", status: "pending" }]);
45
+ });