@utilix-tech/mcp 0.85.0 → 0.86.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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Full release notes for all Utilix surfaces (browser tools, REST API, SDKs, MCP server) live at [utilix.tech/changelog](https://utilix.tech/changelog). This file tracks just this package.
4
4
 
5
+ ## 0.86.0
6
+ - Add `calculate_sales_commission` tool: compute a flat or tiered (marginal) sales commission from a sale amount, where tiered mode applies each rate only to the slice of sales within that tier, plus an optional base salary added to the total payout.
7
+ - Add `build_character_class` tool: assemble a `[...]` regex character class from named building blocks (lowercase, uppercase, digits, whitespace), custom ranges, and literal custom characters, with optional negation.
8
+
5
9
  ## 0.85.0
6
10
  - Add `calculate_credit_card_minimum_payment` tool: simulate paying only the minimum payment on a revolving credit card balance, where the minimum is the larger of a percent of the balance or a fixed dollar floor, and report months/years to payoff, total interest, and total paid.
7
11
  - Add `check_dash_usage` tool: scan text for likely dash misuse: a hyphen surrounded by spaces, an unconverted double hyphen, and inconsistent spacing around em dashes across the same document.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @utilix-tech/mcp
2
2
 
3
- MCP server exposing 264 developer utility tools to Claude, Cursor, VS Code Copilot, and any [Model Context Protocol](https://modelcontextprotocol.io) compatible AI assistant.
3
+ MCP server exposing 266 developer utility tools to Claude, Cursor, VS Code Copilot, and any [Model Context Protocol](https://modelcontextprotocol.io) compatible AI assistant.
4
4
 
5
5
  No API key required. All tools run locally. Requires Node.js 18 or later.
6
6
 
@@ -168,7 +168,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
168
168
  | `convert_timezone` | Convert a date/time between timezones |
169
169
  | `convert_iso8601_duration` | Parse an ISO 8601 duration into components and total seconds, or format seconds into a duration string |
170
170
 
171
- ### Units (47 tools)
171
+ ### Units (48 tools)
172
172
  | Tool | Description |
173
173
  |------|-------------|
174
174
  | `convert_bytes` | Convert between B, KB, MB, GB, TB, KiB, MiB, GiB, TiB |
@@ -218,6 +218,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
218
218
  | `estimate_data_transfer_time` | Estimate the theoretical time to transfer a file of a given size over a connection of a given speed, or (given a target time instead) the bandwidth required to hit it |
219
219
  | `calculate_real_rate_of_return` | Apply the Fisher equation to solve for whichever of the nominal rate, inflation rate, or inflation-adjusted real rate is missing, given exactly two of the three |
220
220
  | `calculate_credit_card_minimum_payment` | Simulate paying only the minimum payment on a revolving credit card balance, where the minimum is the larger of a percent of the balance or a fixed dollar floor, and report months/years to payoff, total interest, and total paid |
221
+ | `calculate_sales_commission` | Compute a sales commission from either a flat percent rate applied to the whole sale amount, or a tiered (marginal) rate structure where each tier applies only to the slice of sales within it, plus an optional base salary added to the total payout |
221
222
 
222
223
  ### API / Network (51 tools)
223
224
  | Tool | Description |
@@ -285,7 +286,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
285
286
  | `color_palette` | Generate a color palette from a base color |
286
287
  | `color_shades` | Generate shades or tints from a base color |
287
288
 
288
- ### Code (25 tools)
289
+ ### Code (27 tools)
289
290
  | Tool | Description |
290
291
  |------|-------------|
291
292
  | `format_sql` | Format a SQL query with proper indentation |
@@ -314,6 +315,7 @@ claude mcp add utilix -- npx -y @utilix-tech/mcp
314
315
  | `validate_fence_language_tags` | Scan a Markdown document's fenced code blocks and flag a missing, unknown, or inconsistently-cased language tag against a curated list of common syntax-highlighter identifiers |
315
316
  | `count_sql_placeholders` | Count positional (`?`, `$1`) and named (`:name`, `@name`) parameter placeholders in a SQL query, flagging mixed styles and numbered-sequence gaps or duplicates |
316
317
  | `extract_markdown_link_references` | Extract every reference-style Markdown link ([text][ref], [text][], ![alt][ref]) and match it against its [ref]: url definition, flagging unresolved references and unused definitions |
318
+ | `build_character_class` | Assemble a [...] regex character class from named building blocks (lowercase, uppercase, digits, whitespace), custom ranges, and literal custom characters, with optional negation |
317
319
 
318
320
  ### Data (16 tools)
319
321
  | Tool | Description |
package/dist/index.js CHANGED
@@ -13677,5 +13677,180 @@ server.tool(
13677
13677
  return text(JSON.stringify(_checkDashUsageMcp(input), null, 2));
13678
13678
  }
13679
13679
  );
13680
+ var _CommissionTierSchema = z.object({
13681
+ upTo: z.number().nullable().describe("Upper bound of this tier (exclusive). null means unbounded and is only valid on the last tier."),
13682
+ ratePercent: z.number().min(0).describe("Commission rate as a percent applied to the slice of salesAmount within this tier")
13683
+ });
13684
+ function _calculateSalesCommissionMcp(salesAmount, flatRatePercent, tiers, baseSalary) {
13685
+ if (!Number.isFinite(salesAmount) || salesAmount < 0) {
13686
+ return { error: "salesAmount must be a finite, non-negative number" };
13687
+ }
13688
+ if (!Number.isFinite(baseSalary) || baseSalary < 0) {
13689
+ return { error: "baseSalary must be a finite, non-negative number when provided" };
13690
+ }
13691
+ const hasFlat = flatRatePercent !== void 0;
13692
+ const hasTiers = tiers !== void 0;
13693
+ if (hasFlat === hasTiers) {
13694
+ return { error: "Provide exactly one of flatRatePercent or tiers, not both and not neither" };
13695
+ }
13696
+ const round4 = (n) => Math.round(n * 1e4) / 1e4;
13697
+ if (hasFlat) {
13698
+ if (!Number.isFinite(flatRatePercent) || flatRatePercent < 0) {
13699
+ return { error: "flatRatePercent must be a finite, non-negative number" };
13700
+ }
13701
+ const commission2 = salesAmount * flatRatePercent / 100;
13702
+ return {
13703
+ salesAmount: round4(salesAmount),
13704
+ mode: "flat",
13705
+ commission: round4(commission2),
13706
+ baseSalary: round4(baseSalary),
13707
+ totalPayout: round4(baseSalary + commission2)
13708
+ };
13709
+ }
13710
+ const tierList = tiers;
13711
+ if (tierList.length === 0) {
13712
+ return { error: "tiers must contain at least one entry" };
13713
+ }
13714
+ let previousUpTo = 0;
13715
+ for (let i = 0; i < tierList.length; i++) {
13716
+ const tier = tierList[i];
13717
+ const isLast = i === tierList.length - 1;
13718
+ if (!Number.isFinite(tier.ratePercent) || tier.ratePercent < 0) {
13719
+ return { error: `tiers[${i}].ratePercent must be a finite, non-negative number` };
13720
+ }
13721
+ if (tier.upTo === null) {
13722
+ if (!isLast) {
13723
+ return { error: `tiers[${i}].upTo may only be null on the last tier (an unbounded top tier)` };
13724
+ }
13725
+ } else {
13726
+ if (!Number.isFinite(tier.upTo) || tier.upTo <= previousUpTo) {
13727
+ return { error: `tiers[${i}].upTo must be a finite number greater than the previous tier's upTo (${previousUpTo})` };
13728
+ }
13729
+ previousUpTo = tier.upTo;
13730
+ }
13731
+ }
13732
+ let lowerBound = 0;
13733
+ let commission = 0;
13734
+ const breakdown = [];
13735
+ for (const tier of tierList) {
13736
+ const upper = tier.upTo === null ? Infinity : tier.upTo;
13737
+ const amountInRange = Math.min(Math.max(salesAmount - lowerBound, 0), upper - lowerBound);
13738
+ const commissionForRange = amountInRange * tier.ratePercent / 100;
13739
+ commission += commissionForRange;
13740
+ breakdown.push({
13741
+ rangeStart: round4(lowerBound),
13742
+ rangeEnd: tier.upTo === null ? null : round4(tier.upTo),
13743
+ ratePercent: tier.ratePercent,
13744
+ amountInRange: round4(amountInRange),
13745
+ commissionForRange: round4(commissionForRange)
13746
+ });
13747
+ lowerBound = upper;
13748
+ }
13749
+ return {
13750
+ salesAmount: round4(salesAmount),
13751
+ mode: "tiered",
13752
+ commission: round4(commission),
13753
+ baseSalary: round4(baseSalary),
13754
+ totalPayout: round4(baseSalary + commission),
13755
+ breakdown
13756
+ };
13757
+ }
13758
+ server.tool(
13759
+ "calculate_sales_commission",
13760
+ "Compute a sales commission from either a flat percent rate applied to the whole sale amount, or a tiered (marginal) rate structure where each tier applies only to the slice of the sale amount within it, the same way progressive tax brackets work. An optional base salary is added to the commission to get a total payout. Pure arithmetic, no live data.",
13761
+ {
13762
+ salesAmount: z.number().min(0).describe("The total sale amount commission is computed on"),
13763
+ flatRatePercent: z.number().min(0).optional().describe("A flat commission rate as a percent, applied to the whole salesAmount. Mutually exclusive with tiers."),
13764
+ tiers: z.array(_CommissionTierSchema).optional().describe("Marginal commission tiers, sorted ascending by upTo. Mutually exclusive with flatRatePercent."),
13765
+ baseSalary: z.number().min(0).optional().describe("Optional base salary added to the commission to get totalPayout, default 0")
13766
+ },
13767
+ async ({ salesAmount, flatRatePercent, tiers, baseSalary }) => {
13768
+ const result = _calculateSalesCommissionMcp(salesAmount, flatRatePercent, tiers, baseSalary ?? 0);
13769
+ if ("error" in result) return errText(result);
13770
+ return text(JSON.stringify(result, null, 2));
13771
+ }
13772
+ );
13773
+ var _CHAR_CLASS_SPECIAL_CHARS_MCP = /* @__PURE__ */ new Set(["]", "\\", "^", "-"]);
13774
+ function _escapeForCharClassMcp(ch) {
13775
+ return _CHAR_CLASS_SPECIAL_CHARS_MCP.has(ch) ? `\\${ch}` : ch;
13776
+ }
13777
+ var _CHAR_CLASS_RANGE_RE_MCP = /^(.)-(.)$/u;
13778
+ function _buildCharacterClassMcp(lowercase, uppercase, digits, whitespace, customRanges, customChars, negate) {
13779
+ const hasAny = lowercase || uppercase || digits || whitespace || customRanges.length > 0 || customChars.length > 0;
13780
+ if (!hasAny) {
13781
+ return { error: "At least one character set, custom range, or custom character must be specified" };
13782
+ }
13783
+ const parts = [];
13784
+ const includes = [];
13785
+ if (lowercase) {
13786
+ parts.push("a-z");
13787
+ includes.push("a-z: lowercase letters");
13788
+ }
13789
+ if (uppercase) {
13790
+ parts.push("A-Z");
13791
+ includes.push("A-Z: uppercase letters");
13792
+ }
13793
+ if (digits) {
13794
+ parts.push("0-9");
13795
+ includes.push("0-9: digits");
13796
+ }
13797
+ if (whitespace) {
13798
+ parts.push("\\s");
13799
+ includes.push("\\s: whitespace characters (space, tab, newline, etc.)");
13800
+ }
13801
+ for (let i = 0; i < customRanges.length; i++) {
13802
+ const range = customRanges[i];
13803
+ const match = _CHAR_CLASS_RANGE_RE_MCP.exec(range);
13804
+ if (!match) {
13805
+ return { error: `customRanges[${i}] ("${range}") must be exactly two characters joined by a hyphen, e.g. "f-k"` };
13806
+ }
13807
+ const [, start, end] = match;
13808
+ if (start.codePointAt(0) > end.codePointAt(0)) {
13809
+ return { error: `customRanges[${i}] ("${range}") has a start character that comes after its end character` };
13810
+ }
13811
+ parts.push(`${_escapeForCharClassMcp(start)}-${_escapeForCharClassMcp(end)}`);
13812
+ includes.push(`${range}: custom range from '${start}' to '${end}' inclusive`);
13813
+ }
13814
+ if (customChars.length > 0) {
13815
+ const seen = /* @__PURE__ */ new Set();
13816
+ const unique = [];
13817
+ for (const ch of customChars) {
13818
+ if (!seen.has(ch)) {
13819
+ seen.add(ch);
13820
+ unique.push(ch);
13821
+ }
13822
+ }
13823
+ parts.push(unique.map(_escapeForCharClassMcp).join(""));
13824
+ includes.push(`custom characters: ${unique.join(", ")}`);
13825
+ }
13826
+ const pattern = `[${negate ? "^" : ""}${parts.join("")}]`;
13827
+ return { pattern, negate, includes };
13828
+ }
13829
+ server.tool(
13830
+ "build_character_class",
13831
+ "Assemble a [...] regex character class from named building blocks (lowercase, uppercase, digits, whitespace), custom character ranges, and literal custom characters, with optional negation. Pure string assembly, it never runs the resulting pattern against any input.",
13832
+ {
13833
+ lowercase: z.boolean().optional().describe("Include a-z"),
13834
+ uppercase: z.boolean().optional().describe("Include A-Z"),
13835
+ digits: z.boolean().optional().describe("Include 0-9"),
13836
+ whitespace: z.boolean().optional().describe("Include \\s (space, tab, newline, etc.)"),
13837
+ customRanges: z.array(z.string()).optional().describe('Custom ranges like "f-k", each exactly two characters joined by a hyphen'),
13838
+ customChars: z.string().optional().describe("Literal characters to include as-is; duplicates are ignored"),
13839
+ negate: z.boolean().optional().describe("Wrap the class in [^...] to match any character NOT in the set")
13840
+ },
13841
+ async ({ lowercase, uppercase, digits, whitespace, customRanges, customChars, negate }) => {
13842
+ const result = _buildCharacterClassMcp(
13843
+ lowercase ?? false,
13844
+ uppercase ?? false,
13845
+ digits ?? false,
13846
+ whitespace ?? false,
13847
+ customRanges ?? [],
13848
+ customChars ?? "",
13849
+ negate ?? false
13850
+ );
13851
+ if ("error" in result) return errText(result);
13852
+ return text(JSON.stringify(result, null, 2));
13853
+ }
13854
+ );
13680
13855
  var transport = new StdioServerTransport();
13681
13856
  await server.connect(transport);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilix-tech/mcp",
3
- "version": "0.85.0",
3
+ "version": "0.86.0",
4
4
  "description": "MCP server exposing 198 Utilix developer tools to Claude, Cursor, VS Code Copilot, and any MCP-compatible AI assistant.",
5
5
  "author": "Utilix <hello@utilix.tech>",
6
6
  "license": "MIT",