@mgsoftwarebv/mg-dashboard-mcp 6.0.1 → 6.0.2
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/index.js +31 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3522,6 +3522,28 @@ function formatDnsDiff(domain, before, after, change) {
|
|
|
3522
3522
|
lines.push("", "Re-run without `dryRun: true` to apply.");
|
|
3523
3523
|
return lines.join("\n");
|
|
3524
3524
|
}
|
|
3525
|
+
function describeDnsCandidates(records, type, name, attemptedValue) {
|
|
3526
|
+
const sameTypeAndName = records.filter((r) => r.type === type && r.name === name);
|
|
3527
|
+
const fmt = (r) => ` - ${r.type.padEnd(6)} ${r.name.padEnd(30)} ttl=${String(r.ttl).padEnd(5)} ${r.value}`;
|
|
3528
|
+
if (sameTypeAndName.length > 0) {
|
|
3529
|
+
const lines = ["Current records with this type + name (use one of these values verbatim):"];
|
|
3530
|
+
for (const r of sameTypeAndName.slice(0, 10)) lines.push(fmt(r));
|
|
3531
|
+
if (sameTypeAndName.length > 10) lines.push(` ...and ${sameTypeAndName.length - 10} more`);
|
|
3532
|
+
lines.push(`(attempted value: ${attemptedValue})`);
|
|
3533
|
+
return lines.join("\n");
|
|
3534
|
+
}
|
|
3535
|
+
const sameName = records.filter((r) => r.name === name);
|
|
3536
|
+
if (sameName.length > 0) {
|
|
3537
|
+
const types = [...new Set(sameName.map((r) => r.type))].sort().join(", ");
|
|
3538
|
+
const lines = [
|
|
3539
|
+
`No ${type} records exist for "${name}", but other records do (types: ${types}). Sample:`
|
|
3540
|
+
];
|
|
3541
|
+
for (const r of sameName.slice(0, 10)) lines.push(fmt(r));
|
|
3542
|
+
if (sameName.length > 10) lines.push(` ...and ${sameName.length - 10} more`);
|
|
3543
|
+
return lines.join("\n");
|
|
3544
|
+
}
|
|
3545
|
+
return `No records found at all for name "${name}". Run dns-list to inspect the zone.`;
|
|
3546
|
+
}
|
|
3525
3547
|
async function mijnhostFetch(path, options = {}) {
|
|
3526
3548
|
const key = requireMijnhostApiKey();
|
|
3527
3549
|
const res = await fetch(`${MIJNHOST_BASE_URL}${path}`, {
|
|
@@ -3880,7 +3902,7 @@ var TOOLS = [
|
|
|
3880
3902
|
// ----- Vercel -----
|
|
3881
3903
|
...VERCEL_TOOLS
|
|
3882
3904
|
];
|
|
3883
|
-
var MCP_VERSION = "6.0.
|
|
3905
|
+
var MCP_VERSION = "6.0.2";
|
|
3884
3906
|
async function handleListTools() {
|
|
3885
3907
|
if (!authContext) return { tools: TOOLS };
|
|
3886
3908
|
const accessible = TOOLS.filter((tool) => {
|
|
@@ -5227,7 +5249,10 @@ ${lines.join("\n")}` }] };
|
|
|
5227
5249
|
(r) => r.type === type && r.name === dnsName && r.value === oldValue
|
|
5228
5250
|
);
|
|
5229
5251
|
if (idx === -1) {
|
|
5230
|
-
throw new Error(
|
|
5252
|
+
throw new Error(
|
|
5253
|
+
`No matching DNS record found: ${type} ${dnsName} = ${oldValue}
|
|
5254
|
+
` + describeDnsCandidates(current.data.records, type, dnsName, oldValue)
|
|
5255
|
+
);
|
|
5231
5256
|
}
|
|
5232
5257
|
const updated = [...current.data.records];
|
|
5233
5258
|
const before = updated[idx];
|
|
@@ -5251,7 +5276,10 @@ ${lines.join("\n")}` }] };
|
|
|
5251
5276
|
(r) => !(r.type === type && r.name === dnsName && r.value === value)
|
|
5252
5277
|
);
|
|
5253
5278
|
if (removed.length === 0) {
|
|
5254
|
-
throw new Error(
|
|
5279
|
+
throw new Error(
|
|
5280
|
+
`No matching DNS record found: ${type} ${dnsName} = ${value}
|
|
5281
|
+
` + describeDnsCandidates(current.data.records, type, dnsName, value)
|
|
5282
|
+
);
|
|
5255
5283
|
}
|
|
5256
5284
|
nextRecords = remaining;
|
|
5257
5285
|
diffArgs = { verb: "delete", removed };
|