@sonisoft/now-sdk-ext-mcp 1.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.
Files changed (102) hide show
  1. package/README.md +393 -0
  2. package/dist/common/connection.d.ts +42 -0
  3. package/dist/common/connection.d.ts.map +1 -0
  4. package/dist/common/connection.js +119 -0
  5. package/dist/common/connection.js.map +1 -0
  6. package/dist/index.d.ts +3 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +108 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/tools/aggregate.d.ts +20 -0
  11. package/dist/tools/aggregate.d.ts.map +1 -0
  12. package/dist/tools/aggregate.js +271 -0
  13. package/dist/tools/aggregate.js.map +1 -0
  14. package/dist/tools/app-manager.d.ts +50 -0
  15. package/dist/tools/app-manager.d.ts.map +1 -0
  16. package/dist/tools/app-manager.js +756 -0
  17. package/dist/tools/app-manager.js.map +1 -0
  18. package/dist/tools/atf.d.ts +16 -0
  19. package/dist/tools/atf.d.ts.map +1 -0
  20. package/dist/tools/atf.js +246 -0
  21. package/dist/tools/atf.js.map +1 -0
  22. package/dist/tools/attachment.d.ts +20 -0
  23. package/dist/tools/attachment.d.ts.map +1 -0
  24. package/dist/tools/attachment.js +223 -0
  25. package/dist/tools/attachment.js.map +1 -0
  26. package/dist/tools/batch.d.ts +15 -0
  27. package/dist/tools/batch.d.ts.map +1 -0
  28. package/dist/tools/batch.js +159 -0
  29. package/dist/tools/batch.js.map +1 -0
  30. package/dist/tools/cmdb.d.ts +14 -0
  31. package/dist/tools/cmdb.d.ts.map +1 -0
  32. package/dist/tools/cmdb.js +199 -0
  33. package/dist/tools/cmdb.js.map +1 -0
  34. package/dist/tools/codesearch.d.ts +31 -0
  35. package/dist/tools/codesearch.d.ts.map +1 -0
  36. package/dist/tools/codesearch.js +371 -0
  37. package/dist/tools/codesearch.js.map +1 -0
  38. package/dist/tools/discovery.d.ts +15 -0
  39. package/dist/tools/discovery.d.ts.map +1 -0
  40. package/dist/tools/discovery.js +204 -0
  41. package/dist/tools/discovery.js.map +1 -0
  42. package/dist/tools/execute-script.d.ts +9 -0
  43. package/dist/tools/execute-script.d.ts.map +1 -0
  44. package/dist/tools/execute-script.js +106 -0
  45. package/dist/tools/execute-script.js.map +1 -0
  46. package/dist/tools/find-atf-tests.d.ts +9 -0
  47. package/dist/tools/find-atf-tests.d.ts.map +1 -0
  48. package/dist/tools/find-atf-tests.js +152 -0
  49. package/dist/tools/find-atf-tests.js.map +1 -0
  50. package/dist/tools/health.d.ts +9 -0
  51. package/dist/tools/health.d.ts.map +1 -0
  52. package/dist/tools/health.js +137 -0
  53. package/dist/tools/health.js.map +1 -0
  54. package/dist/tools/lookup-app.d.ts +11 -0
  55. package/dist/tools/lookup-app.d.ts.map +1 -0
  56. package/dist/tools/lookup-app.js +242 -0
  57. package/dist/tools/lookup-app.js.map +1 -0
  58. package/dist/tools/lookup-columns.d.ts +10 -0
  59. package/dist/tools/lookup-columns.d.ts.map +1 -0
  60. package/dist/tools/lookup-columns.js +180 -0
  61. package/dist/tools/lookup-columns.js.map +1 -0
  62. package/dist/tools/lookup-table.d.ts +10 -0
  63. package/dist/tools/lookup-table.d.ts.map +1 -0
  64. package/dist/tools/lookup-table.js +150 -0
  65. package/dist/tools/lookup-table.js.map +1 -0
  66. package/dist/tools/query-batch.d.ts +16 -0
  67. package/dist/tools/query-batch.d.ts.map +1 -0
  68. package/dist/tools/query-batch.js +197 -0
  69. package/dist/tools/query-batch.js.map +1 -0
  70. package/dist/tools/query-syslog.d.ts +9 -0
  71. package/dist/tools/query-syslog.d.ts.map +1 -0
  72. package/dist/tools/query-syslog.js +127 -0
  73. package/dist/tools/query-syslog.js.map +1 -0
  74. package/dist/tools/query-table.d.ts +8 -0
  75. package/dist/tools/query-table.d.ts.map +1 -0
  76. package/dist/tools/query-table.js +137 -0
  77. package/dist/tools/query-table.js.map +1 -0
  78. package/dist/tools/schema.d.ts +24 -0
  79. package/dist/tools/schema.d.ts.map +1 -0
  80. package/dist/tools/schema.js +321 -0
  81. package/dist/tools/schema.js.map +1 -0
  82. package/dist/tools/scope.d.ts +25 -0
  83. package/dist/tools/scope.d.ts.map +1 -0
  84. package/dist/tools/scope.js +226 -0
  85. package/dist/tools/scope.js.map +1 -0
  86. package/dist/tools/scriptsync.d.ts +14 -0
  87. package/dist/tools/scriptsync.d.ts.map +1 -0
  88. package/dist/tools/scriptsync.js +167 -0
  89. package/dist/tools/scriptsync.js.map +1 -0
  90. package/dist/tools/task.d.ts +39 -0
  91. package/dist/tools/task.d.ts.map +1 -0
  92. package/dist/tools/task.js +390 -0
  93. package/dist/tools/task.js.map +1 -0
  94. package/dist/tools/updateset.d.ts +46 -0
  95. package/dist/tools/updateset.d.ts.map +1 -0
  96. package/dist/tools/updateset.js +475 -0
  97. package/dist/tools/updateset.js.map +1 -0
  98. package/dist/tools/workflow.d.ts +9 -0
  99. package/dist/tools/workflow.d.ts.map +1 -0
  100. package/dist/tools/workflow.js +164 -0
  101. package/dist/tools/workflow.js.map +1 -0
  102. package/package.json +68 -0
@@ -0,0 +1,167 @@
1
+ import { z } from "zod";
2
+ import { ScriptSync } from "@sonisoft/now-sdk-ext-core";
3
+ import { withConnectionRetry } from "../common/connection.js";
4
+ /**
5
+ * Registers the pull_script tool on the MCP server.
6
+ *
7
+ * Pulls a script from ServiceNow and saves it to a local file.
8
+ */
9
+ export function registerPullScriptTool(server) {
10
+ server.registerTool("pull_script", {
11
+ title: "Pull Script from ServiceNow",
12
+ description: "Pull a script (Script Include, Business Rule, UI Script, UI Action, " +
13
+ "Client Script) from a ServiceNow instance and save it to a local file. " +
14
+ "The script content is read from the appropriate table and written to the " +
15
+ "specified file path.\n\n" +
16
+ "Supported script types:\n" +
17
+ "- sys_script_include (Script Include)\n" +
18
+ "- sys_script (Business Rule)\n" +
19
+ "- sys_ui_script (UI Script)\n" +
20
+ "- sys_ui_action (UI Action)\n" +
21
+ "- sys_script_client (Client Script)",
22
+ inputSchema: {
23
+ instance: z
24
+ .string()
25
+ .optional()
26
+ .describe("The ServiceNow instance auth alias (e.g., " +
27
+ '"dev224436", "prod"). If not provided, falls back ' +
28
+ "to the SN_AUTH_ALIAS environment variable."),
29
+ script_name: z
30
+ .string()
31
+ .describe("The name of the script record on the instance " +
32
+ '(e.g., "MyScriptInclude").'),
33
+ script_type: z
34
+ .enum([
35
+ "sys_script_include",
36
+ "sys_script",
37
+ "sys_ui_script",
38
+ "sys_ui_action",
39
+ "sys_script_client",
40
+ ])
41
+ .describe("The type of script to pull."),
42
+ file_path: z
43
+ .string()
44
+ .describe("Local file path to write the script content to."),
45
+ },
46
+ }, async ({ instance, script_name, script_type, file_path }) => {
47
+ try {
48
+ const result = await withConnectionRetry(instance, async (snInstance) => {
49
+ const sync = new ScriptSync(snInstance);
50
+ return await sync.pullScript({
51
+ scriptName: script_name,
52
+ scriptType: script_type,
53
+ filePath: file_path,
54
+ });
55
+ });
56
+ const lines = [];
57
+ lines.push("=== Pull Script Result ===");
58
+ lines.push(`Success: ${result.success}`);
59
+ lines.push(`Script: ${result.scriptName}`);
60
+ lines.push(`Type: ${result.scriptType}`);
61
+ if (result.sysId)
62
+ lines.push(`sys_id: ${result.sysId}`);
63
+ lines.push(`File: ${result.filePath}`);
64
+ lines.push(`Message: ${result.message}`);
65
+ if (result.error)
66
+ lines.push(`Error: ${result.error}`);
67
+ return {
68
+ content: [{ type: "text", text: lines.join("\n") }],
69
+ isError: !result.success,
70
+ };
71
+ }
72
+ catch (error) {
73
+ const message = error instanceof Error ? error.message : String(error);
74
+ return {
75
+ content: [
76
+ {
77
+ type: "text",
78
+ text: `Error pulling script: ${message}`,
79
+ },
80
+ ],
81
+ isError: true,
82
+ };
83
+ }
84
+ });
85
+ }
86
+ /**
87
+ * Registers the push_script tool on the MCP server.
88
+ *
89
+ * Pushes a local script file to ServiceNow.
90
+ */
91
+ export function registerPushScriptTool(server) {
92
+ server.registerTool("push_script", {
93
+ title: "Push Script to ServiceNow",
94
+ description: "Push a local script file to a ServiceNow instance, updating the script " +
95
+ "field on the matching record. The file is read from the specified path " +
96
+ "and the record is found by name in the appropriate table.\n\n" +
97
+ "IMPORTANT: This modifies code on the ServiceNow instance. The record " +
98
+ "must already exist — this updates an existing script, it does not create new ones.\n\n" +
99
+ "Supported script types:\n" +
100
+ "- sys_script_include (Script Include)\n" +
101
+ "- sys_script (Business Rule)\n" +
102
+ "- sys_ui_script (UI Script)\n" +
103
+ "- sys_ui_action (UI Action)\n" +
104
+ "- sys_script_client (Client Script)",
105
+ inputSchema: {
106
+ instance: z
107
+ .string()
108
+ .optional()
109
+ .describe("The ServiceNow instance auth alias (e.g., " +
110
+ '"dev224436", "prod"). If not provided, falls back ' +
111
+ "to the SN_AUTH_ALIAS environment variable."),
112
+ script_name: z
113
+ .string()
114
+ .describe("The name of the script record to update on the instance."),
115
+ script_type: z
116
+ .enum([
117
+ "sys_script_include",
118
+ "sys_script",
119
+ "sys_ui_script",
120
+ "sys_ui_action",
121
+ "sys_script_client",
122
+ ])
123
+ .describe("The type of script to push."),
124
+ file_path: z
125
+ .string()
126
+ .describe("Local file path to read the script content from."),
127
+ },
128
+ }, async ({ instance, script_name, script_type, file_path }) => {
129
+ try {
130
+ const result = await withConnectionRetry(instance, async (snInstance) => {
131
+ const sync = new ScriptSync(snInstance);
132
+ return await sync.pushScript({
133
+ scriptName: script_name,
134
+ scriptType: script_type,
135
+ filePath: file_path,
136
+ });
137
+ });
138
+ const lines = [];
139
+ lines.push("=== Push Script Result ===");
140
+ lines.push(`Success: ${result.success}`);
141
+ lines.push(`Script: ${result.scriptName}`);
142
+ lines.push(`Type: ${result.scriptType}`);
143
+ if (result.sysId)
144
+ lines.push(`sys_id: ${result.sysId}`);
145
+ lines.push(`Message: ${result.message}`);
146
+ if (result.error)
147
+ lines.push(`Error: ${result.error}`);
148
+ return {
149
+ content: [{ type: "text", text: lines.join("\n") }],
150
+ isError: !result.success,
151
+ };
152
+ }
153
+ catch (error) {
154
+ const message = error instanceof Error ? error.message : String(error);
155
+ return {
156
+ content: [
157
+ {
158
+ type: "text",
159
+ text: `Error pushing script: ${message}`,
160
+ },
161
+ ],
162
+ isError: true,
163
+ };
164
+ }
165
+ });
166
+ }
167
+ //# sourceMappingURL=scriptsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scriptsync.js","sourceRoot":"","sources":["../../src/tools/scriptsync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;QACE,KAAK,EAAE,6BAA6B;QACpC,WAAW,EACT,sEAAsE;YACtE,yEAAyE;YACzE,2EAA2E;YAC3E,0BAA0B;YAC1B,2BAA2B;YAC3B,yCAAyC;YACzC,gCAAgC;YAChC,+BAA+B;YAC/B,+BAA+B;YAC/B,qCAAqC;QACvC,WAAW,EAAE;YACX,QAAQ,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CACP,4CAA4C;gBAC1C,oDAAoD;gBACpD,4CAA4C,CAC/C;YACH,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,QAAQ,CACP,gDAAgD;gBAC9C,4BAA4B,CAC/B;YACH,WAAW,EAAE,CAAC;iBACX,IAAI,CAAC;gBACJ,oBAAoB;gBACpB,YAAY;gBACZ,eAAe;gBACf,eAAe;gBACf,mBAAmB;aACpB,CAAC;iBACD,QAAQ,CAAC,6BAA6B,CAAC;YAC1C,SAAS,EAAE,CAAC;iBACT,MAAM,EAAE;iBACR,QAAQ,CAAC,iDAAiD,CAAC;SAC/D;KACF,EACD,KAAK,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,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BACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,yBAAyB,OAAO,EAAE;qBACzC;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /**
3
+ * Registers the add_task_comment tool on the MCP server.
4
+ *
5
+ * Adds a comment or work note to any task-based record
6
+ * (incident, change_request, problem, etc.).
7
+ */
8
+ export declare function registerAddTaskCommentTool(server: McpServer): void;
9
+ /**
10
+ * Registers the assign_task tool on the MCP server.
11
+ *
12
+ * Assigns a task record to a user and optionally an assignment group.
13
+ */
14
+ export declare function registerAssignTaskTool(server: McpServer): void;
15
+ /**
16
+ * Registers the resolve_incident tool on the MCP server.
17
+ *
18
+ * Resolves an incident by setting state to Resolved (6) with resolution notes.
19
+ */
20
+ export declare function registerResolveIncidentTool(server: McpServer): void;
21
+ /**
22
+ * Registers the close_incident tool on the MCP server.
23
+ *
24
+ * Closes an incident by setting state to Closed (7).
25
+ */
26
+ export declare function registerCloseIncidentTool(server: McpServer): void;
27
+ /**
28
+ * Registers the approve_change tool on the MCP server.
29
+ *
30
+ * Approves a change request with optional comments.
31
+ */
32
+ export declare function registerApproveChangeTool(server: McpServer): void;
33
+ /**
34
+ * Registers the find_task tool on the MCP server.
35
+ *
36
+ * Finds a task record by its number (e.g., "INC0010001", "CHG0030002").
37
+ */
38
+ export declare function registerFindTaskTool(server: McpServer): void;
39
+ //# sourceMappingURL=task.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/tools/task.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAkBpE;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoElE;AAMD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoE9D;AAMD;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgEnE;AAMD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA8DjE;AAMD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAsDjE;AAMD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAiE5D"}
@@ -0,0 +1,390 @@
1
+ import { z } from "zod";
2
+ import { TaskOperations } from "@sonisoft/now-sdk-ext-core";
3
+ import { withConnectionRetry } from "../common/connection.js";
4
+ /**
5
+ * Instance parameter description shared across all task tools.
6
+ */
7
+ const INSTANCE_DESC = "The ServiceNow instance auth alias to use. " +
8
+ 'This is the alias configured via `snc configure` (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
+ // 1. add_task_comment
13
+ // ============================================================
14
+ /**
15
+ * Registers the add_task_comment tool on the MCP server.
16
+ *
17
+ * Adds a comment or work note to any task-based record
18
+ * (incident, change_request, problem, etc.).
19
+ */
20
+ export function registerAddTaskCommentTool(server) {
21
+ server.registerTool("add_task_comment", {
22
+ title: "Add Task Comment",
23
+ description: "Add a comment or work note to any task-based record (incident, change_request, " +
24
+ "problem, etc.). Comments are customer-visible by default; set is_work_note to true " +
25
+ "for internal work notes visible only to fulfiller staff.",
26
+ inputSchema: {
27
+ instance: z.string().optional().describe(INSTANCE_DESC),
28
+ table: z
29
+ .string()
30
+ .describe('The table name of the task record (e.g., "incident", "change_request", "problem", "sc_task").'),
31
+ record_sys_id: z
32
+ .string()
33
+ .describe("The sys_id of the task record to add the comment to."),
34
+ comment: z
35
+ .string()
36
+ .describe("The comment text to add to the record."),
37
+ is_work_note: z
38
+ .boolean()
39
+ .default(false)
40
+ .describe("If true, adds a work note (internal, visible to fulfillers only) " +
41
+ "instead of a customer-visible comment. Defaults to false."),
42
+ },
43
+ }, async ({ instance, table, record_sys_id, comment, is_work_note }) => {
44
+ try {
45
+ const result = await withConnectionRetry(instance, async (snInstance) => {
46
+ const ops = new TaskOperations(snInstance);
47
+ return await ops.addComment({
48
+ table,
49
+ recordSysId: record_sys_id,
50
+ comment,
51
+ isWorkNote: is_work_note,
52
+ });
53
+ });
54
+ const noteType = is_work_note ? "Work note" : "Comment";
55
+ const number = result.number ? ` (${result.number})` : "";
56
+ return {
57
+ content: [
58
+ {
59
+ type: "text",
60
+ text: `${noteType} added successfully to ${table}/${result.sys_id}${number}.`,
61
+ },
62
+ ],
63
+ };
64
+ }
65
+ catch (error) {
66
+ const message = error instanceof Error ? error.message : String(error);
67
+ return {
68
+ content: [
69
+ {
70
+ type: "text",
71
+ text: `Error adding comment: ${message}`,
72
+ },
73
+ ],
74
+ isError: true,
75
+ };
76
+ }
77
+ });
78
+ }
79
+ // ============================================================
80
+ // 2. assign_task
81
+ // ============================================================
82
+ /**
83
+ * Registers the assign_task tool on the MCP server.
84
+ *
85
+ * Assigns a task record to a user and optionally an assignment group.
86
+ */
87
+ export function registerAssignTaskTool(server) {
88
+ server.registerTool("assign_task", {
89
+ title: "Assign Task",
90
+ description: "Assign a task record to a user and optionally an assignment group. " +
91
+ "Works on any task-based table (incident, change_request, problem, sc_task, etc.).",
92
+ inputSchema: {
93
+ instance: z.string().optional().describe(INSTANCE_DESC),
94
+ table: z
95
+ .string()
96
+ .describe('The table name of the task record (e.g., "incident", "change_request", "sc_task").'),
97
+ record_sys_id: z
98
+ .string()
99
+ .describe("The sys_id of the task record to assign."),
100
+ assigned_to: z
101
+ .string()
102
+ .describe("The sys_id or user_name of the user to assign the task to."),
103
+ assignment_group: z
104
+ .string()
105
+ .optional()
106
+ .describe("The sys_id of the assignment group. Optional — if provided, the record's " +
107
+ "assignment_group field is also updated."),
108
+ },
109
+ }, async ({ instance, table, record_sys_id, assigned_to, assignment_group }) => {
110
+ try {
111
+ const result = await withConnectionRetry(instance, async (snInstance) => {
112
+ const ops = new TaskOperations(snInstance);
113
+ return await ops.assignTask({
114
+ table,
115
+ recordSysId: record_sys_id,
116
+ assignedTo: assigned_to,
117
+ assignmentGroup: assignment_group,
118
+ });
119
+ });
120
+ const number = result.number ? ` (${result.number})` : "";
121
+ return {
122
+ content: [
123
+ {
124
+ type: "text",
125
+ text: `Task ${table}/${result.sys_id}${number} assigned successfully to ${assigned_to}.`,
126
+ },
127
+ ],
128
+ };
129
+ }
130
+ catch (error) {
131
+ const message = error instanceof Error ? error.message : String(error);
132
+ return {
133
+ content: [
134
+ {
135
+ type: "text",
136
+ text: `Error assigning task: ${message}`,
137
+ },
138
+ ],
139
+ isError: true,
140
+ };
141
+ }
142
+ });
143
+ }
144
+ // ============================================================
145
+ // 3. resolve_incident
146
+ // ============================================================
147
+ /**
148
+ * Registers the resolve_incident tool on the MCP server.
149
+ *
150
+ * Resolves an incident by setting state to Resolved (6) with resolution notes.
151
+ */
152
+ export function registerResolveIncidentTool(server) {
153
+ server.registerTool("resolve_incident", {
154
+ title: "Resolve Incident",
155
+ description: "Resolve an incident by setting state to Resolved (6) with resolution notes. " +
156
+ "IMPORTANT: This changes the incident state. The incident must typically be in " +
157
+ "an active state (New, In Progress, On Hold) for this to succeed.",
158
+ inputSchema: {
159
+ instance: z.string().optional().describe(INSTANCE_DESC),
160
+ sys_id: z
161
+ .string()
162
+ .describe("The sys_id of the incident to resolve."),
163
+ resolution_notes: z
164
+ .string()
165
+ .describe("Notes describing how the incident was resolved. These become the close_notes on the record."),
166
+ close_code: z
167
+ .string()
168
+ .optional()
169
+ .describe('The close code for the resolution (e.g., "Solved (Permanently)", ' +
170
+ '"Solved (Work Around)", "Not Solved (Not Reproducible)").'),
171
+ },
172
+ }, async ({ instance, sys_id, resolution_notes, close_code }) => {
173
+ try {
174
+ const result = await withConnectionRetry(instance, async (snInstance) => {
175
+ const ops = new TaskOperations(snInstance);
176
+ return await ops.resolveIncident({
177
+ sysId: sys_id,
178
+ resolutionNotes: resolution_notes,
179
+ closeCode: close_code,
180
+ });
181
+ });
182
+ const number = result.number ? ` ${result.number}` : "";
183
+ const state = result.state ?? "6";
184
+ return {
185
+ content: [
186
+ {
187
+ type: "text",
188
+ text: `Incident${number} (${result.sys_id}) resolved successfully. State: ${state}.`,
189
+ },
190
+ ],
191
+ };
192
+ }
193
+ catch (error) {
194
+ const message = error instanceof Error ? error.message : String(error);
195
+ return {
196
+ content: [
197
+ {
198
+ type: "text",
199
+ text: `Error resolving incident: ${message}`,
200
+ },
201
+ ],
202
+ isError: true,
203
+ };
204
+ }
205
+ });
206
+ }
207
+ // ============================================================
208
+ // 4. close_incident
209
+ // ============================================================
210
+ /**
211
+ * Registers the close_incident tool on the MCP server.
212
+ *
213
+ * Closes an incident by setting state to Closed (7).
214
+ */
215
+ export function registerCloseIncidentTool(server) {
216
+ server.registerTool("close_incident", {
217
+ title: "Close Incident",
218
+ description: "Close an incident by setting state to Closed (7). " +
219
+ "IMPORTANT: This changes the incident state. The incident should typically be " +
220
+ "in Resolved state before closing, though this depends on instance configuration.",
221
+ inputSchema: {
222
+ instance: z.string().optional().describe(INSTANCE_DESC),
223
+ sys_id: z
224
+ .string()
225
+ .describe("The sys_id of the incident to close."),
226
+ close_notes: z
227
+ .string()
228
+ .describe("Notes describing why the incident is being closed."),
229
+ close_code: z
230
+ .string()
231
+ .optional()
232
+ .describe('The close code for the closure (e.g., "Solved (Permanently)", ' +
233
+ '"Solved (Work Around)", "Closed/Resolved by Caller").'),
234
+ },
235
+ }, async ({ instance, sys_id, close_notes, close_code }) => {
236
+ try {
237
+ const result = await withConnectionRetry(instance, async (snInstance) => {
238
+ const ops = new TaskOperations(snInstance);
239
+ return await ops.closeIncident({
240
+ sysId: sys_id,
241
+ closeNotes: close_notes,
242
+ closeCode: close_code,
243
+ });
244
+ });
245
+ const number = result.number ? ` ${result.number}` : "";
246
+ const state = result.state ?? "7";
247
+ return {
248
+ content: [
249
+ {
250
+ type: "text",
251
+ text: `Incident${number} (${result.sys_id}) closed successfully. State: ${state}.`,
252
+ },
253
+ ],
254
+ };
255
+ }
256
+ catch (error) {
257
+ const message = error instanceof Error ? error.message : String(error);
258
+ return {
259
+ content: [
260
+ {
261
+ type: "text",
262
+ text: `Error closing incident: ${message}`,
263
+ },
264
+ ],
265
+ isError: true,
266
+ };
267
+ }
268
+ });
269
+ }
270
+ // ============================================================
271
+ // 5. approve_change
272
+ // ============================================================
273
+ /**
274
+ * Registers the approve_change tool on the MCP server.
275
+ *
276
+ * Approves a change request with optional comments.
277
+ */
278
+ export function registerApproveChangeTool(server) {
279
+ server.registerTool("approve_change", {
280
+ title: "Approve Change Request",
281
+ description: "Approve a change request with optional comments. Sets the approval field to " +
282
+ "'approved'. IMPORTANT: This changes the change request's approval status.",
283
+ inputSchema: {
284
+ instance: z.string().optional().describe(INSTANCE_DESC),
285
+ sys_id: z
286
+ .string()
287
+ .describe("The sys_id of the change request to approve."),
288
+ comments: z
289
+ .string()
290
+ .optional()
291
+ .describe("Optional comments to include with the approval."),
292
+ },
293
+ }, async ({ instance, sys_id, comments }) => {
294
+ try {
295
+ const result = await withConnectionRetry(instance, async (snInstance) => {
296
+ const ops = new TaskOperations(snInstance);
297
+ return await ops.approveChange({
298
+ sysId: sys_id,
299
+ comments,
300
+ });
301
+ });
302
+ const number = result.number ? ` ${result.number}` : "";
303
+ const approval = result.approval ?? "approved";
304
+ return {
305
+ content: [
306
+ {
307
+ type: "text",
308
+ text: `Change request${number} (${result.sys_id}) approved successfully. Approval: ${approval}.`,
309
+ },
310
+ ],
311
+ };
312
+ }
313
+ catch (error) {
314
+ const message = error instanceof Error ? error.message : String(error);
315
+ return {
316
+ content: [
317
+ {
318
+ type: "text",
319
+ text: `Error approving change request: ${message}`,
320
+ },
321
+ ],
322
+ isError: true,
323
+ };
324
+ }
325
+ });
326
+ }
327
+ // ============================================================
328
+ // 6. find_task
329
+ // ============================================================
330
+ /**
331
+ * Registers the find_task tool on the MCP server.
332
+ *
333
+ * Finds a task record by its number (e.g., "INC0010001", "CHG0030002").
334
+ */
335
+ export function registerFindTaskTool(server) {
336
+ server.registerTool("find_task", {
337
+ title: "Find Task by Number",
338
+ description: "Find a task record by its number (e.g., \"INC0010001\", \"CHG0030002\"). " +
339
+ "Returns the full record if found, or a clear message if not. " +
340
+ "Use this to look up sys_ids, check current state, or retrieve task details " +
341
+ "before performing actions like assigning or resolving.",
342
+ inputSchema: {
343
+ instance: z.string().optional().describe(INSTANCE_DESC),
344
+ table: z
345
+ .string()
346
+ .describe('The table name to search in (e.g., "incident", "change_request", "problem", "sc_task").'),
347
+ number: z
348
+ .string()
349
+ .describe('The task number to find (e.g., "INC0010001", "CHG0030002", "PRB0040001").'),
350
+ },
351
+ }, async ({ instance, table, number }) => {
352
+ try {
353
+ const result = await withConnectionRetry(instance, async (snInstance) => {
354
+ const ops = new TaskOperations(snInstance);
355
+ return await ops.findByNumber(table, number);
356
+ });
357
+ if (!result) {
358
+ return {
359
+ content: [
360
+ {
361
+ type: "text",
362
+ text: `No record found in ${table} with number "${number}".`,
363
+ },
364
+ ],
365
+ };
366
+ }
367
+ return {
368
+ content: [
369
+ {
370
+ type: "text",
371
+ text: JSON.stringify(result, null, 2),
372
+ },
373
+ ],
374
+ };
375
+ }
376
+ catch (error) {
377
+ const message = error instanceof Error ? error.message : String(error);
378
+ return {
379
+ content: [
380
+ {
381
+ type: "text",
382
+ text: `Error finding task: ${message}`,
383
+ },
384
+ ],
385
+ isError: true,
386
+ };
387
+ }
388
+ });
389
+ }
390
+ //# sourceMappingURL=task.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/tools/task.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC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AI;yBAC7D;qBACF;iBACF,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,OAAO,GACX,KAAK,YAAY,KAAK,CAAC,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,46 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ /**
3
+ * Registers the get_current_update_set tool on the MCP server.
4
+ *
5
+ * This tool retrieves the currently active update set for the session.
6
+ */
7
+ export declare function registerGetCurrentUpdateSetTool(server: McpServer): void;
8
+ /**
9
+ * Registers the list_update_sets tool on the MCP server.
10
+ *
11
+ * This tool lists update sets on the instance with optional filtering.
12
+ */
13
+ export declare function registerListUpdateSetsTool(server: McpServer): void;
14
+ /**
15
+ * Registers the create_update_set tool on the MCP server.
16
+ *
17
+ * This tool creates a new update set on the ServiceNow instance.
18
+ */
19
+ export declare function registerCreateUpdateSetTool(server: McpServer): void;
20
+ /**
21
+ * Registers the set_current_update_set tool on the MCP server.
22
+ *
23
+ * This tool sets the active update set for the session. All subsequent
24
+ * changes will be captured in the specified update set.
25
+ */
26
+ export declare function registerSetCurrentUpdateSetTool(server: McpServer): void;
27
+ /**
28
+ * Registers the inspect_update_set tool on the MCP server.
29
+ *
30
+ * This tool inspects an update set's contents, listing all components
31
+ * grouped by type (business rules, script includes, etc.).
32
+ */
33
+ export declare function registerInspectUpdateSetTool(server: McpServer): void;
34
+ /**
35
+ * Registers the clone_update_set tool on the MCP server.
36
+ *
37
+ * Clones an update set by creating a new update set and copying all records from the source.
38
+ */
39
+ export declare function registerCloneUpdateSetTool(server: McpServer): void;
40
+ /**
41
+ * Registers the move_update_set_records tool on the MCP server.
42
+ *
43
+ * Moves records from one update set to another.
44
+ */
45
+ export declare function registerMoveUpdateSetRecordsTool(server: McpServer): void;
46
+ //# sourceMappingURL=updateset.d.ts.map