@kentico/management-api-mcp 31.4.3-preview → 31.5.0-preview

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 (2) hide show
  1. package/dist/index.js +442 -32
  2. package/package.json +4 -3
package/dist/index.js CHANGED
@@ -5,10 +5,16 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
8
14
  var __esm = (fn, res) => function __init() {
9
15
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
16
  };
11
- var __commonJS = (cb, mod) => function __require() {
17
+ var __commonJS = (cb, mod) => function __require2() {
12
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
13
19
  };
14
20
  var __export = (target, all) => {
@@ -1708,6 +1714,357 @@ var init_sqids = __esm({
1708
1714
  }
1709
1715
  });
1710
1716
 
1717
+ // node_modules/pluralize/pluralize.js
1718
+ var require_pluralize = __commonJS({
1719
+ "node_modules/pluralize/pluralize.js"(exports, module) {
1720
+ (function(root, pluralize2) {
1721
+ if (typeof __require === "function" && typeof exports === "object" && typeof module === "object") {
1722
+ module.exports = pluralize2();
1723
+ } else if (typeof define === "function" && define.amd) {
1724
+ define(function() {
1725
+ return pluralize2();
1726
+ });
1727
+ } else {
1728
+ root.pluralize = pluralize2();
1729
+ }
1730
+ })(exports, function() {
1731
+ var pluralRules = [];
1732
+ var singularRules = [];
1733
+ var uncountables = {};
1734
+ var irregularPlurals = {};
1735
+ var irregularSingles = {};
1736
+ function sanitizeRule(rule) {
1737
+ if (typeof rule === "string") {
1738
+ return new RegExp("^" + rule + "$", "i");
1739
+ }
1740
+ return rule;
1741
+ }
1742
+ function restoreCase(word, token) {
1743
+ if (word === token) return token;
1744
+ if (word === word.toLowerCase()) return token.toLowerCase();
1745
+ if (word === word.toUpperCase()) return token.toUpperCase();
1746
+ if (word[0] === word[0].toUpperCase()) {
1747
+ return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase();
1748
+ }
1749
+ return token.toLowerCase();
1750
+ }
1751
+ function interpolate(str, args) {
1752
+ return str.replace(/\$(\d{1,2})/g, function(match, index) {
1753
+ return args[index] || "";
1754
+ });
1755
+ }
1756
+ function replace(word, rule) {
1757
+ return word.replace(rule[0], function(match, index) {
1758
+ var result = interpolate(rule[1], arguments);
1759
+ if (match === "") {
1760
+ return restoreCase(word[index - 1], result);
1761
+ }
1762
+ return restoreCase(match, result);
1763
+ });
1764
+ }
1765
+ function sanitizeWord(token, word, rules) {
1766
+ if (!token.length || uncountables.hasOwnProperty(token)) {
1767
+ return word;
1768
+ }
1769
+ var len = rules.length;
1770
+ while (len--) {
1771
+ var rule = rules[len];
1772
+ if (rule[0].test(word)) return replace(word, rule);
1773
+ }
1774
+ return word;
1775
+ }
1776
+ function replaceWord(replaceMap, keepMap, rules) {
1777
+ return function(word) {
1778
+ var token = word.toLowerCase();
1779
+ if (keepMap.hasOwnProperty(token)) {
1780
+ return restoreCase(word, token);
1781
+ }
1782
+ if (replaceMap.hasOwnProperty(token)) {
1783
+ return restoreCase(word, replaceMap[token]);
1784
+ }
1785
+ return sanitizeWord(token, word, rules);
1786
+ };
1787
+ }
1788
+ function checkWord(replaceMap, keepMap, rules, bool) {
1789
+ return function(word) {
1790
+ var token = word.toLowerCase();
1791
+ if (keepMap.hasOwnProperty(token)) return true;
1792
+ if (replaceMap.hasOwnProperty(token)) return false;
1793
+ return sanitizeWord(token, token, rules) === token;
1794
+ };
1795
+ }
1796
+ function pluralize2(word, count, inclusive) {
1797
+ var pluralized = count === 1 ? pluralize2.singular(word) : pluralize2.plural(word);
1798
+ return (inclusive ? count + " " : "") + pluralized;
1799
+ }
1800
+ pluralize2.plural = replaceWord(
1801
+ irregularSingles,
1802
+ irregularPlurals,
1803
+ pluralRules
1804
+ );
1805
+ pluralize2.isPlural = checkWord(
1806
+ irregularSingles,
1807
+ irregularPlurals,
1808
+ pluralRules
1809
+ );
1810
+ pluralize2.singular = replaceWord(
1811
+ irregularPlurals,
1812
+ irregularSingles,
1813
+ singularRules
1814
+ );
1815
+ pluralize2.isSingular = checkWord(
1816
+ irregularPlurals,
1817
+ irregularSingles,
1818
+ singularRules
1819
+ );
1820
+ pluralize2.addPluralRule = function(rule, replacement) {
1821
+ pluralRules.push([sanitizeRule(rule), replacement]);
1822
+ };
1823
+ pluralize2.addSingularRule = function(rule, replacement) {
1824
+ singularRules.push([sanitizeRule(rule), replacement]);
1825
+ };
1826
+ pluralize2.addUncountableRule = function(word) {
1827
+ if (typeof word === "string") {
1828
+ uncountables[word.toLowerCase()] = true;
1829
+ return;
1830
+ }
1831
+ pluralize2.addPluralRule(word, "$0");
1832
+ pluralize2.addSingularRule(word, "$0");
1833
+ };
1834
+ pluralize2.addIrregularRule = function(single, plural) {
1835
+ plural = plural.toLowerCase();
1836
+ single = single.toLowerCase();
1837
+ irregularSingles[single] = plural;
1838
+ irregularPlurals[plural] = single;
1839
+ };
1840
+ [
1841
+ // Pronouns.
1842
+ ["I", "we"],
1843
+ ["me", "us"],
1844
+ ["he", "they"],
1845
+ ["she", "they"],
1846
+ ["them", "them"],
1847
+ ["myself", "ourselves"],
1848
+ ["yourself", "yourselves"],
1849
+ ["itself", "themselves"],
1850
+ ["herself", "themselves"],
1851
+ ["himself", "themselves"],
1852
+ ["themself", "themselves"],
1853
+ ["is", "are"],
1854
+ ["was", "were"],
1855
+ ["has", "have"],
1856
+ ["this", "these"],
1857
+ ["that", "those"],
1858
+ // Words ending in with a consonant and `o`.
1859
+ ["echo", "echoes"],
1860
+ ["dingo", "dingoes"],
1861
+ ["volcano", "volcanoes"],
1862
+ ["tornado", "tornadoes"],
1863
+ ["torpedo", "torpedoes"],
1864
+ // Ends with `us`.
1865
+ ["genus", "genera"],
1866
+ ["viscus", "viscera"],
1867
+ // Ends with `ma`.
1868
+ ["stigma", "stigmata"],
1869
+ ["stoma", "stomata"],
1870
+ ["dogma", "dogmata"],
1871
+ ["lemma", "lemmata"],
1872
+ ["schema", "schemata"],
1873
+ ["anathema", "anathemata"],
1874
+ // Other irregular rules.
1875
+ ["ox", "oxen"],
1876
+ ["axe", "axes"],
1877
+ ["die", "dice"],
1878
+ ["yes", "yeses"],
1879
+ ["foot", "feet"],
1880
+ ["eave", "eaves"],
1881
+ ["goose", "geese"],
1882
+ ["tooth", "teeth"],
1883
+ ["quiz", "quizzes"],
1884
+ ["human", "humans"],
1885
+ ["proof", "proofs"],
1886
+ ["carve", "carves"],
1887
+ ["valve", "valves"],
1888
+ ["looey", "looies"],
1889
+ ["thief", "thieves"],
1890
+ ["groove", "grooves"],
1891
+ ["pickaxe", "pickaxes"],
1892
+ ["passerby", "passersby"]
1893
+ ].forEach(function(rule) {
1894
+ return pluralize2.addIrregularRule(rule[0], rule[1]);
1895
+ });
1896
+ [
1897
+ [/s?$/i, "s"],
1898
+ [/[^\u0000-\u007F]$/i, "$0"],
1899
+ [/([^aeiou]ese)$/i, "$1"],
1900
+ [/(ax|test)is$/i, "$1es"],
1901
+ [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"],
1902
+ [/(e[mn]u)s?$/i, "$1s"],
1903
+ [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"],
1904
+ [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"],
1905
+ [/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"],
1906
+ [/(seraph|cherub)(?:im)?$/i, "$1im"],
1907
+ [/(her|at|gr)o$/i, "$1oes"],
1908
+ [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"],
1909
+ [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"],
1910
+ [/sis$/i, "ses"],
1911
+ [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"],
1912
+ [/([^aeiouy]|qu)y$/i, "$1ies"],
1913
+ [/([^ch][ieo][ln])ey$/i, "$1ies"],
1914
+ [/(x|ch|ss|sh|zz)$/i, "$1es"],
1915
+ [/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i, "$1ices"],
1916
+ [/\b((?:tit)?m|l)(?:ice|ouse)$/i, "$1ice"],
1917
+ [/(pe)(?:rson|ople)$/i, "$1ople"],
1918
+ [/(child)(?:ren)?$/i, "$1ren"],
1919
+ [/eaux$/i, "$0"],
1920
+ [/m[ae]n$/i, "men"],
1921
+ ["thou", "you"]
1922
+ ].forEach(function(rule) {
1923
+ return pluralize2.addPluralRule(rule[0], rule[1]);
1924
+ });
1925
+ [
1926
+ [/s$/i, ""],
1927
+ [/(ss)$/i, "$1"],
1928
+ [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"],
1929
+ [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"],
1930
+ [/ies$/i, "y"],
1931
+ [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"],
1932
+ [/\b(mon|smil)ies$/i, "$1ey"],
1933
+ [/\b((?:tit)?m|l)ice$/i, "$1ouse"],
1934
+ [/(seraph|cherub)im$/i, "$1"],
1935
+ [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i, "$1"],
1936
+ [/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i, "$1sis"],
1937
+ [/(movie|twelve|abuse|e[mn]u)s$/i, "$1"],
1938
+ [/(test)(?:is|es)$/i, "$1is"],
1939
+ [/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"],
1940
+ [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"],
1941
+ [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"],
1942
+ [/(alumn|alg|vertebr)ae$/i, "$1a"],
1943
+ [/(cod|mur|sil|vert|ind)ices$/i, "$1ex"],
1944
+ [/(matr|append)ices$/i, "$1ix"],
1945
+ [/(pe)(rson|ople)$/i, "$1rson"],
1946
+ [/(child)ren$/i, "$1"],
1947
+ [/(eau)x?$/i, "$1"],
1948
+ [/men$/i, "man"]
1949
+ ].forEach(function(rule) {
1950
+ return pluralize2.addSingularRule(rule[0], rule[1]);
1951
+ });
1952
+ [
1953
+ // Singular words with no plurals.
1954
+ "adulthood",
1955
+ "advice",
1956
+ "agenda",
1957
+ "aid",
1958
+ "aircraft",
1959
+ "alcohol",
1960
+ "ammo",
1961
+ "analytics",
1962
+ "anime",
1963
+ "athletics",
1964
+ "audio",
1965
+ "bison",
1966
+ "blood",
1967
+ "bream",
1968
+ "buffalo",
1969
+ "butter",
1970
+ "carp",
1971
+ "cash",
1972
+ "chassis",
1973
+ "chess",
1974
+ "clothing",
1975
+ "cod",
1976
+ "commerce",
1977
+ "cooperation",
1978
+ "corps",
1979
+ "debris",
1980
+ "diabetes",
1981
+ "digestion",
1982
+ "elk",
1983
+ "energy",
1984
+ "equipment",
1985
+ "excretion",
1986
+ "expertise",
1987
+ "firmware",
1988
+ "flounder",
1989
+ "fun",
1990
+ "gallows",
1991
+ "garbage",
1992
+ "graffiti",
1993
+ "hardware",
1994
+ "headquarters",
1995
+ "health",
1996
+ "herpes",
1997
+ "highjinks",
1998
+ "homework",
1999
+ "housework",
2000
+ "information",
2001
+ "jeans",
2002
+ "justice",
2003
+ "kudos",
2004
+ "labour",
2005
+ "literature",
2006
+ "machinery",
2007
+ "mackerel",
2008
+ "mail",
2009
+ "media",
2010
+ "mews",
2011
+ "moose",
2012
+ "music",
2013
+ "mud",
2014
+ "manga",
2015
+ "news",
2016
+ "only",
2017
+ "personnel",
2018
+ "pike",
2019
+ "plankton",
2020
+ "pliers",
2021
+ "police",
2022
+ "pollution",
2023
+ "premises",
2024
+ "rain",
2025
+ "research",
2026
+ "rice",
2027
+ "salmon",
2028
+ "scissors",
2029
+ "series",
2030
+ "sewage",
2031
+ "shambles",
2032
+ "shrimp",
2033
+ "software",
2034
+ "species",
2035
+ "staff",
2036
+ "swine",
2037
+ "tennis",
2038
+ "traffic",
2039
+ "transportation",
2040
+ "trout",
2041
+ "tuna",
2042
+ "wealth",
2043
+ "welfare",
2044
+ "whiting",
2045
+ "wildebeest",
2046
+ "wildlife",
2047
+ "you",
2048
+ /pok[eé]mon$/i,
2049
+ // Regexes.
2050
+ /[^aeiou]ese$/i,
2051
+ // "chinese", "japanese"
2052
+ /deer$/i,
2053
+ // "deer", "reindeer"
2054
+ /fish$/i,
2055
+ // "fish", "blowfish", "angelfish"
2056
+ /measles$/i,
2057
+ /o[iu]s$/i,
2058
+ // "carnivorous"
2059
+ /pox$/i,
2060
+ // "chickpox", "smallpox"
2061
+ /sheep$/i
2062
+ ].forEach(pluralize2.addUncountableRule);
2063
+ return pluralize2;
2064
+ });
2065
+ }
2066
+ });
2067
+
1711
2068
  // node_modules/@tmcp/transport-stdio/src/index.js
1712
2069
  import process2 from "node:process";
1713
2070
  var StdioTransport = class {
@@ -2345,8 +2702,15 @@ var UriTemplateMatcher = class {
2345
2702
 
2346
2703
  // node_modules/valibot/dist/index.mjs
2347
2704
  var store$4;
2705
+ var DEFAULT_CONFIG = {
2706
+ lang: void 0,
2707
+ message: void 0,
2708
+ abortEarly: void 0,
2709
+ abortPipeEarly: void 0
2710
+ };
2348
2711
  // @__NO_SIDE_EFFECTS__
2349
2712
  function getGlobalConfig(config$1) {
2713
+ if (!config$1 && !store$4) return DEFAULT_CONFIG;
2350
2714
  return {
2351
2715
  lang: config$1?.lang ?? store$4?.lang,
2352
2716
  message: config$1?.message,
@@ -2402,19 +2766,25 @@ function _addIssue(context, label, dataset, config$1, other) {
2402
2766
  if (dataset.issues) dataset.issues.push(issue2);
2403
2767
  else dataset.issues = [issue2];
2404
2768
  }
2769
+ var _standardCache = /* @__PURE__ */ new WeakMap();
2405
2770
  // @__NO_SIDE_EFFECTS__
2406
2771
  function _getStandardProps(context) {
2407
- return {
2408
- version: 1,
2409
- vendor: "valibot",
2410
- validate(value$1) {
2411
- return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
2412
- }
2413
- };
2772
+ let cached2 = _standardCache.get(context);
2773
+ if (!cached2) {
2774
+ cached2 = {
2775
+ version: 1,
2776
+ vendor: "valibot",
2777
+ validate(value$1) {
2778
+ return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
2779
+ }
2780
+ };
2781
+ _standardCache.set(context, cached2);
2782
+ }
2783
+ return cached2;
2414
2784
  }
2415
2785
  // @__NO_SIDE_EFFECTS__
2416
2786
  function _isValidObjectKey(object$1, key) {
2417
- return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
2787
+ return Object.prototype.hasOwnProperty.call(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
2418
2788
  }
2419
2789
  // @__NO_SIDE_EFFECTS__
2420
2790
  function _joinExpects(values$1, separator) {
@@ -2564,6 +2934,7 @@ function startsWith(requirement, message$1) {
2564
2934
  }
2565
2935
  };
2566
2936
  }
2937
+ var ABORT_EARLY_CONFIG = { abortEarly: true };
2567
2938
  // @__NO_SIDE_EFFECTS__
2568
2939
  function getFallback(schema, dataset, config$1) {
2569
2940
  return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
@@ -3027,7 +3398,7 @@ function string(message$1) {
3027
3398
  // @__NO_SIDE_EFFECTS__
3028
3399
  function _subIssues(datasets) {
3029
3400
  let issues;
3030
- if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues);
3401
+ if (datasets) for (const dataset of datasets) if (issues) for (const issue2 of dataset.issues) issues.push(issue2);
3031
3402
  else issues = dataset.issues;
3032
3403
  return issues;
3033
3404
  }
@@ -3119,7 +3490,7 @@ function variant(key, options, message$1) {
3119
3490
  if (currentKey in input ? discriminatorSchema["~run"]({
3120
3491
  typed: false,
3121
3492
  value: input[currentKey]
3122
- }, { abortEarly: true }).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") {
3493
+ }, ABORT_EARLY_CONFIG).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") {
3123
3494
  keysAreValid = false;
3124
3495
  if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) {
3125
3496
  maxDiscriminatorPriority = currentPriority;
@@ -5403,6 +5774,7 @@ __export(external_exports, {
5403
5774
  ZodOptional: () => ZodOptional,
5404
5775
  ZodPipe: () => ZodPipe,
5405
5776
  ZodPrefault: () => ZodPrefault,
5777
+ ZodPreprocess: () => ZodPreprocess,
5406
5778
  ZodPromise: () => ZodPromise,
5407
5779
  ZodReadonly: () => ZodReadonly,
5408
5780
  ZodRealError: () => ZodRealError,
@@ -5663,6 +6035,7 @@ __export(core_exports2, {
5663
6035
  $ZodOptional: () => $ZodOptional,
5664
6036
  $ZodPipe: () => $ZodPipe,
5665
6037
  $ZodPrefault: () => $ZodPrefault,
6038
+ $ZodPreprocess: () => $ZodPreprocess,
5666
6039
  $ZodPromise: () => $ZodPromise,
5667
6040
  $ZodReadonly: () => $ZodReadonly,
5668
6041
  $ZodRealError: () => $ZodRealError,
@@ -7608,7 +7981,7 @@ var Doc = class {
7608
7981
  var version = {
7609
7982
  major: 4,
7610
7983
  minor: 4,
7611
- patch: 1
7984
+ patch: 3
7612
7985
  };
7613
7986
 
7614
7987
  // node_modules/zod/v4/core/schemas.js
@@ -9207,6 +9580,7 @@ var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
9207
9580
  });
9208
9581
  var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
9209
9582
  $ZodType.init(inst, def);
9583
+ inst._zod.optin = "optional";
9210
9584
  inst._zod.parse = (payload, ctx) => {
9211
9585
  if (ctx.direction === "backward") {
9212
9586
  throw new $ZodEncodeError(inst.constructor.name);
@@ -9216,6 +9590,7 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
9216
9590
  const output = _out instanceof Promise ? _out : Promise.resolve(_out);
9217
9591
  return output.then((output2) => {
9218
9592
  payload.value = output2;
9593
+ payload.fallback = true;
9219
9594
  return payload;
9220
9595
  });
9221
9596
  }
@@ -9223,11 +9598,12 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
9223
9598
  throw new $ZodAsyncError();
9224
9599
  }
9225
9600
  payload.value = _out;
9601
+ payload.fallback = true;
9226
9602
  return payload;
9227
9603
  };
9228
9604
  });
9229
9605
  function handleOptionalResult(result, input) {
9230
- if (result.issues.length && input === void 0) {
9606
+ if (input === void 0 && (result.issues.length || result.fallback)) {
9231
9607
  return { issues: [], value: void 0 };
9232
9608
  }
9233
9609
  return result;
@@ -9245,10 +9621,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
9245
9621
  });
9246
9622
  inst._zod.parse = (payload, ctx) => {
9247
9623
  if (def.innerType._zod.optin === "optional") {
9624
+ const input = payload.value;
9248
9625
  const result = def.innerType._zod.run(payload, ctx);
9249
9626
  if (result instanceof Promise)
9250
- return result.then((r) => handleOptionalResult(r, payload.value));
9251
- return handleOptionalResult(result, payload.value);
9627
+ return result.then((r) => handleOptionalResult(r, input));
9628
+ return handleOptionalResult(result, input);
9252
9629
  }
9253
9630
  if (payload.value === void 0) {
9254
9631
  return payload;
@@ -9364,7 +9741,7 @@ var $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
9364
9741
  });
9365
9742
  var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
9366
9743
  $ZodType.init(inst, def);
9367
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
9744
+ inst._zod.optin = "optional";
9368
9745
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
9369
9746
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
9370
9747
  inst._zod.parse = (payload, ctx) => {
@@ -9384,6 +9761,7 @@ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
9384
9761
  input: payload.value
9385
9762
  });
9386
9763
  payload.issues = [];
9764
+ payload.fallback = true;
9387
9765
  }
9388
9766
  return payload;
9389
9767
  });
@@ -9398,6 +9776,7 @@ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
9398
9776
  input: payload.value
9399
9777
  });
9400
9778
  payload.issues = [];
9779
+ payload.fallback = true;
9401
9780
  }
9402
9781
  return payload;
9403
9782
  };
@@ -9443,7 +9822,7 @@ function handlePipeResult(left, next, ctx) {
9443
9822
  left.aborted = true;
9444
9823
  return left;
9445
9824
  }
9446
- return next._zod.run({ value: left.value, issues: left.issues }, ctx);
9825
+ return next._zod.run({ value: left.value, issues: left.issues, fallback: left.fallback }, ctx);
9447
9826
  }
9448
9827
  var $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => {
9449
9828
  $ZodType.init(inst, def);
@@ -9495,6 +9874,9 @@ function handleCodecTxResult(left, value, nextSchema, ctx) {
9495
9874
  }
9496
9875
  return nextSchema._zod.run({ value, issues: left.issues }, ctx);
9497
9876
  }
9877
+ var $ZodPreprocess = /* @__PURE__ */ $constructor("$ZodPreprocess", (inst, def) => {
9878
+ $ZodPipe.init(inst, def);
9879
+ });
9498
9880
  var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
9499
9881
  $ZodType.init(inst, def);
9500
9882
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
@@ -17055,6 +17437,8 @@ function isTransforming(_schema, _ctx) {
17055
17437
  return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
17056
17438
  }
17057
17439
  if (def.type === "pipe") {
17440
+ if (_schema._zod.traits.has("$ZodCodec"))
17441
+ return true;
17058
17442
  return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
17059
17443
  }
17060
17444
  if (def.type === "object") {
@@ -17533,7 +17917,8 @@ var catchProcessor = (schema, ctx, json2, params) => {
17533
17917
  };
17534
17918
  var pipeProcessor = (schema, ctx, _json, params) => {
17535
17919
  const def = schema._zod.def;
17536
- const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
17920
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
17921
+ const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
17537
17922
  process3(innerType, ctx, params);
17538
17923
  const seen = ctx.seen.get(schema);
17539
17924
  seen.ref = innerType;
@@ -17767,6 +18152,7 @@ __export(schemas_exports2, {
17767
18152
  ZodOptional: () => ZodOptional,
17768
18153
  ZodPipe: () => ZodPipe,
17769
18154
  ZodPrefault: () => ZodPrefault,
18155
+ ZodPreprocess: () => ZodPreprocess,
17770
18156
  ZodPromise: () => ZodPromise,
17771
18157
  ZodReadonly: () => ZodReadonly,
17772
18158
  ZodRecord: () => ZodRecord,
@@ -19007,10 +19393,12 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
19007
19393
  if (output instanceof Promise) {
19008
19394
  return output.then((output2) => {
19009
19395
  payload.value = output2;
19396
+ payload.fallback = true;
19010
19397
  return payload;
19011
19398
  });
19012
19399
  }
19013
19400
  payload.value = output;
19401
+ payload.fallback = true;
19014
19402
  return payload;
19015
19403
  };
19016
19404
  });
@@ -19175,6 +19563,10 @@ function invertCodec(codec2) {
19175
19563
  reverseTransform: def.transform
19176
19564
  });
19177
19565
  }
19566
+ var ZodPreprocess = /* @__PURE__ */ $constructor("ZodPreprocess", (inst, def) => {
19567
+ ZodPipe.init(inst, def);
19568
+ $ZodPreprocess.init(inst, def);
19569
+ });
19178
19570
  var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
19179
19571
  $ZodReadonly.init(inst, def);
19180
19572
  ZodType.init(inst, def);
@@ -19293,7 +19685,11 @@ function json(params) {
19293
19685
  return jsonSchema;
19294
19686
  }
19295
19687
  function preprocess(fn, schema) {
19296
- return pipe2(transform(fn), schema);
19688
+ return new ZodPreprocess({
19689
+ type: "pipe",
19690
+ in: transform(fn),
19691
+ out: schema
19692
+ });
19297
19693
  }
19298
19694
 
19299
19695
  // node_modules/zod/v4/classic/compat.js
@@ -20021,7 +20417,15 @@ function isZodObject(obj) {
20021
20417
  return "shape" in obj && "extend" in obj;
20022
20418
  }
20023
20419
 
20420
+ // src/openapi/mcp-tool-extensions.ts
20421
+ var MCP_TOOL_NAME = "x-tool-name";
20422
+ var MCP_TOOL_DESCRIPTION = "x-tool-description";
20423
+
20424
+ // src/mcp.ts
20425
+ var import_pluralize = __toESM(require_pluralize(), 1);
20426
+
20024
20427
  // src/utils.ts
20428
+ var buildManagementApiV1Url = (baseUrl) => `${baseUrl.replace(/\/+$/, "")}/v1`;
20025
20429
  function info(...parts) {
20026
20430
  console.error(parts.map(formatPart).join("\n"));
20027
20431
  }
@@ -20077,8 +20481,7 @@ function createMcpServer(config2) {
20077
20481
  function generateMcpTools(config2) {
20078
20482
  const tools = [];
20079
20483
  const paths = config2.openApiSpec.paths ?? {};
20080
- const servers = config2.openApiSpec.servers ?? [];
20081
- const defaultServerUrl = (servers.length > 0 ? servers[0].url : config2.managementApiUrl).replace(/\/+$/, "");
20484
+ const defaultServerUrl = buildManagementApiV1Url(config2.managementApiUrl);
20082
20485
  info(`Server url: ${defaultServerUrl}`);
20083
20486
  for (const [path2, pathItem] of Object.entries(paths)) {
20084
20487
  if (!pathItem) {
@@ -20164,19 +20567,26 @@ function generateMcpTool(description, config2) {
20164
20567
  return { content: [{ type: "text", text: String(error51) }], isError: true };
20165
20568
  }
20166
20569
  }
20570
+ const extensions = operation;
20571
+ const toolName = extensions[MCP_TOOL_NAME] ?? generateToolName(method, path2);
20572
+ const toolDescription = extensions[MCP_TOOL_DESCRIPTION] ?? operation.description ?? operation.summary ?? "";
20573
+ const inputSchema = buildInputSchemaFromOperation(parameters, operation.requestBody, components);
20574
+ return {
20575
+ name: toolName,
20576
+ description: toolDescription,
20577
+ inputSchema,
20578
+ invoke
20579
+ };
20580
+ }
20581
+ function buildInputSchemaFromOperation(parameters, requestBody, components) {
20167
20582
  const inputSchema = {};
20168
20583
  for (const parameter of parameters) {
20169
20584
  inputSchema[parameter.name] = parameterToZod(parameter, components);
20170
20585
  }
20171
- if (operation.requestBody) {
20172
- inputSchema.data = requestBodyToZod(operation.requestBody, components);
20586
+ if (requestBody) {
20587
+ inputSchema.data = requestBodyToZod(requestBody, components);
20173
20588
  }
20174
- return {
20175
- name: generateToolName(method, path2),
20176
- description: operation.description ?? operation.summary ?? "",
20177
- inputSchema,
20178
- invoke
20179
- };
20589
+ return inputSchema;
20180
20590
  }
20181
20591
  function generateToolName(method, path2) {
20182
20592
  const segments = path2.split("/").filter(Boolean);
@@ -20203,8 +20613,8 @@ function generateToolName(method, path2) {
20203
20613
  DELETE: "delete"
20204
20614
  };
20205
20615
  const action = actions[method.toUpperCase()] ?? "call";
20206
- if (hasPathParam && resource.endsWith("s")) {
20207
- resource = resource.slice(0, -1);
20616
+ if (hasPathParam || action === "create") {
20617
+ resource = import_pluralize.default.singular(resource);
20208
20618
  }
20209
20619
  let toolName = `${action}_${resource}`;
20210
20620
  if (pathParams.length > 0) {
@@ -20317,7 +20727,7 @@ if (!managementApiSecret) {
20317
20727
  var workingDir = process.cwd();
20318
20728
  info(`Working directory is ${workingDir}`);
20319
20729
  info("Looking for OpenAPI specification");
20320
- var openApiSpec = await lookupOpenApiSpec(`${managementApiUrl}/v1/openapi.json`, managementApiSecret);
20730
+ var openApiSpec = await lookupOpenApiSpec(`${buildManagementApiV1Url(managementApiUrl)}/openapi.json`, managementApiSecret);
20321
20731
  if (!openApiSpec) {
20322
20732
  err("No OpenAPI specification found");
20323
20733
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kentico/management-api-mcp",
3
- "version": "31.4.3-preview",
3
+ "version": "31.5.0-preview",
4
4
  "description": "Model Context Protocol server for Xperience by Kentico Management API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,10 +20,11 @@
20
20
  "author": "Kentico",
21
21
  "license": "SEE LICENSE IN LICENSE.txt",
22
22
  "dependencies": {
23
- "tmcp": "^1.19.3",
24
23
  "@tmcp/adapter-zod": "^0.1.7",
25
24
  "@tmcp/transport-stdio": "^0.4.2",
26
- "zod": "^4.3.6"
25
+ "pluralize": "^8.0.0",
26
+ "tmcp": "^1.19.3",
27
+ "zod": "^4.4.3"
27
28
  },
28
29
  "engines": {
29
30
  "node": ">= 22.0.0"