it-tools-mcp 3.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/LICENSE +21 -0
- package/README.dockerhub.md +98 -0
- package/README.md +263 -0
- package/build/index.js +75 -0
- package/build/security.js +201 -0
- package/build/tools/color.js +67 -0
- package/build/tools/crypto.js +445 -0
- package/build/tools/dataFormat.js +517 -0
- package/build/tools/development.js +267 -0
- package/build/tools/encoding.js +240 -0
- package/build/tools/idGenerators.js +176 -0
- package/build/tools/math.js +306 -0
- package/build/tools/network.js +578 -0
- package/build/tools/text.js +678 -0
- package/build/tools/utility.js +407 -0
- package/package.json +94 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
import * as toml from "@iarna/toml";
|
|
2
|
+
import * as YAML from "js-yaml";
|
|
3
|
+
import Papa from "papaparse";
|
|
4
|
+
import { format as formatSQL } from "sql-formatter";
|
|
5
|
+
import formatXML from "xml-formatter";
|
|
6
|
+
import { marked } from "marked";
|
|
7
|
+
import TurndownService from "turndown";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
export function registerDataFormatTools(server) {
|
|
10
|
+
// JSON formatting tool
|
|
11
|
+
server.tool("json-format", "Format and validate JSON", {
|
|
12
|
+
json: z.string().describe("JSON string to format"),
|
|
13
|
+
indent: z.number().describe("Number of spaces for indentation").optional(),
|
|
14
|
+
}, async ({ json, indent = 2 }) => {
|
|
15
|
+
try {
|
|
16
|
+
if (indent < 0 || indent > 10) {
|
|
17
|
+
return {
|
|
18
|
+
content: [
|
|
19
|
+
{
|
|
20
|
+
type: "text",
|
|
21
|
+
text: "Indent must be between 0 and 10.",
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
// Try to normalize JavaScript-style object notation to valid JSON
|
|
27
|
+
let normalizedJson = json.trim();
|
|
28
|
+
// Handle single quotes by converting to double quotes
|
|
29
|
+
// This is a simplified approach that works for most common cases
|
|
30
|
+
try {
|
|
31
|
+
// First try parsing as-is
|
|
32
|
+
const parsed = JSON.parse(normalizedJson);
|
|
33
|
+
const formatted = JSON.stringify(parsed, null, indent);
|
|
34
|
+
return {
|
|
35
|
+
content: [
|
|
36
|
+
{
|
|
37
|
+
type: "text",
|
|
38
|
+
text: `Formatted JSON:\n${formatted}`,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (firstError) {
|
|
44
|
+
// If parsing fails, try to normalize the format
|
|
45
|
+
try {
|
|
46
|
+
// Convert single quotes to double quotes for property names and string values
|
|
47
|
+
// This handles simple cases like {'name':'John','age':30}
|
|
48
|
+
normalizedJson = normalizedJson
|
|
49
|
+
.replace(/'/g, '"') // Replace single quotes with double quotes
|
|
50
|
+
.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)\s*:/g, '$1"$2":'); // Quote unquoted property names
|
|
51
|
+
const parsed = JSON.parse(normalizedJson);
|
|
52
|
+
const formatted = JSON.stringify(parsed, null, indent);
|
|
53
|
+
return {
|
|
54
|
+
content: [
|
|
55
|
+
{
|
|
56
|
+
type: "text",
|
|
57
|
+
text: `Formatted JSON (normalized from JavaScript object notation):\n${formatted}`,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
catch (secondError) {
|
|
63
|
+
// If normalization fails, try using Function constructor for JavaScript object literals
|
|
64
|
+
try {
|
|
65
|
+
const evaluated = new Function('return ' + json)();
|
|
66
|
+
const formatted = JSON.stringify(evaluated, null, indent);
|
|
67
|
+
return {
|
|
68
|
+
content: [
|
|
69
|
+
{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: `Formatted JSON (converted from JavaScript object):\n${formatted}`,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (evalError) {
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: `Error parsing JSON: ${firstError instanceof Error ? firstError.message : 'Unknown error'}
|
|
82
|
+
|
|
83
|
+
Tried to normalize JavaScript object notation but failed.
|
|
84
|
+
Please ensure your input is valid JSON or JavaScript object notation.
|
|
85
|
+
|
|
86
|
+
Examples of supported formats:
|
|
87
|
+
- Valid JSON: {"name":"John","age":30}
|
|
88
|
+
- JavaScript object: {'name':'John','age':30}
|
|
89
|
+
- Unquoted keys: {name:'John',age:30}`,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
return {
|
|
99
|
+
content: [
|
|
100
|
+
{
|
|
101
|
+
type: "text",
|
|
102
|
+
text: `Error formatting JSON: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
// JSON minify tool
|
|
109
|
+
server.tool("json-minify", "Minify JSON by removing whitespace", {
|
|
110
|
+
json: z.string().describe("JSON string to minify"),
|
|
111
|
+
}, async ({ json }) => {
|
|
112
|
+
try {
|
|
113
|
+
const parsed = JSON.parse(json);
|
|
114
|
+
const minified = JSON.stringify(parsed);
|
|
115
|
+
return {
|
|
116
|
+
content: [
|
|
117
|
+
{
|
|
118
|
+
type: "text",
|
|
119
|
+
text: `Minified JSON: ${minified}`,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
return {
|
|
126
|
+
content: [
|
|
127
|
+
{
|
|
128
|
+
type: "text",
|
|
129
|
+
text: `Error parsing JSON: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
// JSON to CSV converter
|
|
136
|
+
server.tool("json-to-csv", "Convert JSON to CSV format", {
|
|
137
|
+
json: z.string().describe("JSON string to convert to CSV"),
|
|
138
|
+
delimiter: z.string().describe("CSV delimiter").optional(),
|
|
139
|
+
}, async ({ json, delimiter = "," }) => {
|
|
140
|
+
try {
|
|
141
|
+
const data = JSON.parse(json);
|
|
142
|
+
if (!Array.isArray(data)) {
|
|
143
|
+
throw new Error("JSON must be an array of objects");
|
|
144
|
+
}
|
|
145
|
+
const csv = Papa.unparse(data, { delimiter });
|
|
146
|
+
return {
|
|
147
|
+
content: [
|
|
148
|
+
{
|
|
149
|
+
type: "text",
|
|
150
|
+
text: `CSV:\n${csv}\n\nConversion Summary:\nRows: ${data.length}\nDelimiter: \"${delimiter}\"`,
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
return {
|
|
157
|
+
content: [
|
|
158
|
+
{
|
|
159
|
+
type: "text",
|
|
160
|
+
text: `Error converting JSON to CSV: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
161
|
+
},
|
|
162
|
+
],
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
// XML formatter tool
|
|
167
|
+
server.tool("xml-format", "Format and prettify XML", {
|
|
168
|
+
xml: z.string().describe("XML string to format"),
|
|
169
|
+
indent: z.number().describe("Number of spaces for indentation").optional(),
|
|
170
|
+
}, async ({ xml, indent = 2 }) => {
|
|
171
|
+
try {
|
|
172
|
+
const formatted = formatXML(xml, {
|
|
173
|
+
indentation: ' '.repeat(indent),
|
|
174
|
+
filter: (node) => node.type !== 'Comment',
|
|
175
|
+
collapseContent: true,
|
|
176
|
+
lineSeparator: '\n'
|
|
177
|
+
});
|
|
178
|
+
return {
|
|
179
|
+
content: [
|
|
180
|
+
{
|
|
181
|
+
type: "text",
|
|
182
|
+
text: `Formatted XML:
|
|
183
|
+
|
|
184
|
+
${formatted}
|
|
185
|
+
|
|
186
|
+
✅ XML formatted successfully
|
|
187
|
+
🎯 Features: ${indent}-space indentation, collapsed content, clean structure`,
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
return {
|
|
194
|
+
content: [
|
|
195
|
+
{
|
|
196
|
+
type: "text",
|
|
197
|
+
text: `Error formatting XML: ${error instanceof Error ? error.message : 'Unknown error'}
|
|
198
|
+
|
|
199
|
+
💡 Common XML issues:
|
|
200
|
+
• Check that all tags are properly closed
|
|
201
|
+
• Ensure proper nesting of elements
|
|
202
|
+
• Validate attribute syntax (key="value")
|
|
203
|
+
• Check for special character encoding`,
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
// YAML formatter tool
|
|
210
|
+
server.tool("yaml-format", "Format and prettify YAML", {
|
|
211
|
+
yaml: z.string().describe("YAML string to format"),
|
|
212
|
+
}, async ({ yaml }) => {
|
|
213
|
+
try {
|
|
214
|
+
// Parse YAML to validate and then dump with proper formatting
|
|
215
|
+
const parsed = YAML.load(yaml);
|
|
216
|
+
// Format with proper indentation and options
|
|
217
|
+
const formatted = YAML.dump(parsed, {
|
|
218
|
+
indent: 2,
|
|
219
|
+
lineWidth: 80,
|
|
220
|
+
noRefs: false,
|
|
221
|
+
noCompatMode: false,
|
|
222
|
+
condenseFlow: false,
|
|
223
|
+
quotingType: '"',
|
|
224
|
+
forceQuotes: false,
|
|
225
|
+
sortKeys: false,
|
|
226
|
+
skipInvalid: false,
|
|
227
|
+
});
|
|
228
|
+
// Count lines and detect any issues
|
|
229
|
+
const inputLines = yaml.split('\n').length;
|
|
230
|
+
const outputLines = formatted.split('\n').length;
|
|
231
|
+
return {
|
|
232
|
+
content: [
|
|
233
|
+
{
|
|
234
|
+
type: "text",
|
|
235
|
+
text: `Formatted YAML:
|
|
236
|
+
|
|
237
|
+
${formatted.trim()}
|
|
238
|
+
|
|
239
|
+
✅ YAML is valid and properly formatted
|
|
240
|
+
📊 Input: ${inputLines} lines → Output: ${outputLines} lines
|
|
241
|
+
🎯 Features: 2-space indentation, proper line width, preserved structure`,
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
return {
|
|
248
|
+
content: [
|
|
249
|
+
{
|
|
250
|
+
type: "text",
|
|
251
|
+
text: `Error formatting YAML: ${error instanceof Error ? error.message : 'Unknown error'}
|
|
252
|
+
|
|
253
|
+
💡 Common YAML issues:
|
|
254
|
+
• Check indentation (use spaces, not tabs)
|
|
255
|
+
• Ensure proper key-value syntax (key: value)
|
|
256
|
+
• Validate string quoting
|
|
257
|
+
• Check list formatting (- item)
|
|
258
|
+
• Verify nested structure alignment`,
|
|
259
|
+
},
|
|
260
|
+
],
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
// SQL formatter tool
|
|
265
|
+
server.tool("sql-format", "Format and prettify SQL queries", {
|
|
266
|
+
sql: z.string().describe("SQL query to format"),
|
|
267
|
+
}, async ({ sql }) => {
|
|
268
|
+
try {
|
|
269
|
+
const formatted = formatSQL(sql, {
|
|
270
|
+
language: 'sql',
|
|
271
|
+
tabWidth: 2,
|
|
272
|
+
useTabs: false,
|
|
273
|
+
keywordCase: 'upper',
|
|
274
|
+
identifierCase: 'lower',
|
|
275
|
+
functionCase: 'upper'
|
|
276
|
+
});
|
|
277
|
+
return {
|
|
278
|
+
content: [
|
|
279
|
+
{
|
|
280
|
+
type: "text",
|
|
281
|
+
text: `Formatted SQL:
|
|
282
|
+
|
|
283
|
+
${formatted}
|
|
284
|
+
|
|
285
|
+
✅ SQL formatted successfully
|
|
286
|
+
🎯 Features: uppercase keywords, proper indentation, clean structure`,
|
|
287
|
+
},
|
|
288
|
+
],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
return {
|
|
293
|
+
content: [
|
|
294
|
+
{
|
|
295
|
+
type: "text",
|
|
296
|
+
text: `Error formatting SQL: ${error instanceof Error ? error.message : 'Unknown error'}
|
|
297
|
+
|
|
298
|
+
💡 Common SQL issues:
|
|
299
|
+
• Check syntax for missing semicolons
|
|
300
|
+
• Ensure proper table and column names
|
|
301
|
+
• Validate string quoting (single quotes for strings)
|
|
302
|
+
• Check for balanced parentheses in subqueries`,
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
// TOML to JSON converter
|
|
309
|
+
server.tool("toml-to-json", "Convert TOML to JSON format", {
|
|
310
|
+
toml: z.string().describe("TOML string to convert"),
|
|
311
|
+
}, async ({ toml: tomlString }) => {
|
|
312
|
+
try {
|
|
313
|
+
const result = toml.parse(tomlString);
|
|
314
|
+
return {
|
|
315
|
+
content: [
|
|
316
|
+
{
|
|
317
|
+
type: "text",
|
|
318
|
+
text: `JSON result:\n${JSON.stringify(result, null, 2)}`,
|
|
319
|
+
},
|
|
320
|
+
],
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
catch (error) {
|
|
324
|
+
return {
|
|
325
|
+
content: [
|
|
326
|
+
{
|
|
327
|
+
type: "text",
|
|
328
|
+
text: `Error converting TOML to JSON: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
329
|
+
},
|
|
330
|
+
],
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
// JSON to TOML converter
|
|
335
|
+
server.tool("json-to-toml", "Convert JSON to TOML format", {
|
|
336
|
+
json: z.string().describe("JSON string to convert"),
|
|
337
|
+
}, async ({ json }) => {
|
|
338
|
+
try {
|
|
339
|
+
const data = JSON.parse(json);
|
|
340
|
+
const tomlResult = toml.stringify(data);
|
|
341
|
+
return {
|
|
342
|
+
content: [
|
|
343
|
+
{
|
|
344
|
+
type: "text",
|
|
345
|
+
text: `TOML result:\n${tomlResult}`,
|
|
346
|
+
},
|
|
347
|
+
],
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
catch (error) {
|
|
351
|
+
return {
|
|
352
|
+
content: [
|
|
353
|
+
{
|
|
354
|
+
type: "text",
|
|
355
|
+
text: `Error converting JSON to TOML: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
356
|
+
},
|
|
357
|
+
],
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
// Markdown to HTML converter (using marked library)
|
|
362
|
+
server.tool("markdown-to-html", "Convert Markdown to HTML", {
|
|
363
|
+
markdown: z.string().describe("Markdown content to convert to HTML"),
|
|
364
|
+
}, async ({ markdown }) => {
|
|
365
|
+
try {
|
|
366
|
+
// Use marked with basic configuration (marked is synchronous)
|
|
367
|
+
const html = marked(markdown, {
|
|
368
|
+
breaks: true,
|
|
369
|
+
gfm: true
|
|
370
|
+
});
|
|
371
|
+
return {
|
|
372
|
+
content: [
|
|
373
|
+
{
|
|
374
|
+
type: "text",
|
|
375
|
+
text: `HTML result:\n${html}`,
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
catch (error) {
|
|
381
|
+
return {
|
|
382
|
+
content: [
|
|
383
|
+
{
|
|
384
|
+
type: "text",
|
|
385
|
+
text: `Error converting Markdown to HTML: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
386
|
+
},
|
|
387
|
+
],
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
// HTML to Markdown converter (using turndown library)
|
|
392
|
+
server.tool("html-to-markdown", "Convert HTML to Markdown", {
|
|
393
|
+
html: z.string().describe("HTML content to convert to Markdown"),
|
|
394
|
+
}, async ({ html }) => {
|
|
395
|
+
try {
|
|
396
|
+
// Configure turndown for better output
|
|
397
|
+
const turndownService = new TurndownService({
|
|
398
|
+
headingStyle: 'atx',
|
|
399
|
+
codeBlockStyle: 'fenced',
|
|
400
|
+
bulletListMarker: '-',
|
|
401
|
+
emDelimiter: '*',
|
|
402
|
+
strongDelimiter: '**'
|
|
403
|
+
});
|
|
404
|
+
const markdown = turndownService.turndown(html);
|
|
405
|
+
return {
|
|
406
|
+
content: [
|
|
407
|
+
{
|
|
408
|
+
type: "text",
|
|
409
|
+
text: `Markdown result:\n${markdown}`,
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
return {
|
|
416
|
+
content: [
|
|
417
|
+
{
|
|
418
|
+
type: "text",
|
|
419
|
+
text: `Error converting HTML to Markdown: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
420
|
+
},
|
|
421
|
+
],
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
// JSON diff tool
|
|
426
|
+
server.tool("json-diff", "Compare two JSON objects and show differences", {
|
|
427
|
+
json1: z.string().describe("First JSON object"),
|
|
428
|
+
json2: z.string().describe("Second JSON object"),
|
|
429
|
+
}, async ({ json1, json2 }) => {
|
|
430
|
+
try {
|
|
431
|
+
const obj1 = JSON.parse(json1);
|
|
432
|
+
const obj2 = JSON.parse(json2);
|
|
433
|
+
function deepCompare(a, b, path = "") {
|
|
434
|
+
const differences = [];
|
|
435
|
+
if (typeof a !== typeof b) {
|
|
436
|
+
differences.push(`${path}: Type difference - ${typeof a} vs ${typeof b}`);
|
|
437
|
+
return differences;
|
|
438
|
+
}
|
|
439
|
+
if (a === null || b === null) {
|
|
440
|
+
if (a !== b) {
|
|
441
|
+
differences.push(`${path}: ${a} vs ${b}`);
|
|
442
|
+
}
|
|
443
|
+
return differences;
|
|
444
|
+
}
|
|
445
|
+
if (typeof a === 'object' && !Array.isArray(a)) {
|
|
446
|
+
const keysA = Object.keys(a);
|
|
447
|
+
const keysB = Object.keys(b);
|
|
448
|
+
const allKeys = new Set([...keysA, ...keysB]);
|
|
449
|
+
for (const key of allKeys) {
|
|
450
|
+
const newPath = path ? `${path}.${key}` : key;
|
|
451
|
+
if (!(key in a)) {
|
|
452
|
+
differences.push(`${newPath}: Missing in first object`);
|
|
453
|
+
}
|
|
454
|
+
else if (!(key in b)) {
|
|
455
|
+
differences.push(`${newPath}: Missing in second object`);
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
differences.push(...deepCompare(a[key], b[key], newPath));
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
else if (Array.isArray(a) && Array.isArray(b)) {
|
|
463
|
+
const maxLength = Math.max(a.length, b.length);
|
|
464
|
+
for (let i = 0; i < maxLength; i++) {
|
|
465
|
+
const newPath = `${path}[${i}]`;
|
|
466
|
+
if (i >= a.length) {
|
|
467
|
+
differences.push(`${newPath}: Missing in first array`);
|
|
468
|
+
}
|
|
469
|
+
else if (i >= b.length) {
|
|
470
|
+
differences.push(`${newPath}: Missing in second array`);
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
differences.push(...deepCompare(a[i], b[i], newPath));
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
else if (a !== b) {
|
|
478
|
+
differences.push(`${path}: ${JSON.stringify(a)} vs ${JSON.stringify(b)}`);
|
|
479
|
+
}
|
|
480
|
+
return differences;
|
|
481
|
+
}
|
|
482
|
+
const differences = deepCompare(obj1, obj2);
|
|
483
|
+
if (differences.length === 0) {
|
|
484
|
+
return {
|
|
485
|
+
content: [
|
|
486
|
+
{
|
|
487
|
+
type: "text",
|
|
488
|
+
text: "✅ JSON objects are identical - no differences found.",
|
|
489
|
+
},
|
|
490
|
+
],
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
return {
|
|
495
|
+
content: [
|
|
496
|
+
{
|
|
497
|
+
type: "text",
|
|
498
|
+
text: `❌ Found ${differences.length} difference(s):
|
|
499
|
+
|
|
500
|
+
${differences.map((diff, i) => `${i + 1}. ${diff}`).join('\n')}`,
|
|
501
|
+
},
|
|
502
|
+
],
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
catch (error) {
|
|
507
|
+
return {
|
|
508
|
+
content: [
|
|
509
|
+
{
|
|
510
|
+
type: "text",
|
|
511
|
+
text: `Error comparing JSON: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
512
|
+
},
|
|
513
|
+
],
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
});
|
|
517
|
+
}
|