@sonisoft/now-sdk-ext-mcp 2.0.0 → 2.3.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.
@@ -0,0 +1,559 @@
1
+ import { z } from "zod";
2
+ import { FlowManager } from "@sonisoft/now-sdk-ext-core";
3
+ import { withConnectionRetry } from "../common/connection.js";
4
+ /**
5
+ * Instance parameter description shared across flow tools.
6
+ */
7
+ const INSTANCE_DESC = "The ServiceNow instance auth alias to use. " +
8
+ 'This is the alias configured via `now-sdk auth --add` (e.g., "dev224436", "prod", "test"). ' +
9
+ 'The user will typically refer to this by name when saying things like "on my dev224436 instance". ' +
10
+ "If not provided, falls back to the SN_AUTH_ALIAS environment variable.";
11
+ /**
12
+ * Shared Zod schema fragments for execution parameters common to all
13
+ * execute_flow / execute_subflow / execute_action tools.
14
+ */
15
+ const executionInputSchema = {
16
+ instance: z.string().optional().describe(INSTANCE_DESC),
17
+ scoped_name: z
18
+ .string()
19
+ .describe('Scoped name of the flow/subflow/action to execute (e.g., "global.my_flow", ' +
20
+ '"x_myapp_custom.create_incident_subflow").'),
21
+ inputs: z
22
+ .record(z.unknown())
23
+ .optional()
24
+ .describe("Input name-value pairs to pass to the flow/subflow/action. " +
25
+ "Keys are the input variable names defined in Flow Designer."),
26
+ mode: z
27
+ .enum(["foreground", "background"])
28
+ .optional()
29
+ .describe('Execution mode. "foreground" (default) runs synchronously and returns outputs ' +
30
+ "when complete. " +
31
+ '"background" returns immediately with a context ID — use get_flow_context_status ' +
32
+ "to poll, then get_flow_outputs or get_flow_error to retrieve results. " +
33
+ "Use background for flows with approval/wait steps."),
34
+ timeout: z
35
+ .number()
36
+ .optional()
37
+ .describe("Timeout in milliseconds for the execution. " +
38
+ "Only applies to foreground mode. Default is the ServiceNow server default (~30s)."),
39
+ quick: z
40
+ .boolean()
41
+ .optional()
42
+ .describe("Skip creation of execution detail records for better performance. " +
43
+ "Default false. Use true in CI/CD or when you don't need step-level detail."),
44
+ scope: z
45
+ .string()
46
+ .optional()
47
+ .describe("Scope context for script execution. Can be a scope name " +
48
+ '(e.g., "x_myapp_custom") or sys_id. Use when the flow is in a scoped app.'),
49
+ };
50
+ /**
51
+ * Format a FlowExecutionResult into human-readable text output.
52
+ */
53
+ function formatExecutionResult(result) {
54
+ const lines = [];
55
+ lines.push(`=== Flow Execution Result ===`);
56
+ lines.push(`Success: ${result.success}`);
57
+ lines.push(`Type: ${result.flowObjectType}`);
58
+ lines.push(`Name: ${result.flowObjectName}`);
59
+ if (result.contextId) {
60
+ lines.push(`Context ID: ${result.contextId}`);
61
+ }
62
+ if (result.executionDate) {
63
+ lines.push(`Execution Date: ${result.executionDate}`);
64
+ }
65
+ if (result.errorMessage) {
66
+ lines.push(`Error: ${result.errorMessage}`);
67
+ }
68
+ if (result.outputs && Object.keys(result.outputs).length > 0) {
69
+ lines.push("");
70
+ lines.push("Outputs:");
71
+ lines.push(JSON.stringify(result.outputs, null, 2));
72
+ }
73
+ if (result.debugOutput) {
74
+ lines.push("");
75
+ lines.push("Debug Output:");
76
+ lines.push(result.debugOutput);
77
+ }
78
+ return lines.join("\n");
79
+ }
80
+ // ============================================================
81
+ // 1. execute_flow
82
+ // ============================================================
83
+ export function registerExecuteFlowTool(server) {
84
+ server.registerTool("execute_flow", {
85
+ title: "Execute Flow",
86
+ description: "Execute a published ServiceNow Flow Designer flow by scoped name. " +
87
+ "Runs the flow using sn_fd.FlowAPI via a background script.\n\n" +
88
+ "In foreground mode (default), the call blocks until the flow completes and " +
89
+ "returns outputs directly. In background mode, it returns immediately with a " +
90
+ "context ID that you can poll with get_flow_context_status.\n\n" +
91
+ "IMPORTANT: Flows with approval or wait steps MUST use background mode — " +
92
+ "foreground mode will fail if the flow enters a waiting state.\n\n" +
93
+ "NOTE: This tool requires the flow to be published. If you are iterating and " +
94
+ "building a flow that may not be published yet, use test_flow instead — it " +
95
+ "tests the flow in its current draft state, exactly as the 'Test' button in " +
96
+ "Flow Designer does.",
97
+ inputSchema: executionInputSchema,
98
+ }, async ({ instance, scoped_name, inputs, mode, timeout, quick, scope }) => {
99
+ try {
100
+ const result = await withConnectionRetry(instance, async (snInstance) => {
101
+ const mgr = new FlowManager(snInstance, scope);
102
+ return await mgr.executeFlow({
103
+ scopedName: scoped_name,
104
+ inputs,
105
+ mode,
106
+ timeout,
107
+ quick,
108
+ scope,
109
+ });
110
+ });
111
+ return {
112
+ content: [
113
+ { type: "text", text: formatExecutionResult(result) },
114
+ ],
115
+ };
116
+ }
117
+ catch (error) {
118
+ const message = error instanceof Error ? error.message : String(error);
119
+ return {
120
+ content: [
121
+ { type: "text", text: `Error executing flow: ${message}` },
122
+ ],
123
+ isError: true,
124
+ };
125
+ }
126
+ });
127
+ }
128
+ // ============================================================
129
+ // 2. execute_subflow
130
+ // ============================================================
131
+ export function registerExecuteSubflowTool(server) {
132
+ server.registerTool("execute_subflow", {
133
+ title: "Execute Subflow",
134
+ description: "Execute a ServiceNow Flow Designer subflow by scoped name. " +
135
+ "Subflows are reusable building blocks in Flow Designer — this is the " +
136
+ "primary tool for testing subflows during development.\n\n" +
137
+ "In foreground mode (default), the call blocks until the subflow completes " +
138
+ "and returns outputs directly. In background mode, it returns a context ID " +
139
+ "for polling with get_flow_context_status.\n\n" +
140
+ "Pass inputs as key-value pairs matching the subflow's input variables.",
141
+ inputSchema: executionInputSchema,
142
+ }, async ({ instance, scoped_name, inputs, mode, timeout, quick, scope }) => {
143
+ try {
144
+ const result = await withConnectionRetry(instance, async (snInstance) => {
145
+ const mgr = new FlowManager(snInstance, scope);
146
+ return await mgr.executeSubflow({
147
+ scopedName: scoped_name,
148
+ inputs,
149
+ mode,
150
+ timeout,
151
+ quick,
152
+ scope,
153
+ });
154
+ });
155
+ return {
156
+ content: [
157
+ { type: "text", text: formatExecutionResult(result) },
158
+ ],
159
+ };
160
+ }
161
+ catch (error) {
162
+ const message = error instanceof Error ? error.message : String(error);
163
+ return {
164
+ content: [
165
+ {
166
+ type: "text",
167
+ text: `Error executing subflow: ${message}`,
168
+ },
169
+ ],
170
+ isError: true,
171
+ };
172
+ }
173
+ });
174
+ }
175
+ // ============================================================
176
+ // 3. execute_action
177
+ // ============================================================
178
+ export function registerExecuteActionTool(server) {
179
+ server.registerTool("execute_action", {
180
+ title: "Execute Action",
181
+ description: "Execute a ServiceNow Flow Designer action by scoped name. " +
182
+ "Actions are the lowest-level building blocks in Flow Designer " +
183
+ "(e.g., lookup record, create task, send notification).\n\n" +
184
+ "In foreground mode (default), the call blocks until the action completes " +
185
+ "and returns outputs directly. Actions typically complete quickly and " +
186
+ "foreground mode is usually appropriate.",
187
+ inputSchema: executionInputSchema,
188
+ }, async ({ instance, scoped_name, inputs, mode, timeout, quick, scope }) => {
189
+ try {
190
+ const result = await withConnectionRetry(instance, async (snInstance) => {
191
+ const mgr = new FlowManager(snInstance, scope);
192
+ return await mgr.executeAction({
193
+ scopedName: scoped_name,
194
+ inputs,
195
+ mode,
196
+ timeout,
197
+ quick,
198
+ scope,
199
+ });
200
+ });
201
+ return {
202
+ content: [
203
+ { type: "text", text: formatExecutionResult(result) },
204
+ ],
205
+ };
206
+ }
207
+ catch (error) {
208
+ const message = error instanceof Error ? error.message : String(error);
209
+ return {
210
+ content: [
211
+ {
212
+ type: "text",
213
+ text: `Error executing action: ${message}`,
214
+ },
215
+ ],
216
+ isError: true,
217
+ };
218
+ }
219
+ });
220
+ }
221
+ // ============================================================
222
+ // 4. get_flow_context_status
223
+ // ============================================================
224
+ export function registerGetFlowContextStatusTool(server) {
225
+ server.registerTool("get_flow_context_status", {
226
+ title: "Get Flow Context Status",
227
+ description: "Query the current status of a flow execution by its context ID. " +
228
+ "Use this to poll background flow executions started with execute_flow, " +
229
+ "execute_subflow, or execute_action in background mode.\n\n" +
230
+ "Possible states: QUEUED, IN_PROGRESS, WAITING, COMPLETE, CANCELLED, ERROR.\n\n" +
231
+ "Typical pattern: execute in background -> poll this tool every few seconds -> " +
232
+ "once COMPLETE, call get_flow_outputs. If ERROR, call get_flow_error.",
233
+ inputSchema: {
234
+ instance: z.string().optional().describe(INSTANCE_DESC),
235
+ context_id: z
236
+ .string()
237
+ .describe("The flow context sys_id returned from an execute_flow, " +
238
+ "execute_subflow, or execute_action call (the contextId field)."),
239
+ },
240
+ }, async ({ instance, context_id }) => {
241
+ try {
242
+ const result = await withConnectionRetry(instance, async (snInstance) => {
243
+ const mgr = new FlowManager(snInstance);
244
+ return await mgr.getFlowContextStatus(context_id);
245
+ });
246
+ const lines = [];
247
+ lines.push("=== Flow Context Status ===");
248
+ lines.push(`Context ID: ${result.contextId}`);
249
+ lines.push(`Found: ${result.found}`);
250
+ if (result.found) {
251
+ lines.push(`State: ${result.state}`);
252
+ if (result.name)
253
+ lines.push(`Name: ${result.name}`);
254
+ if (result.started)
255
+ lines.push(`Started: ${result.started}`);
256
+ if (result.ended)
257
+ lines.push(`Ended: ${result.ended}`);
258
+ }
259
+ if (result.errorMessage) {
260
+ lines.push(`Error: ${result.errorMessage}`);
261
+ }
262
+ return {
263
+ content: [{ type: "text", text: lines.join("\n") }],
264
+ };
265
+ }
266
+ catch (error) {
267
+ const message = error instanceof Error ? error.message : String(error);
268
+ return {
269
+ content: [
270
+ {
271
+ type: "text",
272
+ text: `Error getting flow context status: ${message}`,
273
+ },
274
+ ],
275
+ isError: true,
276
+ };
277
+ }
278
+ });
279
+ }
280
+ // ============================================================
281
+ // 5. get_flow_outputs
282
+ // ============================================================
283
+ export function registerGetFlowOutputsTool(server) {
284
+ server.registerTool("get_flow_outputs", {
285
+ title: "Get Flow Outputs",
286
+ description: "Retrieve outputs from a completed flow/subflow/action execution by its " +
287
+ "context ID. Only call this after get_flow_context_status shows COMPLETE.\n\n" +
288
+ "Returns the output name-value pairs defined by the flow/subflow/action.",
289
+ inputSchema: {
290
+ instance: z.string().optional().describe(INSTANCE_DESC),
291
+ context_id: z
292
+ .string()
293
+ .describe("The flow context sys_id from the execution result's contextId field."),
294
+ },
295
+ }, async ({ instance, context_id }) => {
296
+ try {
297
+ const result = await withConnectionRetry(instance, async (snInstance) => {
298
+ const mgr = new FlowManager(snInstance);
299
+ return await mgr.getFlowOutputs(context_id);
300
+ });
301
+ const lines = [];
302
+ lines.push("=== Flow Outputs ===");
303
+ lines.push(`Context ID: ${result.contextId}`);
304
+ lines.push(`Success: ${result.success}`);
305
+ if (result.outputs && Object.keys(result.outputs).length > 0) {
306
+ lines.push("");
307
+ lines.push("Outputs:");
308
+ lines.push(JSON.stringify(result.outputs, null, 2));
309
+ }
310
+ else {
311
+ lines.push("\nNo outputs returned.");
312
+ }
313
+ if (result.errorMessage) {
314
+ lines.push(`\nError: ${result.errorMessage}`);
315
+ }
316
+ return {
317
+ content: [{ type: "text", text: lines.join("\n") }],
318
+ };
319
+ }
320
+ catch (error) {
321
+ const message = error instanceof Error ? error.message : String(error);
322
+ return {
323
+ content: [
324
+ {
325
+ type: "text",
326
+ text: `Error getting flow outputs: ${message}`,
327
+ },
328
+ ],
329
+ isError: true,
330
+ };
331
+ }
332
+ });
333
+ }
334
+ // ============================================================
335
+ // 6. get_flow_error
336
+ // ============================================================
337
+ export function registerGetFlowErrorTool(server) {
338
+ server.registerTool("get_flow_error", {
339
+ title: "Get Flow Error",
340
+ description: "Retrieve the error message from a failed flow execution by its context ID. " +
341
+ "Call this after get_flow_context_status shows ERROR to understand why the " +
342
+ "flow failed.\n\n" +
343
+ "Returns the flow's error message which can be used to diagnose and fix " +
344
+ "issues in the flow definition.",
345
+ inputSchema: {
346
+ instance: z.string().optional().describe(INSTANCE_DESC),
347
+ context_id: z
348
+ .string()
349
+ .describe("The flow context sys_id from the execution result's contextId field."),
350
+ },
351
+ }, async ({ instance, context_id }) => {
352
+ try {
353
+ const result = await withConnectionRetry(instance, async (snInstance) => {
354
+ const mgr = new FlowManager(snInstance);
355
+ return await mgr.getFlowError(context_id);
356
+ });
357
+ const lines = [];
358
+ lines.push("=== Flow Error ===");
359
+ lines.push(`Context ID: ${result.contextId}`);
360
+ lines.push(`Success: ${result.success}`);
361
+ if (result.flowErrorMessage) {
362
+ lines.push(`\nFlow Error Message:\n${result.flowErrorMessage}`);
363
+ }
364
+ else {
365
+ lines.push("\nNo error message found for this context.");
366
+ }
367
+ if (result.errorMessage) {
368
+ lines.push(`\nExecution Error: ${result.errorMessage}`);
369
+ }
370
+ return {
371
+ content: [{ type: "text", text: lines.join("\n") }],
372
+ };
373
+ }
374
+ catch (error) {
375
+ const message = error instanceof Error ? error.message : String(error);
376
+ return {
377
+ content: [
378
+ {
379
+ type: "text",
380
+ text: `Error getting flow error: ${message}`,
381
+ },
382
+ ],
383
+ isError: true,
384
+ };
385
+ }
386
+ });
387
+ }
388
+ // ============================================================
389
+ // Helper: format FlowTestResult for test_flow output
390
+ // ============================================================
391
+ function formatTestResult(result, runOnThread) {
392
+ const lines = [];
393
+ lines.push("=== Flow Test Result ===");
394
+ lines.push(`Success: ${result.success}`);
395
+ if (result.contextId) {
396
+ lines.push(`Context ID: ${result.contextId}`);
397
+ lines.push("");
398
+ if (runOnThread) {
399
+ // Synchronous execution — the flow has already completed on the server.
400
+ // The context ID can still be used to inspect outputs or errors.
401
+ lines.push("The flow ran synchronously. Use get_flow_outputs to retrieve outputs " +
402
+ "or get_flow_error if the flow encountered an error.");
403
+ }
404
+ else {
405
+ // Asynchronous execution — poll until complete.
406
+ lines.push("The test has been submitted. Use get_flow_context_status to poll " +
407
+ "the execution status, then get_flow_outputs or get_flow_error once complete.");
408
+ }
409
+ }
410
+ if (result.errorMessage) {
411
+ lines.push("");
412
+ lines.push(`Error: ${result.errorMessage}`);
413
+ }
414
+ if (result.errorCode !== undefined && result.errorCode !== 0) {
415
+ lines.push(`Error Code: ${result.errorCode}`);
416
+ }
417
+ return lines.join("\n");
418
+ }
419
+ // ============================================================
420
+ // 7. cancel_flow
421
+ // ============================================================
422
+ export function registerCancelFlowTool(server) {
423
+ server.registerTool("cancel_flow", {
424
+ title: "Cancel Flow",
425
+ description: "Cancel a running or paused flow execution by its context ID. " +
426
+ "Use this to stop a background flow that is no longer needed, " +
427
+ "is stuck in a waiting state, or was started by mistake.\n\n" +
428
+ "IMPORTANT: This is a destructive operation — the flow will be " +
429
+ "permanently cancelled and cannot be resumed.",
430
+ inputSchema: {
431
+ instance: z.string().optional().describe(INSTANCE_DESC),
432
+ context_id: z
433
+ .string()
434
+ .describe("The flow context sys_id from the execution result's contextId field."),
435
+ reason: z
436
+ .string()
437
+ .optional()
438
+ .describe('Reason for cancellation. Default: "Cancelled via FlowManager".'),
439
+ },
440
+ }, async ({ instance, context_id, reason }) => {
441
+ try {
442
+ const result = await withConnectionRetry(instance, async (snInstance) => {
443
+ const mgr = new FlowManager(snInstance);
444
+ return await mgr.cancelFlow(context_id, reason);
445
+ });
446
+ const lines = [];
447
+ lines.push("=== Flow Cancellation ===");
448
+ lines.push(`Context ID: ${result.contextId}`);
449
+ lines.push(`Success: ${result.success}`);
450
+ if (result.errorMessage) {
451
+ lines.push(`Error: ${result.errorMessage}`);
452
+ }
453
+ return {
454
+ content: [{ type: "text", text: lines.join("\n") }],
455
+ };
456
+ }
457
+ catch (error) {
458
+ const message = error instanceof Error ? error.message : String(error);
459
+ return {
460
+ content: [
461
+ {
462
+ type: "text",
463
+ text: `Error cancelling flow: ${message}`,
464
+ },
465
+ ],
466
+ isError: true,
467
+ };
468
+ }
469
+ });
470
+ }
471
+ // ============================================================
472
+ // 8. test_flow
473
+ // ============================================================
474
+ /**
475
+ * Registers the test_flow MCP tool.
476
+ *
477
+ * Tests a Flow Designer flow without requiring it to be published first.
478
+ * Uses FlowManager.testFlow(), which posts to the ProcessFlow REST API
479
+ * (POST /api/now/processflow/flow/{id}/test). This is the preferred tool
480
+ * when iteratively building and testing flows in Flow Designer.
481
+ *
482
+ * The method fetches the full flow definition, merges in the provided
483
+ * outputMap (trigger test values), and submits it to the test endpoint —
484
+ * identical to what the 'Test' button in Flow Designer does.
485
+ *
486
+ * @param server - The McpServer instance to register the tool on
487
+ */
488
+ export function registerTestFlowTool(server) {
489
+ server.registerTool("test_flow", {
490
+ title: "Test Flow (Flow Designer)",
491
+ description: "Test a ServiceNow Flow Designer flow without requiring it to be published. " +
492
+ "This is the PRIMARY tool to use when building and iterating on a flow — it " +
493
+ "invokes the same API as the 'Test' button in Flow Designer, running the flow " +
494
+ "in its current saved (draft) state.\n\n" +
495
+ "Unlike execute_flow (which requires a published flow and uses sn_fd.FlowAPI), " +
496
+ "test_flow works on unpublished drafts via the ProcessFlow REST API " +
497
+ "(POST /api/now/processflow/flow/{id}/test).\n\n" +
498
+ "Provide the flow's sys_id or scoped name in flow_id, and supply trigger output " +
499
+ "variable values in output_map. For record-triggered flows this is typically " +
500
+ '{ "current": "<record_sys_id>", "table_name": "<table>" }. Check the flow\'s ' +
501
+ "trigger configuration in Flow Designer to determine the correct variable names.\n\n" +
502
+ "The tool returns a context ID on success — use get_flow_context_status to poll " +
503
+ "the execution, then get_flow_outputs or get_flow_error once complete.",
504
+ inputSchema: {
505
+ instance: z.string().optional().describe(INSTANCE_DESC),
506
+ flow_id: z
507
+ .string()
508
+ .describe("Flow sys_id (32-char hex) or scoped name (e.g., \"x_myapp.my_flow\"). " +
509
+ "The flow does not need to be published."),
510
+ output_map: z
511
+ .record(z.string())
512
+ .describe("Maps trigger output variable names to concrete test values. " +
513
+ "Keys are the variable names defined in the flow's trigger configuration in Flow Designer. " +
514
+ 'For record-triggered flows: { "current": "<record_sys_id>", "table_name": "<table>" }. ' +
515
+ "Open the flow in Flow Designer and inspect the trigger to see the available variable names."),
516
+ scope: z
517
+ .string()
518
+ .optional()
519
+ .describe("Scope sys_id for the transaction scope query parameter. " +
520
+ "If omitted, the scope is auto-resolved from the flow definition."),
521
+ run_on_thread: z
522
+ .boolean()
523
+ .optional()
524
+ .describe("Whether to run the test synchronously on the current thread. Default: true."),
525
+ },
526
+ }, async ({ instance, flow_id, output_map, scope, run_on_thread }) => {
527
+ const runOnThread = run_on_thread ?? true;
528
+ try {
529
+ const result = await withConnectionRetry(instance, async (snInstance) => {
530
+ // Do not pass scope to the FlowManager constructor — that scope only
531
+ // applies to BackgroundScriptExecutor, which testFlow does not use.
532
+ // The scope for the ProcessFlow REST API is passed via testFlow options.
533
+ const mgr = new FlowManager(snInstance);
534
+ return await mgr.testFlow({
535
+ flowId: flow_id,
536
+ outputMap: output_map,
537
+ scope,
538
+ runOnThread,
539
+ });
540
+ });
541
+ return {
542
+ content: [{ type: "text", text: formatTestResult(result, runOnThread) }],
543
+ };
544
+ }
545
+ catch (error) {
546
+ const message = error instanceof Error ? error.message : String(error);
547
+ return {
548
+ content: [
549
+ {
550
+ type: "text",
551
+ text: `Error testing flow: ${message}`,
552
+ },
553
+ ],
554
+ isError: true,
555
+ };
556
+ }
557
+ });
558
+ }
559
+ //# sourceMappingURL=flow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow.js","sourceRoot":"","sources":["../../src/tools/flow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAuB,MAAM,4BAA4B,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;GAEG;AACH,MAAM,aAAa,GACjB,6CAA6C;IAC7C,6FAA6F;IAC7F,oGAAoG;IACpG,wEAAwE,CAAC;AAE3E;;;GAGG;AACH,MAAM,oBAAoB,GAAG;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;IACvD,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,CACP,6EAA6E;QAC3E,4CAA4C,CAC/C;IACH,MAAM,EAAE,CAAC;SACN,MAAM,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACnB,QAAQ,EAAE;SACV,QAAQ,CACP,6DAA6D;QAC3D,6DAA6D,CAChE;IACH,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,YAAY,EAAE,YAAY,CAAC,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,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,uBAAuB,OAAO,EAAE;qBACvC;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ export declare function registerListKnowledgeBasesTool(server: McpServer): void;
3
+ export declare function registerGetKnowledgeBaseTool(server: McpServer): void;
4
+ export declare function registerListKbCategoriesTool(server: McpServer): void;
5
+ export declare function registerCreateKbCategoryTool(server: McpServer): void;
6
+ export declare function registerListKbArticlesTool(server: McpServer): void;
7
+ export declare function registerGetKbArticleTool(server: McpServer): void;
8
+ export declare function registerCreateKbArticleTool(server: McpServer): void;
9
+ export declare function registerUpdateKbArticleTool(server: McpServer): void;
10
+ export declare function registerPublishKbArticleTool(server: McpServer): void;
11
+ //# sourceMappingURL=knowledge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../src/tools/knowledge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBpE,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsEtE;AAMD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyCpE;AAMD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiEpE;AAMD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsDpE;AAMD,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA2ElE;AAMD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA2ChE;AAMD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA6FnE;AAMD,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoFnE;AAMD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA0CpE"}