n8n-mcp 2.78.0 → 2.79.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/dist/mcp/handlers-n8n-manager.js +1 -1
- package/dist/mcp/handlers-n8n-manager.js.map +1 -1
- package/dist/mcp/param-aliases.d.ts +9 -0
- package/dist/mcp/param-aliases.d.ts.map +1 -0
- package/dist/mcp/param-aliases.js +84 -0
- package/dist/mcp/param-aliases.js.map +1 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +57 -21
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-docs/workflow_management/n8n-executions.js +2 -2
- package/dist/mcp/tool-docs/workflow_management/n8n-executions.js.map +1 -1
- package/dist/mcp/tool-docs/workflow_management/n8n-test-workflow.js +1 -1
- package/dist/mcp/tool-docs/workflow_management/n8n-test-workflow.js.map +1 -1
- package/dist/mcp/tool-docs/workflow_management/n8n-workflow-versions.js +2 -2
- package/dist/mcp/tool-docs/workflow_management/n8n-workflow-versions.js.map +1 -1
- package/dist/mcp/tools-n8n-manager.d.ts.map +1 -1
- package/dist/mcp/tools-n8n-manager.js +10 -8
- package/dist/mcp/tools-n8n-manager.js.map +1 -1
- package/dist/telemetry/event-validator.d.ts +2 -2
- package/dist/templates/metadata-generator.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveGetNodeAliases = resolveGetNodeAliases;
|
|
4
|
+
exports.suggestExecutionsAction = suggestExecutionsAction;
|
|
5
|
+
exports.withWorkflowIdAlias = withWorkflowIdAlias;
|
|
6
|
+
exports.hasText = hasText;
|
|
7
|
+
const logger_1 = require("../utils/logger");
|
|
8
|
+
const GET_NODE_MODE_ALIASES = {
|
|
9
|
+
essentials: { mode: 'info', detail: 'standard' },
|
|
10
|
+
minimal: { mode: 'info', detail: 'minimal' },
|
|
11
|
+
standard: { mode: 'info', detail: 'standard' },
|
|
12
|
+
full: { mode: 'info', detail: 'full' },
|
|
13
|
+
operations: { mode: 'info', detail: 'standard' },
|
|
14
|
+
properties: { mode: 'search_properties' },
|
|
15
|
+
search: { mode: 'search_properties' },
|
|
16
|
+
};
|
|
17
|
+
const GET_NODE_DETAIL_ALIASES = {
|
|
18
|
+
essentials: 'standard',
|
|
19
|
+
summary: 'minimal',
|
|
20
|
+
short: 'minimal',
|
|
21
|
+
};
|
|
22
|
+
function resolveGetNodeAliases(mode, detail) {
|
|
23
|
+
const aliased = [];
|
|
24
|
+
let resolvedMode = mode;
|
|
25
|
+
let resolvedDetail = detail;
|
|
26
|
+
if (typeof resolvedDetail === 'string') {
|
|
27
|
+
const detailAlias = GET_NODE_DETAIL_ALIASES[resolvedDetail.toLowerCase()];
|
|
28
|
+
if (detailAlias) {
|
|
29
|
+
aliased.push(`detail=${resolvedDetail}→${detailAlias}`);
|
|
30
|
+
resolvedDetail = detailAlias;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (typeof resolvedMode === 'string') {
|
|
34
|
+
const modeAlias = GET_NODE_MODE_ALIASES[resolvedMode.toLowerCase()];
|
|
35
|
+
if (modeAlias) {
|
|
36
|
+
const target = modeAlias.detail
|
|
37
|
+
? `mode=${modeAlias.mode}, detail=${modeAlias.detail}`
|
|
38
|
+
: `mode=${modeAlias.mode}`;
|
|
39
|
+
aliased.push(`mode=${resolvedMode}→${target}`);
|
|
40
|
+
resolvedMode = modeAlias.mode;
|
|
41
|
+
if (modeAlias.detail)
|
|
42
|
+
resolvedDetail = modeAlias.detail;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (aliased.length > 0) {
|
|
46
|
+
logger_1.logger.debug(`get_node: retired parameter vocabulary aliased (${aliased.join('; ')})`);
|
|
47
|
+
}
|
|
48
|
+
return { mode: resolvedMode, detail: resolvedDetail };
|
|
49
|
+
}
|
|
50
|
+
const EXECUTIONS_ACTION_HINTS = {
|
|
51
|
+
get_many: "Did you mean action='list'?",
|
|
52
|
+
getmany: "Did you mean action='list'?",
|
|
53
|
+
getall: "Did you mean action='list'?",
|
|
54
|
+
get_all: "Did you mean action='list'?",
|
|
55
|
+
list_executions: "Did you mean action='list'?",
|
|
56
|
+
listexecutions: "Did you mean action='list'?",
|
|
57
|
+
search: "Did you mean action='list'?",
|
|
58
|
+
get_execution: "Did you mean action='get'?",
|
|
59
|
+
getexecution: "Did you mean action='get'?",
|
|
60
|
+
retry: "Retrying an execution is not supported; re-run the workflow with n8n_test_workflow.",
|
|
61
|
+
list_runs: 'Evaluation test runs are managed by n8n_evaluations.',
|
|
62
|
+
get_run: 'Evaluation test runs are managed by n8n_evaluations.',
|
|
63
|
+
getrows: 'Data table rows are managed by n8n_manage_datatable.',
|
|
64
|
+
get_rows: 'Data table rows are managed by n8n_manage_datatable.',
|
|
65
|
+
};
|
|
66
|
+
function suggestExecutionsAction(action) {
|
|
67
|
+
return EXECUTIONS_ACTION_HINTS[action.toLowerCase()];
|
|
68
|
+
}
|
|
69
|
+
function withWorkflowIdAlias(args) {
|
|
70
|
+
const workflowIdMissing = args.workflowId === undefined || args.workflowId === null
|
|
71
|
+
|| (typeof args.workflowId === 'string' && args.workflowId.trim() === '');
|
|
72
|
+
if (!workflowIdMissing) {
|
|
73
|
+
return args;
|
|
74
|
+
}
|
|
75
|
+
const id = typeof args.id === 'number' ? String(args.id) : args.id;
|
|
76
|
+
if (typeof id !== 'string' || id.trim() === '') {
|
|
77
|
+
return typeof args.workflowId === 'string' ? { ...args, workflowId: undefined } : args;
|
|
78
|
+
}
|
|
79
|
+
return { ...args, workflowId: id };
|
|
80
|
+
}
|
|
81
|
+
function hasText(value) {
|
|
82
|
+
return typeof value === 'string' && value.trim() !== '';
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=param-aliases.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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AC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;AACvD,CAAC;AAUD,SAAgB,mBAAmB,CAAoC,IAAO;IAC5E,MAAM,iBAAiB,GAAG,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI;WAC9E,CAAC,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC5E,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAEvB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,GAAG,OAAO,IAAI,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;IACnE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QAE/C,OAAO,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACzF,CAAC;IACD,OAAO,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;AACrC,CAAC;AAGD,SAAgB,OAAO,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;AAC1D,CAAC"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare class N8NDocumentationMCPServer {
|
|
|
44
44
|
private validateToolParamsBasic;
|
|
45
45
|
private validateExtractedArgs;
|
|
46
46
|
private coerceStringifiedJsonParams;
|
|
47
|
+
private listExecutionsInsteadOfGet;
|
|
47
48
|
private listNodes;
|
|
48
49
|
private getNodeInfo;
|
|
49
50
|
private searchNodes;
|
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AA8DA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAyB,MAAM,2BAA2B,CAAC;AAEvF,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAwInE,UAAU,gBAAgB;IACxB,eAAe,CAAC,EAAE,cAAc,EAAE,CAAC;CACpC;AAED,qBAAa,yBAAyB;IACpC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,EAAE,CAAgC;IAC1C,OAAO,CAAC,UAAU,CAA+B;IACjD,OAAO,CAAC,sBAAsB,CAAuC;IACrE,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,eAAe,CAAC,CAAkB;IAC1C,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,qBAAqB,CAAsB;IACnD,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,kBAAkB,CAA4B;IACtD,OAAO,CAAC,2BAA2B,CAAyC;IAC5E,OAAO,CAAC,4BAA4B,CAAiC;IACrE,OAAO,CAAC,iBAAiB,CAAkB;IAC3C,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,qBAAqB,CAA0C;gBAE3D,eAAe,CAAC,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAgHzG,OAAO,CAAC,uBAAuB;IA0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,uBAAuB;IA4D/B,OAAO,CAAC,wBAAwB;YAkClB,mBAAmB;YAoEnB,qBAAqB;IAY7B,OAAO,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;YAS9B,aAAa;YAcb,iBAAiB;YAoBjB,WAAW;YAwBX,eAAe;IAqB7B,OAAO,CAAC,qBAAqB,CASb;IAEhB,OAAO,CAAC,mBAAmB;YAsDb,mBAAmB;YAwBnB,yBAAyB;IAmEvC,OAAO,CAAC,kBAAkB;YAiBZ,gBAAgB;YA6HhB,2BAA2B;YAiE3B,2BAA2B;IAyEnC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA6CpB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAgFhC"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -50,6 +50,7 @@ const tool_policy_1 = require("./tool-policy");
|
|
|
50
50
|
const tools_n8n_friendly_1 = require("./tools-n8n-friendly");
|
|
51
51
|
const workflow_examples_1 = require("./workflow-examples");
|
|
52
52
|
const logger_1 = require("../utils/logger");
|
|
53
|
+
const param_aliases_1 = require("./param-aliases");
|
|
53
54
|
const stdio_guard_1 = require("../utils/stdio-guard");
|
|
54
55
|
const redaction_1 = require("../utils/redaction");
|
|
55
56
|
const node_repository_1 = require("../database/node-repository");
|
|
@@ -402,8 +403,13 @@ class N8NDocumentationMCPServer {
|
|
|
402
403
|
const cloned = JSON.parse(JSON.stringify(original));
|
|
403
404
|
const remaining = [...(0, tool_policy_1.getValidOperations)(toolName)].filter(v => !ops.has(v));
|
|
404
405
|
const param = cloned.inputSchema?.properties?.[paramName];
|
|
406
|
+
let defaultRemoved = false;
|
|
405
407
|
if (param?.enum) {
|
|
406
408
|
param.enum = param.enum.filter(v => !ops.has(v.toLowerCase()));
|
|
409
|
+
if (typeof param.default === 'string' && ops.has(param.default.toLowerCase())) {
|
|
410
|
+
delete param.default;
|
|
411
|
+
defaultRemoved = true;
|
|
412
|
+
}
|
|
407
413
|
if (param.enum.length === 0) {
|
|
408
414
|
logger_1.logger.warn(`DISABLED_TOOL_OPERATIONS: all operations for '${toolName}' are disabled ` +
|
|
409
415
|
`but the tool still appears in ListTools. ` +
|
|
@@ -411,11 +417,13 @@ class N8NDocumentationMCPServer {
|
|
|
411
417
|
}
|
|
412
418
|
if (param.description) {
|
|
413
419
|
const disabledList = [...ops].join(', ');
|
|
414
|
-
param.description = `${param.description} (disabled by server policy: ${disabledList}
|
|
420
|
+
param.description = `${param.description} (disabled by server policy: ${disabledList}`
|
|
421
|
+
+ `${defaultRemoved ? '; no default, pass a value' : ''})`;
|
|
415
422
|
}
|
|
416
423
|
}
|
|
417
424
|
const disabledList = [...ops].join(', ');
|
|
418
|
-
cloned.description = `${cloned.description}\n\n> Operations disabled by server policy: ${disabledList}
|
|
425
|
+
cloned.description = `${cloned.description}\n\n> Operations disabled by server policy: ${disabledList}`
|
|
426
|
+
+ (defaultRemoved ? `. The default for ${paramName} was one of them, so ${paramName} must be passed explicitly.` : '');
|
|
419
427
|
const destructive = tools_n8n_manager_1.DESTRUCTIVE_TOOL_OPERATIONS[toolName];
|
|
420
428
|
if (destructive && cloned.annotations) {
|
|
421
429
|
const stillDestructive = remaining.some(v => destructive.has(String(v).toLowerCase()));
|
|
@@ -860,9 +868,18 @@ class N8NDocumentationMCPServer {
|
|
|
860
868
|
validationResult = validation_schemas_1.ToolValidation.validateWorkflowId(args);
|
|
861
869
|
break;
|
|
862
870
|
case 'n8n_executions':
|
|
863
|
-
validationResult =
|
|
871
|
+
validationResult = { valid: true, errors: [] };
|
|
872
|
+
break;
|
|
873
|
+
case 'n8n_test_workflow':
|
|
874
|
+
validationResult = (0, param_aliases_1.hasText)(args.workflowId)
|
|
864
875
|
? { valid: true, errors: [] }
|
|
865
|
-
: {
|
|
876
|
+
: {
|
|
877
|
+
valid: false,
|
|
878
|
+
errors: [{
|
|
879
|
+
field: 'workflowId',
|
|
880
|
+
message: 'workflowId is required: the ID of the workflow to run ("id" is accepted as an alias)'
|
|
881
|
+
}]
|
|
882
|
+
};
|
|
866
883
|
break;
|
|
867
884
|
case 'n8n_evaluations': {
|
|
868
885
|
const evalErrors = [];
|
|
@@ -1086,6 +1103,19 @@ class N8NDocumentationMCPServer {
|
|
|
1086
1103
|
}
|
|
1087
1104
|
return coerced;
|
|
1088
1105
|
}
|
|
1106
|
+
async listExecutionsInsteadOfGet(args) {
|
|
1107
|
+
if ((0, tool_policy_1.isOperationDisabled)('n8n_executions', 'list')) {
|
|
1108
|
+
throw new Error('id is required for action=get');
|
|
1109
|
+
}
|
|
1110
|
+
const result = await n8nHandlers.handleListExecutions(args, this.instanceContext);
|
|
1111
|
+
if (!result.success)
|
|
1112
|
+
return result;
|
|
1113
|
+
const scope = (0, param_aliases_1.hasText)(args.workflowId) ? `executions of workflow ${args.workflowId}` : 'recent executions';
|
|
1114
|
+
return {
|
|
1115
|
+
...result,
|
|
1116
|
+
message: `action=get was called without an execution id, so ${scope} were listed instead. Pass id to get one execution.`
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1089
1119
|
async executeTool(name, args) {
|
|
1090
1120
|
args = args || {};
|
|
1091
1121
|
const disabledTools = this.getDisabledTools();
|
|
@@ -1123,19 +1153,21 @@ class N8NDocumentationMCPServer {
|
|
|
1123
1153
|
includeOperations: args.includeOperations,
|
|
1124
1154
|
source: args.source
|
|
1125
1155
|
});
|
|
1126
|
-
case 'get_node':
|
|
1156
|
+
case 'get_node': {
|
|
1127
1157
|
this.validateToolParams(name, args, ['nodeType']);
|
|
1128
|
-
|
|
1158
|
+
const { mode: nodeMode, detail: nodeDetail } = (0, param_aliases_1.resolveGetNodeAliases)(args.mode, args.detail);
|
|
1159
|
+
if (nodeMode === 'docs') {
|
|
1129
1160
|
return this.getNodeDocumentation(args.nodeType);
|
|
1130
1161
|
}
|
|
1131
|
-
if (
|
|
1162
|
+
if (nodeMode === 'search_properties') {
|
|
1132
1163
|
if (!args.propertyQuery) {
|
|
1133
1164
|
throw new Error('propertyQuery is required for mode=search_properties');
|
|
1134
1165
|
}
|
|
1135
1166
|
const maxResults = args.maxPropertyResults !== undefined ? Number(args.maxPropertyResults) || 20 : 20;
|
|
1136
1167
|
return this.searchNodeProperties(args.nodeType, args.propertyQuery, maxResults);
|
|
1137
1168
|
}
|
|
1138
|
-
return this.getNode(args.nodeType,
|
|
1169
|
+
return this.getNode(args.nodeType, nodeDetail, nodeMode, args.includeTypeInfo, args.includeExamples, args.fromVersion, args.toVersion);
|
|
1170
|
+
}
|
|
1139
1171
|
case 'validate_node':
|
|
1140
1172
|
this.validateToolParams(name, args, ['nodeType', 'config']);
|
|
1141
1173
|
if (typeof args.config !== 'object' || args.config === null) {
|
|
@@ -1271,27 +1303,32 @@ class N8NDocumentationMCPServer {
|
|
|
1271
1303
|
if (!this.repository)
|
|
1272
1304
|
throw new Error('Repository not initialized');
|
|
1273
1305
|
return n8nHandlers.handleAutofixWorkflow(args, this.repository, this.instanceContext);
|
|
1274
|
-
case 'n8n_test_workflow':
|
|
1275
|
-
|
|
1276
|
-
|
|
1306
|
+
case 'n8n_test_workflow': {
|
|
1307
|
+
const testArgs = (0, param_aliases_1.withWorkflowIdAlias)(args);
|
|
1308
|
+
this.validateToolParams(name, testArgs);
|
|
1309
|
+
return n8nHandlers.handleTestWorkflow(testArgs, this.instanceContext);
|
|
1310
|
+
}
|
|
1277
1311
|
case 'n8n_executions': {
|
|
1278
|
-
this.validateToolParams(name, args
|
|
1279
|
-
const execAction = args
|
|
1312
|
+
this.validateToolParams(name, args);
|
|
1313
|
+
const execAction = String((0, tool_policy_1.resolveRequestedOperation)(name, args));
|
|
1280
1314
|
switch (execAction) {
|
|
1281
1315
|
case 'get':
|
|
1282
|
-
if (!args.id) {
|
|
1283
|
-
|
|
1316
|
+
if (!(0, param_aliases_1.hasText)(args.id)) {
|
|
1317
|
+
return this.listExecutionsInsteadOfGet(args);
|
|
1284
1318
|
}
|
|
1285
1319
|
return n8nHandlers.handleGetExecution(args, this.instanceContext);
|
|
1286
1320
|
case 'list':
|
|
1287
1321
|
return n8nHandlers.handleListExecutions(args, this.instanceContext);
|
|
1288
1322
|
case 'delete':
|
|
1289
|
-
if (!args.id) {
|
|
1323
|
+
if (!(0, param_aliases_1.hasText)(args.id)) {
|
|
1290
1324
|
throw new Error('id is required for action=delete');
|
|
1291
1325
|
}
|
|
1292
1326
|
return n8nHandlers.handleDeleteExecution(args, this.instanceContext);
|
|
1293
|
-
default:
|
|
1294
|
-
|
|
1327
|
+
default: {
|
|
1328
|
+
const message = `Unknown action: ${execAction}. Valid actions: get, list, delete.`;
|
|
1329
|
+
const hint = (0, param_aliases_1.suggestExecutionsAction)(execAction);
|
|
1330
|
+
throw new Error(hint ? `${message} ${hint}` : message);
|
|
1331
|
+
}
|
|
1295
1332
|
}
|
|
1296
1333
|
}
|
|
1297
1334
|
case 'n8n_evaluations': {
|
|
@@ -1327,8 +1364,7 @@ class N8NDocumentationMCPServer {
|
|
|
1327
1364
|
}
|
|
1328
1365
|
return n8nHandlers.handleHealthCheck(this.instanceContext);
|
|
1329
1366
|
case 'n8n_workflow_versions':
|
|
1330
|
-
|
|
1331
|
-
return n8nHandlers.handleWorkflowVersions(args, this.repository, this.instanceContext);
|
|
1367
|
+
return n8nHandlers.handleWorkflowVersions((0, param_aliases_1.withWorkflowIdAlias)(args), this.repository, this.instanceContext);
|
|
1332
1368
|
case 'n8n_deploy_template':
|
|
1333
1369
|
this.validateToolParams(name, args, ['templateId']);
|
|
1334
1370
|
await this.ensureInitialized();
|
|
@@ -2413,7 +2449,7 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
|
|
|
2413
2449
|
throw new Error(`get_node: Invalid detail level "${detail}". Valid options: ${validDetailLevels.join(', ')}`);
|
|
2414
2450
|
}
|
|
2415
2451
|
if (!validModes.includes(mode)) {
|
|
2416
|
-
throw new Error(`get_node: Invalid mode "${mode}". Valid options: ${validModes.join(', ')}`);
|
|
2452
|
+
throw new Error(`get_node: Invalid mode "${mode}". Valid options: info, docs, search_properties, ${validModes.slice(1).join(', ')}`);
|
|
2417
2453
|
}
|
|
2418
2454
|
const normalizedType = node_type_normalizer_1.NodeTypeNormalizer.normalizeToFullForm(nodeType);
|
|
2419
2455
|
if (mode !== 'info') {
|