@ffschrattenecker/tm1-mcp-server 6.0.0 → 7.0.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.
- package/CHANGELOG.md +110 -1
- package/README.md +28 -7
- package/dist/config.d.ts +12 -1
- package/dist/config.js +120 -79
- package/dist/connections.d.ts +69 -0
- package/dist/connections.js +262 -0
- package/dist/http-transport.d.ts +2 -2
- package/dist/index.js +45 -37
- package/dist/lib/callgraph/tm1-adapter.d.ts +4 -1
- package/dist/lib/callgraph/tm1-adapter.js +5 -2
- package/dist/lib/slim-json-schema.d.ts +8 -0
- package/dist/lib/slim-json-schema.js +34 -0
- package/dist/lib/strip-comments.js +1 -1
- package/dist/lib/tm1-events.d.ts +2 -0
- package/dist/prompts/index.js +2 -2
- package/dist/resources/index.d.ts +4 -2
- package/dist/resources/index.js +93 -53
- package/dist/resources/subscriptions.d.ts +2 -1
- package/dist/resources/subscriptions.js +16 -7
- package/dist/server-instructions.d.ts +3 -0
- package/dist/server-instructions.js +12 -0
- package/dist/tm1-client/http.d.ts +1 -1
- package/dist/tm1-client/http.js +21 -4
- package/dist/tm1-client/services/process-service.d.ts +7 -1
- package/dist/tm1-client/services/process-service.js +7 -5
- package/dist/tm1-client.d.ts +7 -1
- package/dist/tm1-client.js +10 -11
- package/dist/tools/analysis/analyze-object-usage.d.ts +10 -0
- package/dist/tools/analysis/analyze-object-usage.js +37 -33
- package/dist/tools/analysis/audit-naming.js +1 -1
- package/dist/tools/analysis/delete-impact.d.ts +13 -0
- package/dist/tools/analysis/delete-impact.js +30 -0
- package/dist/tools/analysis/invalidate-callgraph-cache.js +2 -1
- package/dist/tools/analysis/trace-data-flow.js +1 -1
- package/dist/tools/celldata/write-cells.js +37 -2
- package/dist/tools/confirm.d.ts +4 -1
- package/dist/tools/confirm.js +12 -2
- package/dist/tools/define-tool.d.ts +35 -11
- package/dist/tools/define-tool.js +51 -4
- package/dist/tools/dimension-management/delete-dimension.js +18 -4
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/index.js +6 -12
- package/dist/tools/metadata/list-cubes.js +3 -3
- package/dist/tools/metadata/list-processes.js +11 -7
- package/dist/tools/model-building/delete-cube.js +18 -4
- package/dist/tools/model-building/set-cube-rules.js +13 -1
- package/dist/tools/model-building/unload-cube.js +1 -1
- package/dist/tools/operations/get-audit-log.js +1 -1
- package/dist/tools/operations/get-jobs.js +2 -2
- package/dist/tools/operations/get-message-log.js +1 -1
- package/dist/tools/operations/get-server-info.js +10 -1
- package/dist/tools/operations/get-server-state.js +1 -1
- package/dist/tools/operations/get-threads.js +2 -2
- package/dist/tools/operations/get-transaction-log.js +1 -1
- package/dist/tools/operations/list-connections.d.ts +2 -0
- package/dist/tools/operations/list-connections.js +35 -0
- package/dist/tools/operations/save-data.js +1 -1
- package/dist/tools/schemas/items-monitoring.d.ts +11 -0
- package/dist/tools/schemas/items-monitoring.js +9 -1
- package/dist/tools/schemas/items-processes.d.ts +3 -0
- package/dist/tools/schemas/items-processes.js +2 -1
- package/dist/tools/ti-development/diff-processes.d.ts +42 -0
- package/dist/tools/ti-development/diff-processes.js +4 -4
- package/dist/tools/ti-development/execute-process.js +29 -4
- package/dist/tools/ti-development/import-pro-file.js +1 -1
- package/dist/tools/ti-development/preflight.d.ts +24 -0
- package/dist/tools/ti-development/preflight.js +32 -0
- package/dist/tools/ti-development/search-code.js +1 -1
- package/dist/tools/ti-development/upsert-process.js +100 -11
- package/dist/tools/with-annotations.d.ts +10 -0
- package/dist/tools/with-annotations.js +58 -3
- package/npm-shrinkwrap.json +4586 -0
- package/package.json +9 -7
- package/dist/tools/ti-development/get-process-code.d.ts +0 -2
- package/dist/tools/ti-development/get-process-code.js +0 -100
- package/dist/tools/ti-development/get-process-datasource.d.ts +0 -2
- package/dist/tools/ti-development/get-process-datasource.js +0 -20
- package/dist/tools/ti-development/get-process-parameters.d.ts +0 -2
- package/dist/tools/ti-development/get-process-parameters.js +0 -25
- package/dist/tools/ti-development/get-process-variables.d.ts +0 -2
- package/dist/tools/ti-development/get-process-variables.js +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ffschrattenecker/tm1-mcp-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "MCP server for IBM Planning Analytics / TM1 — full model lifecycle via REST API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"dist",
|
|
20
20
|
"!dist/**/*.map",
|
|
21
21
|
"NOTICE",
|
|
22
|
-
"CHANGELOG.md"
|
|
22
|
+
"CHANGELOG.md",
|
|
23
|
+
"npm-shrinkwrap.json"
|
|
23
24
|
],
|
|
24
25
|
"prettier": {
|
|
25
26
|
"semi": true,
|
|
@@ -59,10 +60,12 @@
|
|
|
59
60
|
"lint:mutation-envelope": "node scripts/check-mutation-envelope.mjs",
|
|
60
61
|
"lint:format": "prettier --check .",
|
|
61
62
|
"format": "prettier --write .",
|
|
62
|
-
"verify": "npm run typecheck && npm run typecheck:tests && npm run lint:no-flat-api && npm run lint:output-schema-budget && npm run lint:tool-registration && npm run lint:input-naming && npm run lint:mutation-envelope && npm run lint:format && npm run lint:eslint && npm run coverage:check",
|
|
63
|
+
"verify": "npm run typecheck && npm run typecheck:tests && npm run lint:no-flat-api && npm run lint:output-schema-budget && npm run lint:tool-surface-budget && npm run lint:tool-registration && npm run lint:input-naming && npm run lint:mutation-envelope && npm run lint:format && npm run lint:eslint && npm run coverage:check",
|
|
63
64
|
"tools:list": "node scripts/gen-tool-list.mjs",
|
|
64
65
|
"tools:update-readme": "node scripts/gen-tool-list.mjs --write-readme",
|
|
65
|
-
"lint:eslint": "eslint ."
|
|
66
|
+
"lint:eslint": "eslint .",
|
|
67
|
+
"measure:tools": "node scripts/measure-tool-surface.mjs",
|
|
68
|
+
"lint:tool-surface-budget": "node scripts/measure-tool-surface.mjs --top 0 --budget 133000"
|
|
66
69
|
},
|
|
67
70
|
"keywords": [
|
|
68
71
|
"mcp",
|
|
@@ -72,7 +75,7 @@
|
|
|
72
75
|
],
|
|
73
76
|
"license": "MIT",
|
|
74
77
|
"engines": {
|
|
75
|
-
"node": ">=
|
|
78
|
+
"node": ">=22.19.0"
|
|
76
79
|
},
|
|
77
80
|
"overrides": {
|
|
78
81
|
"fast-uri": "^3.1.5",
|
|
@@ -101,7 +104,6 @@
|
|
|
101
104
|
"vitest": "^4.1.10"
|
|
102
105
|
},
|
|
103
106
|
"publishConfig": {
|
|
104
|
-
"access": "public"
|
|
105
|
-
"provenance": true
|
|
107
|
+
"access": "public"
|
|
106
108
|
}
|
|
107
109
|
}
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { commentStats, stripCommentBlocks } from "../../lib/strip-comments.js";
|
|
3
|
-
import { maskCode, resolveMaskSecrets } from "../../lib/mask-secrets.js";
|
|
4
|
-
import { ProcessCodeSchema } from "../schemas/items.js";
|
|
5
|
-
import { READ_ONLY } from "../annotations.js";
|
|
6
|
-
import { defineTool } from "../define-tool.js";
|
|
7
|
-
// A tab counts as comment-heavy (worth flagging for stripComments) only when it
|
|
8
|
-
// is both long enough to matter and mostly comments.
|
|
9
|
-
const HEAVY_MIN_LINES = 20;
|
|
10
|
-
const HEAVY_RATIO = 0.4;
|
|
11
|
-
const TABS = ["prolog", "metadata", "data", "epilog"];
|
|
12
|
-
export const registerGetProcessCode = defineTool({
|
|
13
|
-
name: "tm1_get_process_code",
|
|
14
|
-
description: "Get the source code of all four tabs (Prolog, Metadata, Data, Epilog) of a TI process. " +
|
|
15
|
-
"Grown TM1 models often carry large blocks of commented-out dead code; set stripComments=true " +
|
|
16
|
-
"to collapse runs of 4+ comment lines into a `# [... N lines ...]` marker and save context.",
|
|
17
|
-
annotations: READ_ONLY,
|
|
18
|
-
output: ProcessCodeSchema,
|
|
19
|
-
input: {
|
|
20
|
-
processName: z.string().describe("Name of the TI process"),
|
|
21
|
-
stripComments: z
|
|
22
|
-
.boolean()
|
|
23
|
-
.optional()
|
|
24
|
-
.default(false)
|
|
25
|
-
.describe("If true, collapse blocks of 4+ consecutive comment lines into a single marker (dead-code reduction). " +
|
|
26
|
-
"Inline and short comments are kept. Default false (full verbatim source)."),
|
|
27
|
-
maskSecrets: z
|
|
28
|
-
.boolean()
|
|
29
|
-
.optional()
|
|
30
|
-
.default(true)
|
|
31
|
-
.describe("Redact credential literals in the returned code. Masks the password arg of ODBCOpen() and quoted values " +
|
|
32
|
-
"assigned to credential-named identifiers (pPwd, sToken, …). Default: true. Set false only when explicitly auditing credentials."),
|
|
33
|
-
includeSecurityAccess: z
|
|
34
|
-
.boolean()
|
|
35
|
-
.optional()
|
|
36
|
-
.default(false)
|
|
37
|
-
.describe("Also fetch process's HasSecurityAccess elevation flag (one extra GET). " +
|
|
38
|
-
"Default false — pure code reads stay single request."),
|
|
39
|
-
},
|
|
40
|
-
handler: async ({ processName, stripComments, maskSecrets, includeSecurityAccess }, tm1Client) => {
|
|
41
|
-
const code = await tm1Client.processes.getCode(processName);
|
|
42
|
-
let hint;
|
|
43
|
-
if (stripComments) {
|
|
44
|
-
let removedLines = 0;
|
|
45
|
-
let collapsedBlocks = 0;
|
|
46
|
-
for (const tab of TABS) {
|
|
47
|
-
const r = stripCommentBlocks(code[tab]);
|
|
48
|
-
code[tab] = r.code;
|
|
49
|
-
removedLines += r.removedLines;
|
|
50
|
-
collapsedBlocks += r.collapsedBlocks;
|
|
51
|
-
}
|
|
52
|
-
if (collapsedBlocks > 0) {
|
|
53
|
-
hint =
|
|
54
|
-
`stripComments collapsed ${collapsedBlocks} comment block(s) (${removedLines} lines) into markers. ` +
|
|
55
|
-
`Re-run without stripComments for the full source.`;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
let worst;
|
|
60
|
-
for (const tab of TABS) {
|
|
61
|
-
const s = commentStats(code[tab]);
|
|
62
|
-
if (s.totalLines < HEAVY_MIN_LINES)
|
|
63
|
-
continue;
|
|
64
|
-
const ratio = s.commentLines / s.totalLines;
|
|
65
|
-
if (ratio >= HEAVY_RATIO && (!worst || ratio > worst.ratio)) {
|
|
66
|
-
worst = {
|
|
67
|
-
tab,
|
|
68
|
-
total: s.totalLines,
|
|
69
|
-
comment: s.commentLines,
|
|
70
|
-
ratio,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (worst) {
|
|
75
|
-
const pct = Math.round(worst.ratio * 100);
|
|
76
|
-
hint =
|
|
77
|
-
`${worst.tab} tab is ${pct}% comments (${worst.comment}/${worst.total} lines). ` +
|
|
78
|
-
`Set stripComments=true to collapse dead-code blocks and save context.`;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (resolveMaskSecrets(maskSecrets)) {
|
|
82
|
-
for (const tab of TABS)
|
|
83
|
-
code[tab] = maskCode(code[tab]);
|
|
84
|
-
}
|
|
85
|
-
let hasSecurityAccess;
|
|
86
|
-
if (includeSecurityAccess) {
|
|
87
|
-
hasSecurityAccess = (await tm1Client.processes.getDeployMeta(processName))
|
|
88
|
-
.hasSecurityAccess;
|
|
89
|
-
}
|
|
90
|
-
const payload = {
|
|
91
|
-
...code,
|
|
92
|
-
...(hasSecurityAccess !== undefined ? { hasSecurityAccess } : {}),
|
|
93
|
-
...(hint ? { hint } : {}),
|
|
94
|
-
};
|
|
95
|
-
return {
|
|
96
|
-
content: [{ type: "text", text: JSON.stringify(payload) }],
|
|
97
|
-
};
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
//# sourceMappingURL=get-process-code.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { FORMAT_SCHEMA, payloadResponse, renderKV } from "../format.js";
|
|
3
|
-
import { DataSourceSchema } from "../schemas/items.js";
|
|
4
|
-
import { READ_ONLY } from "../annotations.js";
|
|
5
|
-
import { defineTool } from "../define-tool.js";
|
|
6
|
-
export const registerGetProcessDatasource = defineTool({
|
|
7
|
-
name: "tm1_get_process_datasource",
|
|
8
|
-
description: "Get the data source configuration of a TurboIntegrator process. The password field is always redacted.",
|
|
9
|
-
annotations: READ_ONLY,
|
|
10
|
-
output: DataSourceSchema,
|
|
11
|
-
input: {
|
|
12
|
-
processName: z.string().describe("Name of the TI process"),
|
|
13
|
-
...FORMAT_SCHEMA,
|
|
14
|
-
},
|
|
15
|
-
handler: async ({ processName, format }, tm1Client) => {
|
|
16
|
-
const ds = await tm1Client.processes.getDataSource(processName);
|
|
17
|
-
return payloadResponse(ds, format, (d) => renderKV(d, `Datasource of ${processName}`));
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
//# sourceMappingURL=get-process-datasource.js.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { FORMAT_SCHEMA, payloadResponse, renderTable, columnsOf, } from "../format.js";
|
|
3
|
-
import { ProcessParameterSchema } from "../schemas/items.js";
|
|
4
|
-
import { READ_ONLY } from "../annotations.js";
|
|
5
|
-
import { defineTool } from "../define-tool.js";
|
|
6
|
-
export const registerGetProcessParameters = defineTool({
|
|
7
|
-
name: "tm1_get_process_parameters",
|
|
8
|
-
description: "Get the parameters of a TurboIntegrator process including names, types and defaults",
|
|
9
|
-
annotations: READ_ONLY,
|
|
10
|
-
output: {
|
|
11
|
-
processName: z.string(),
|
|
12
|
-
parameters: z.array(ProcessParameterSchema),
|
|
13
|
-
},
|
|
14
|
-
input: {
|
|
15
|
-
processName: z.string().describe("Name of the TI process"),
|
|
16
|
-
...FORMAT_SCHEMA,
|
|
17
|
-
},
|
|
18
|
-
handler: async ({ processName, format }, tm1Client) => {
|
|
19
|
-
const params = await tm1Client.processes.getParameters(processName);
|
|
20
|
-
const payload = { processName, parameters: params };
|
|
21
|
-
const columns = columnsOf(["name", "type", "defaultValue", "prompt"]);
|
|
22
|
-
return payloadResponse(payload, format, (p) => `## Parameters of ${p.processName}\n\n${renderTable(p.parameters, columns)}`);
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
//# sourceMappingURL=get-process-parameters.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { FORMAT_SCHEMA, payloadResponse, renderTable, columnsOf, } from "../format.js";
|
|
3
|
-
import { IgnoredColumnSchema, ProcessVariableSchema, } from "../schemas/items.js";
|
|
4
|
-
import { READ_ONLY } from "../annotations.js";
|
|
5
|
-
import { defineTool } from "../define-tool.js";
|
|
6
|
-
export const registerGetProcessVariables = defineTool({
|
|
7
|
-
name: "tm1_get_process_variables",
|
|
8
|
-
description: "Get the variables (column-name mapping for ASCII/ODBC sources) of a TurboIntegrator process. " +
|
|
9
|
-
"Columns set to 'Ignore' carry no variable and are reported separately in ignoredColumns — " +
|
|
10
|
-
"they are the reason variable positions can have gaps.",
|
|
11
|
-
annotations: READ_ONLY,
|
|
12
|
-
output: {
|
|
13
|
-
processName: z.string(),
|
|
14
|
-
variables: z.array(ProcessVariableSchema),
|
|
15
|
-
ignoredColumns: z.array(IgnoredColumnSchema),
|
|
16
|
-
},
|
|
17
|
-
input: {
|
|
18
|
-
processName: z.string().describe("Name of the TI process"),
|
|
19
|
-
...FORMAT_SCHEMA,
|
|
20
|
-
},
|
|
21
|
-
handler: async ({ processName, format }, tm1Client) => {
|
|
22
|
-
const { variables, ignoredColumns } = await tm1Client.processes.getVariableLayout(processName);
|
|
23
|
-
const payload = { processName, variables, ignoredColumns };
|
|
24
|
-
const columns = columnsOf([
|
|
25
|
-
"name",
|
|
26
|
-
"type",
|
|
27
|
-
"position",
|
|
28
|
-
"startByte",
|
|
29
|
-
"endByte",
|
|
30
|
-
]);
|
|
31
|
-
const ignoredCols = columnsOf(["position", "name"]);
|
|
32
|
-
return payloadResponse(payload, format, (p) => `## Variables of ${p.processName}\n\n${renderTable(p.variables, columns)}` +
|
|
33
|
-
(p.ignoredColumns.length > 0
|
|
34
|
-
? `\n\n### Ignored columns\n\n${renderTable(p.ignoredColumns, ignoredCols)}`
|
|
35
|
-
: ""));
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
//# sourceMappingURL=get-process-variables.js.map
|