@markcolabs/mcp 0.1.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 (74) hide show
  1. package/README.md +263 -0
  2. package/dist/disclaimers/ymyl.d.ts +16 -0
  3. package/dist/disclaimers/ymyl.d.ts.map +1 -0
  4. package/dist/disclaimers/ymyl.js +20 -0
  5. package/dist/disclaimers/ymyl.js.map +1 -0
  6. package/dist/engines/compoundInterest.d.ts +73 -0
  7. package/dist/engines/compoundInterest.d.ts.map +1 -0
  8. package/dist/engines/compoundInterest.js +72 -0
  9. package/dist/engines/compoundInterest.js.map +1 -0
  10. package/dist/engines/data/federalTax.d.ts +47 -0
  11. package/dist/engines/data/federalTax.d.ts.map +1 -0
  12. package/dist/engines/data/federalTax.js +111 -0
  13. package/dist/engines/data/federalTax.js.map +1 -0
  14. package/dist/engines/data/irs2026.d.ts +30 -0
  15. package/dist/engines/data/irs2026.d.ts.map +1 -0
  16. package/dist/engines/data/irs2026.js +30 -0
  17. package/dist/engines/data/irs2026.js.map +1 -0
  18. package/dist/engines/data/ssa.d.ts +39 -0
  19. package/dist/engines/data/ssa.d.ts.map +1 -0
  20. package/dist/engines/data/ssa.js +55 -0
  21. package/dist/engines/data/ssa.js.map +1 -0
  22. package/dist/engines/mortgage.d.ts +69 -0
  23. package/dist/engines/mortgage.d.ts.map +1 -0
  24. package/dist/engines/mortgage.js +59 -0
  25. package/dist/engines/mortgage.js.map +1 -0
  26. package/dist/engines/paycheck.d.ts +89 -0
  27. package/dist/engines/paycheck.d.ts.map +1 -0
  28. package/dist/engines/paycheck.js +109 -0
  29. package/dist/engines/paycheck.js.map +1 -0
  30. package/dist/engines/retirement401k.d.ts +105 -0
  31. package/dist/engines/retirement401k.d.ts.map +1 -0
  32. package/dist/engines/retirement401k.js +126 -0
  33. package/dist/engines/retirement401k.js.map +1 -0
  34. package/dist/engines/socialSecurity.d.ts +59 -0
  35. package/dist/engines/socialSecurity.d.ts.map +1 -0
  36. package/dist/engines/socialSecurity.js +135 -0
  37. package/dist/engines/socialSecurity.js.map +1 -0
  38. package/dist/envelope.d.ts +76 -0
  39. package/dist/envelope.d.ts.map +1 -0
  40. package/dist/envelope.js +34 -0
  41. package/dist/envelope.js.map +1 -0
  42. package/dist/index.d.ts +30 -0
  43. package/dist/index.d.ts.map +1 -0
  44. package/dist/index.js +197 -0
  45. package/dist/index.js.map +1 -0
  46. package/dist/shared/bounds.d.ts +83 -0
  47. package/dist/shared/bounds.d.ts.map +1 -0
  48. package/dist/shared/bounds.js +121 -0
  49. package/dist/shared/bounds.js.map +1 -0
  50. package/dist/tools/compoundInterest.d.ts +48 -0
  51. package/dist/tools/compoundInterest.d.ts.map +1 -0
  52. package/dist/tools/compoundInterest.js +107 -0
  53. package/dist/tools/compoundInterest.js.map +1 -0
  54. package/dist/tools/mortgage.d.ts +51 -0
  55. package/dist/tools/mortgage.d.ts.map +1 -0
  56. package/dist/tools/mortgage.js +112 -0
  57. package/dist/tools/mortgage.js.map +1 -0
  58. package/dist/tools/paycheck.d.ts +54 -0
  59. package/dist/tools/paycheck.d.ts.map +1 -0
  60. package/dist/tools/paycheck.js +122 -0
  61. package/dist/tools/paycheck.js.map +1 -0
  62. package/dist/tools/retirement401k.d.ts +85 -0
  63. package/dist/tools/retirement401k.d.ts.map +1 -0
  64. package/dist/tools/retirement401k.js +141 -0
  65. package/dist/tools/retirement401k.js.map +1 -0
  66. package/dist/tools/socialSecurity.d.ts +51 -0
  67. package/dist/tools/socialSecurity.d.ts.map +1 -0
  68. package/dist/tools/socialSecurity.js +117 -0
  69. package/dist/tools/socialSecurity.js.map +1 -0
  70. package/dist/util/zod-to-json-schema.d.ts +28 -0
  71. package/dist/util/zod-to-json-schema.d.ts.map +1 -0
  72. package/dist/util/zod-to-json-schema.js +98 -0
  73. package/dist/util/zod-to-json-schema.js.map +1 -0
  74. package/package.json +53 -0
@@ -0,0 +1,112 @@
1
+ /**
2
+ * MCP tool wrapper for `dc.calculator.mortgage.monthlyPayment`.
3
+ *
4
+ * Per ADR-0039 § 1: tool name is locked.
5
+ * Per ADR-0039 § 2: Zod input schema with bounds from shared/bounds.ts.
6
+ * Per ADR-0039 § 3: returns ToolResult<MortgageMonthlyPaymentResult>.
7
+ * Per ADR-0039 § 4: failures funnel through ToolError; tools never throw.
8
+ */
9
+ import { z } from "zod";
10
+ import { monthlyPayment, ENGINE_VERSION, } from "../engines/mortgage.js";
11
+ import { MORTGAGE_BOUNDS } from "../shared/bounds.js";
12
+ import { YMYL_DISCLAIMER } from "../disclaimers/ymyl.js";
13
+ import { makeResult, makeError, } from "../envelope.js";
14
+ /** Locked tool name per ADR-0039 § 1. */
15
+ export const TOOL_NAME = "dc.calculator.mortgage.monthlyPayment";
16
+ /** Methodology pointer — ADR-0039 § 3 (URL is calculator HTML page until .md companion lands). */
17
+ const METHODOLOGY = {
18
+ url: "https://www.digitalcalculator.info/mortgage-calculator/",
19
+ version: "2026-05-09",
20
+ };
21
+ /**
22
+ * Zod input schema. Bounds come from shared/bounds.ts so engine and schema cannot drift.
23
+ */
24
+ export const MortgageMonthlyPaymentInputSchema = z.object({
25
+ principal: z
26
+ .number()
27
+ .min(MORTGAGE_BOUNDS.MIN_PRINCIPAL)
28
+ .max(MORTGAGE_BOUNDS.MAX_PRINCIPAL)
29
+ .describe("Loan principal in USD."),
30
+ annualRatePercent: z
31
+ .number()
32
+ .min(MORTGAGE_BOUNDS.MIN_RATE_PERCENT)
33
+ .max(MORTGAGE_BOUNDS.MAX_RATE_PERCENT)
34
+ .describe("Annual interest rate as whole-number percent (e.g., 6.5 for 6.5%)."),
35
+ termYears: z
36
+ .number()
37
+ .int()
38
+ .min(MORTGAGE_BOUNDS.MIN_TERM_YEARS)
39
+ .max(MORTGAGE_BOUNDS.MAX_TERM_YEARS)
40
+ .describe("Loan term in whole years."),
41
+ });
42
+ /**
43
+ * Tool description used in mcp.tools/list.
44
+ */
45
+ export const TOOL_DESCRIPTION = "Compute the monthly principal & interest payment, total interest paid, and " +
46
+ "total amount paid over the life of a fixed-rate mortgage. Inputs are in USD; " +
47
+ "rate is a whole-number percent. Returns a structured payload with " +
48
+ "{ monthlyPayment, totalInterest, totalPaid }.";
49
+ /**
50
+ * Execute the tool. Validation + engine call wrapped in the standard envelope.
51
+ *
52
+ * Returns a tagged union:
53
+ * { ok: true, value: ToolResult<...> }
54
+ * { ok: false, error: ToolError }
55
+ *
56
+ * The MCP SDK adapter at src/index.ts maps `ok=false` to `isError: true`.
57
+ */
58
+ export function execute(rawInput) {
59
+ // Validation.
60
+ const parsed = MortgageMonthlyPaymentInputSchema.safeParse(rawInput);
61
+ if (!parsed.success) {
62
+ const first = parsed.error.issues[0];
63
+ return {
64
+ ok: false,
65
+ error: makeError({
66
+ code: "INPUT_VALIDATION",
67
+ message: first?.message ?? "Invalid input.",
68
+ field: first?.path.join(".") || undefined,
69
+ retriable: false,
70
+ }),
71
+ };
72
+ }
73
+ const input = parsed.data;
74
+ // Compute (engine is pure; wrap in try/catch defensively for INTERNAL bucket).
75
+ let payload;
76
+ try {
77
+ payload = monthlyPayment(input);
78
+ }
79
+ catch (err) {
80
+ return {
81
+ ok: false,
82
+ error: makeError({
83
+ code: "INTERNAL",
84
+ message: "Engine error computing mortgage monthly payment.",
85
+ retriable: false,
86
+ }),
87
+ };
88
+ }
89
+ // Sanity check: NaN or non-finite results are an internal failure.
90
+ if (!Number.isFinite(payload.monthlyPayment) ||
91
+ !Number.isFinite(payload.totalInterest) ||
92
+ !Number.isFinite(payload.totalPaid)) {
93
+ return {
94
+ ok: false,
95
+ error: makeError({
96
+ code: "INTERNAL",
97
+ message: "Mortgage engine produced a non-finite result.",
98
+ retriable: false,
99
+ }),
100
+ };
101
+ }
102
+ return {
103
+ ok: true,
104
+ value: makeResult({
105
+ result: payload,
106
+ methodology: METHODOLOGY,
107
+ engineVersion: ENGINE_VERSION,
108
+ disclaimer: YMYL_DISCLAIMER,
109
+ }),
110
+ };
111
+ }
112
+ //# sourceMappingUR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f,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,+CAA+C;gBACxD,SAAS,EAAE,KAAK;aACjB,CAAC;SACH,CAAC;IACJ,CAAC;IAED,OAAO;QACL,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,UAAU,CAAC;YAChB,MAAM,EAAE,OAAO;YACf,WAAW,EAAE,WAAW;YACxB,aAAa,EAAE,cAAc;YAC7B,UAAU,EAAE,eAAe;SAC5B,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * MCP tool wrapper for `dc.calculator.paycheck.netPay`.
3
+ *
4
+ * Per ADR-0039 § 1: tool name is locked.
5
+ * Per ADR-0039 § 2: Zod input schema with bounds from shared/bounds.ts.
6
+ * Per ADR-0039 § 3: returns ToolResult<PaycheckNetPayResult>.
7
+ * Per ADR-0039 § 4: failures funnel through ToolError; tools never throw.
8
+ *
9
+ * YMYL note: state withholding varies by state (some have no income tax, some
10
+ * have flat rates, some have brackets, some have local taxes). The v0.2.0
11
+ * engine returns $0 for the 9 no-income-tax states and a flat 5% estimate
12
+ * for all other states. Callers needing precise per-state withholding should
13
+ * be directed to the full site calculator at the methodology link.
14
+ */
15
+ import { z } from "zod";
16
+ import { type PaycheckNetPayResult } from "../engines/paycheck.js";
17
+ import { type ToolResult, type ToolError } from "../envelope.js";
18
+ /** Locked tool name per ADR-0039 § 1. */
19
+ export declare const TOOL_NAME = "dc.calculator.paycheck.netPay";
20
+ export declare const PaycheckNetPayInputSchema: z.ZodObject<{
21
+ grossAnnualSalary: z.ZodNumber;
22
+ payFrequency: z.ZodEnum<["quarterly" | "monthly" | "weekly" | "biweekly" | "semimonthly" | "annual", ...("quarterly" | "monthly" | "weekly" | "biweekly" | "semimonthly" | "annual")[]]>;
23
+ federalFilingStatus: z.ZodEnum<["single" | "married" | "marriedSeparate" | "headOfHousehold", ...("single" | "married" | "marriedSeparate" | "headOfHousehold")[]]>;
24
+ state: z.ZodString;
25
+ dependents: z.ZodNumber;
26
+ preTaxDeductionsAnnual: z.ZodNumber;
27
+ postTaxDeductionsAnnual: z.ZodNumber;
28
+ }, "strip", z.ZodTypeAny, {
29
+ grossAnnualSalary: number;
30
+ payFrequency: "quarterly" | "monthly" | "weekly" | "biweekly" | "semimonthly" | "annual";
31
+ federalFilingStatus: "single" | "married" | "marriedSeparate" | "headOfHousehold";
32
+ state: string;
33
+ preTaxDeductionsAnnual: number;
34
+ postTaxDeductionsAnnual: number;
35
+ dependents: number;
36
+ }, {
37
+ grossAnnualSalary: number;
38
+ payFrequency: "quarterly" | "monthly" | "weekly" | "biweekly" | "semimonthly" | "annual";
39
+ federalFilingStatus: "single" | "married" | "marriedSeparate" | "headOfHousehold";
40
+ state: string;
41
+ preTaxDeductionsAnnual: number;
42
+ postTaxDeductionsAnnual: number;
43
+ dependents: number;
44
+ }>;
45
+ export type PaycheckNetPayToolInput = z.infer<typeof PaycheckNetPayInputSchema>;
46
+ export declare const TOOL_DESCRIPTION: string;
47
+ export declare function execute(rawInput: unknown): {
48
+ ok: true;
49
+ value: ToolResult<PaycheckNetPayResult>;
50
+ } | {
51
+ ok: false;
52
+ error: ToolError;
53
+ };
54
+ //# sourceMappingURL=paycheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paycheck.d.ts","sourceRoot":"","sources":["../../src/tools/paycheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,wBAAwB,CAAC;AAOhC,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAExB,yCAAyC;AACzC,eAAO,MAAM,SAAS,kCAAkC,CAAC;AAoBzD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;EA4CpC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAEhF,eAAO,MAAM,gBAAgB,QAOqB,CAAC;AAEnD,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,GAEf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAA;CAAE,GACrD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAuDlC"}
@@ -0,0 +1,122 @@
1
+ /**
2
+ * MCP tool wrapper for `dc.calculator.paycheck.netPay`.
3
+ *
4
+ * Per ADR-0039 § 1: tool name is locked.
5
+ * Per ADR-0039 § 2: Zod input schema with bounds from shared/bounds.ts.
6
+ * Per ADR-0039 § 3: returns ToolResult<PaycheckNetPayResult>.
7
+ * Per ADR-0039 § 4: failures funnel through ToolError; tools never throw.
8
+ *
9
+ * YMYL note: state withholding varies by state (some have no income tax, some
10
+ * have flat rates, some have brackets, some have local taxes). The v0.2.0
11
+ * engine returns $0 for the 9 no-income-tax states and a flat 5% estimate
12
+ * for all other states. Callers needing precise per-state withholding should
13
+ * be directed to the full site calculator at the methodology link.
14
+ */
15
+ import { z } from "zod";
16
+ import { netPay, ENGINE_VERSION, } from "../engines/paycheck.js";
17
+ import { PAYCHECK_BOUNDS, PAYCHECK_PAY_FREQUENCY, FEDERAL_FILING_STATUS, } from "../shared/bounds.js";
18
+ import { YMYL_DISCLAIMER } from "../disclaimers/ymyl.js";
19
+ import { makeResult, makeError, } from "../envelope.js";
20
+ /** Locked tool name per ADR-0039 § 1. */
21
+ export const TOOL_NAME = "dc.calculator.paycheck.netPay";
22
+ const METHODOLOGY = {
23
+ url: "https://www.digitalcalculator.info/paycheck-calculator/methodology/",
24
+ version: "2026-05-09",
25
+ };
26
+ const PAY_FREQUENCY_LABELS = Object.keys(PAYCHECK_PAY_FREQUENCY);
27
+ const FILING_STATUS_LABELS = [
28
+ FEDERAL_FILING_STATUS[0],
29
+ ...FEDERAL_FILING_STATUS.slice(1),
30
+ ];
31
+ export const PaycheckNetPayInputSchema = z.object({
32
+ grossAnnualSalary: z
33
+ .number()
34
+ .min(PAYCHECK_BOUNDS.MIN_GROSS_ANNUAL_SALARY)
35
+ .max(PAYCHECK_BOUNDS.MAX_GROSS_ANNUAL_SALARY)
36
+ .describe("Gross annual salary in USD."),
37
+ payFrequency: z
38
+ .enum(PAY_FREQUENCY_LABELS)
39
+ .describe("Pay frequency: weekly | biweekly | semimonthly | monthly | quarterly | annual."),
40
+ federalFilingStatus: z
41
+ .enum(FILING_STATUS_LABELS)
42
+ .describe("Federal filing status: single | married | marriedSeparate | headOfHousehold."),
43
+ state: z
44
+ .string()
45
+ .length(2)
46
+ .describe("Two-letter state code (e.g., 'CA', 'TX'). Used for no-income-tax detection."),
47
+ dependents: z
48
+ .number()
49
+ .int()
50
+ .min(PAYCHECK_BOUNDS.MIN_DEPENDENTS)
51
+ .max(PAYCHECK_BOUNDS.MAX_DEPENDENTS)
52
+ .describe("Number of dependents (Form W-4 line 3). Reserved for future engine versions; currently no effect."),
53
+ preTaxDeductionsAnnual: z
54
+ .number()
55
+ .min(PAYCHECK_BOUNDS.MIN_PRETAX_DEDUCTIONS)
56
+ .max(PAYCHECK_BOUNDS.MAX_PRETAX_DEDUCTIONS)
57
+ .describe("Total pre-tax deductions per year (401k, HSA, FSA, etc.) in USD."),
58
+ postTaxDeductionsAnnual: z
59
+ .number()
60
+ .min(PAYCHECK_BOUNDS.MIN_POSTTAX_DEDUCTIONS)
61
+ .max(PAYCHECK_BOUNDS.MAX_POSTTAX_DEDUCTIONS)
62
+ .describe("Total post-tax deductions per year (Roth contributions, garnishments, etc.) in USD."),
63
+ });
64
+ export const TOOL_DESCRIPTION = "Estimate net (take-home) pay per paycheck using the IRS 2026 federal " +
65
+ "Percentage Method, FICA (Social Security 6.2% + Medicare 1.45% + Additional " +
66
+ "Medicare 0.9% above thresholds), and a simplified state-tax estimate ($0 " +
67
+ "for no-income-tax states; flat 5% otherwise). Returns gross/federal/FICA/" +
68
+ "state per-paycheck amounts plus the annualized totals. State-specific " +
69
+ "withholding tables, SDI, and local taxes are NOT modeled — see the " +
70
+ "methodology link for the full site calculator.";
71
+ export function execute(rawInput) {
72
+ const parsed = PaycheckNetPayInputSchema.safeParse(rawInput);
73
+ if (!parsed.success) {
74
+ const first = parsed.error.issues[0];
75
+ return {
76
+ ok: false,
77
+ error: makeError({
78
+ code: "INPUT_VALIDATION",
79
+ message: first?.message ?? "Invalid input.",
80
+ field: first?.path.join(".") || undefined,
81
+ retriable: false,
82
+ }),
83
+ };
84
+ }
85
+ const input = parsed.data;
86
+ let payload;
87
+ try {
88
+ payload = netPay(input);
89
+ }
90
+ catch (err) {
91
+ return {
92
+ ok: false,
93
+ error: makeError({
94
+ code: "INTERNAL",
95
+ message: "Engine error computing paycheck net pay.",
96
+ retriable: false,
97
+ }),
98
+ };
99
+ }
100
+ if (!Number.isFinite(payload.netPay) ||
101
+ !Number.isFinite(payload.federalTax) ||
102
+ !Number.isFinite(payload.ficaTax)) {
103
+ return {
104
+ ok: false,
105
+ error: makeError({
106
+ code: "INTERNAL",
107
+ message: "Paycheck engine produced a non-finite result.",
108
+ retriable: false,
109
+ }),
110
+ };
111
+ }
112
+ return {
113
+ ok: true,
114
+ value: makeResult({
115
+ result: payload,
116
+ methodology: METHODOLOGY,
117
+ engineVersion: ENGINE_VERSION,
118
+ disclaimer: YMYL_DISCLAIMER,
119
+ }),
120
+ };
121
+ }
122
+ //# sourceMappingURL=paycheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paycheck.js","sourceRoot":"","sources":["../../src/tools/paycheck.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,MAAM,EACN,cAAc,GAEf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,qBAAqB,GACtB,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EAAE,0CAA0C;gBACnD,SAAS,EAAE,KAAK;aACjB,CAAC;SACH,CAAC;IACJ,CAAC;IAED,IACE,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;QAChC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC;QACpC,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EACjC,CAAC;QACD,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,SAAS,CAAC;gBACf,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,+CAA+C;gBACxD,SAAS,EAAE,KAAK;aACjB,CAAC;SACH,CAAC;IACJ,CAAC;IAED,OAAO;QACL,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,UAAU,CAAC;YAChB,MAAM,EAAE,OAAO;YACf,WAAW,EAAE,WAAW;YACxB,aAAa,EAAE,cAAc;YAC7B,UAAU,EAAE,eAAe;SAC5B,CAAC;KACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * MCP tool wrapper for `dc.calculator.401k.projection`.
3
+ *
4
+ * Per ADR-0039 § 1: tool name is locked.
5
+ * Per ADR-0039 § 2: Zod input schema with bounds from shared/bounds.ts.
6
+ * Per ADR-0039 § 3: returns ToolResult<Retirement401kProjectionResult>.
7
+ * Per ADR-0039 § 4: failures funnel through ToolError; tools never throw.
8
+ */
9
+ import { z } from "zod";
10
+ import { type Retirement401kProjectionResult } from "../engines/retirement401k.js";
11
+ import { type ToolResult, type ToolError } from "../envelope.js";
12
+ /** Locked tool name per ADR-0039 § 1. */
13
+ export declare const TOOL_NAME = "dc.calculator.401k.projection";
14
+ /**
15
+ * Zod input schema. Bounds come from shared/bounds.ts so engine + schema cannot drift.
16
+ */
17
+ export declare const Retirement401kProjectionInputSchema: z.ZodEffects<z.ZodObject<{
18
+ currentBalance: z.ZodNumber;
19
+ annualSalary: z.ZodNumber;
20
+ contributionPercent: z.ZodNumber;
21
+ employerMatchPercent: z.ZodNumber;
22
+ employerMatchLimitPercent: z.ZodNumber;
23
+ annualSalaryGrowthPercent: z.ZodNumber;
24
+ annualReturnPercent: z.ZodNumber;
25
+ currentAge: z.ZodNumber;
26
+ retirementAge: z.ZodNumber;
27
+ catchUpEnabled: z.ZodOptional<z.ZodBoolean>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ currentBalance: number;
30
+ annualSalary: number;
31
+ contributionPercent: number;
32
+ employerMatchPercent: number;
33
+ employerMatchLimitPercent: number;
34
+ annualSalaryGrowthPercent: number;
35
+ annualReturnPercent: number;
36
+ currentAge: number;
37
+ retirementAge: number;
38
+ catchUpEnabled?: boolean | undefined;
39
+ }, {
40
+ currentBalance: number;
41
+ annualSalary: number;
42
+ contributionPercent: number;
43
+ employerMatchPercent: number;
44
+ employerMatchLimitPercent: number;
45
+ annualSalaryGrowthPercent: number;
46
+ annualReturnPercent: number;
47
+ currentAge: number;
48
+ retirementAge: number;
49
+ catchUpEnabled?: boolean | undefined;
50
+ }>, {
51
+ currentBalance: number;
52
+ annualSalary: number;
53
+ contributionPercent: number;
54
+ employerMatchPercent: number;
55
+ employerMatchLimitPercent: number;
56
+ annualSalaryGrowthPercent: number;
57
+ annualReturnPercent: number;
58
+ currentAge: number;
59
+ retirementAge: number;
60
+ catchUpEnabled?: boolean | undefined;
61
+ }, {
62
+ currentBalance: number;
63
+ annualSalary: number;
64
+ contributionPercent: number;
65
+ employerMatchPercent: number;
66
+ employerMatchLimitPercent: number;
67
+ annualSalaryGrowthPercent: number;
68
+ annualReturnPercent: number;
69
+ currentAge: number;
70
+ retirementAge: number;
71
+ catchUpEnabled?: boolean | undefined;
72
+ }>;
73
+ export type Retirement401kProjectionToolInput = z.infer<typeof Retirement401kProjectionInputSchema>;
74
+ export declare const TOOL_DESCRIPTION: string;
75
+ /**
76
+ * Execute the tool. Validation + engine call wrapped in the standard envelope.
77
+ */
78
+ export declare function execute(rawInput: unknown): {
79
+ ok: true;
80
+ value: ToolResult<Retirement401kProjectionResult>;
81
+ } | {
82
+ ok: false;
83
+ error: ToolError;
84
+ };
85
+ //# sourceMappingURL=retirement401k.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retirement401k.d.ts","sourceRoot":"","sources":["../../src/tools/retirement401k.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,8BAA8B,EACpC,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAExB,yCAAyC;AACzC,eAAO,MAAM,SAAS,kCAAkC,CAAC;AAOzD;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmE5C,CAAC;AAEL,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAKI,CAAC;AAElC;;GAEG;AACH,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,GAEf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,8BAA8B,CAAC,CAAA;CAAE,GAC/D;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAwDlC"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * MCP tool wrapper for `dc.calculator.401k.projection`.
3
+ *
4
+ * Per ADR-0039 § 1: tool name is locked.
5
+ * Per ADR-0039 § 2: Zod input schema with bounds from shared/bounds.ts.
6
+ * Per ADR-0039 § 3: returns ToolResult<Retirement401kProjectionResult>.
7
+ * Per ADR-0039 § 4: failures funnel through ToolError; tools never throw.
8
+ */
9
+ import { z } from "zod";
10
+ import { projection, ENGINE_VERSION, } from "../engines/retirement401k.js";
11
+ import { RETIREMENT_401K_BOUNDS } from "../shared/bounds.js";
12
+ import { YMYL_DISCLAIMER } from "../disclaimers/ymyl.js";
13
+ import { makeResult, makeError, } from "../envelope.js";
14
+ /** Locked tool name per ADR-0039 § 1. */
15
+ export const TOOL_NAME = "dc.calculator.401k.projection";
16
+ const METHODOLOGY = {
17
+ url: "https://www.digitalcalculator.info/401k-retirement-calculator/methodology/",
18
+ version: "2026-05-09",
19
+ };
20
+ /**
21
+ * Zod input schema. Bounds come from shared/bounds.ts so engine + schema cannot drift.
22
+ */
23
+ export const Retirement401kProjectionInputSchema = z
24
+ .object({
25
+ currentBalance: z
26
+ .number()
27
+ .min(RETIREMENT_401K_BOUNDS.MIN_CURRENT_BALANCE)
28
+ .max(RETIREMENT_401K_BOUNDS.MAX_CURRENT_BALANCE)
29
+ .describe("Current 401(k) balance in USD."),
30
+ annualSalary: z
31
+ .number()
32
+ .min(RETIREMENT_401K_BOUNDS.MIN_ANNUAL_SALARY)
33
+ .max(RETIREMENT_401K_BOUNDS.MAX_ANNUAL_SALARY)
34
+ .describe("Current annual gross salary in USD."),
35
+ contributionPercent: z
36
+ .number()
37
+ .min(RETIREMENT_401K_BOUNDS.MIN_CONTRIBUTION_PERCENT)
38
+ .max(RETIREMENT_401K_BOUNDS.MAX_CONTRIBUTION_PERCENT)
39
+ .describe("Employee contribution as percent of salary (whole-number percent, e.g., 6 for 6%)."),
40
+ employerMatchPercent: z
41
+ .number()
42
+ .min(RETIREMENT_401K_BOUNDS.MIN_EMPLOYER_MATCH_PERCENT)
43
+ .max(RETIREMENT_401K_BOUNDS.MAX_EMPLOYER_MATCH_PERCENT)
44
+ .describe("Employer match percent (e.g., 50 means $0.50 employer match per $1 employee contribution)."),
45
+ employerMatchLimitPercent: z
46
+ .number()
47
+ .min(RETIREMENT_401K_BOUNDS.MIN_EMPLOYER_MATCH_LIMIT_PERCENT)
48
+ .max(RETIREMENT_401K_BOUNDS.MAX_EMPLOYER_MATCH_LIMIT_PERCENT)
49
+ .describe("Cap on employee contribution percent the employer matches (e.g., 6 means up to 6% of salary)."),
50
+ annualSalaryGrowthPercent: z
51
+ .number()
52
+ .min(RETIREMENT_401K_BOUNDS.MIN_SALARY_GROWTH_PERCENT)
53
+ .max(RETIREMENT_401K_BOUNDS.MAX_SALARY_GROWTH_PERCENT)
54
+ .describe("Annual salary growth percent (e.g., 3 for 3%/yr; 0 mirrors flat-salary site engine)."),
55
+ annualReturnPercent: z
56
+ .number()
57
+ .min(RETIREMENT_401K_BOUNDS.MIN_RETURN_PERCENT)
58
+ .max(RETIREMENT_401K_BOUNDS.MAX_RETURN_PERCENT)
59
+ .describe("Annual investment return percent (e.g., 7 for 7%/yr)."),
60
+ currentAge: z
61
+ .number()
62
+ .int()
63
+ .min(RETIREMENT_401K_BOUNDS.MIN_AGE)
64
+ .max(RETIREMENT_401K_BOUNDS.MAX_AGE)
65
+ .describe("Current age in whole years."),
66
+ retirementAge: z
67
+ .number()
68
+ .int()
69
+ .min(RETIREMENT_401K_BOUNDS.MIN_AGE)
70
+ .max(RETIREMENT_401K_BOUNDS.MAX_AGE)
71
+ .describe("Target retirement age in whole years (must be > currentAge)."),
72
+ catchUpEnabled: z
73
+ .boolean()
74
+ .optional()
75
+ .describe("Whether to apply IRS catch-up contributions when age is in the 50+ window. Defaults to true."),
76
+ })
77
+ .refine((v) => v.retirementAge > v.currentAge, {
78
+ message: "retirementAge must be greater than currentAge",
79
+ path: ["retirementAge"],
80
+ });
81
+ export const TOOL_DESCRIPTION = "Project a 401(k) account balance through retirement, including employee + " +
82
+ "employer contributions and compounded growth. Honors IRS 2026 contribution " +
83
+ "limits (incl. catch-up for ages 50+ and SECURE 2.0 super-catch-up for ages " +
84
+ "60-63). Returns { futureBalance, totalContributions, employerContribTotal, " +
85
+ "growthEarned, yearByYear[] }.";
86
+ /**
87
+ * Execute the tool. Validation + engine call wrapped in the standard envelope.
88
+ */
89
+ export function execute(rawInput) {
90
+ const parsed = Retirement401kProjectionInputSchema.safeParse(rawInput);
91
+ if (!parsed.success) {
92
+ const first = parsed.error.issues[0];
93
+ return {
94
+ ok: false,
95
+ error: makeError({
96
+ code: "INPUT_VALIDATION",
97
+ message: first?.message ?? "Invalid input.",
98
+ field: first?.path.join(".") || undefined,
99
+ retriable: false,
100
+ }),
101
+ };
102
+ }
103
+ const input = parsed.data;
104
+ let payload;
105
+ try {
106
+ payload = projection(input);
107
+ }
108
+ catch (err) {
109
+ return {
110
+ ok: false,
111
+ error: makeError({
112
+ code: "INTERNAL",
113
+ message: "Engine error computing 401(k) projection.",
114
+ retriable: false,
115
+ }),
116
+ };
117
+ }
118
+ if (!Number.isFinite(payload.futureBalance) ||
119
+ !Number.isFinite(payload.totalContributions) ||
120
+ !Number.isFinite(payload.employerContribTotal) ||
121
+ !Number.isFinite(payload.growthEarned)) {
122
+ return {
123
+ ok: false,
124
+ error: makeError({
125
+ code: "INTERNAL",
126
+ message: "401(k) engine produced a non-finite result.",
127
+ retriable: false,
128
+ }),
129
+ };
130
+ }
131
+ return {
132
+ ok: true,
133
+ value: makeResult({
134
+ result: payload,
135
+ methodology: METHODOLOGY,
136
+ engineVersion: ENGINE_VERSION,
137
+ disclaimer: YMYL_DISCLAIMER,
138
+ }),
139
+ };
140
+ }
141
+ //# sourceMappingURL=retirement401k.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retirement401k.js","sourceRoot":"","sources":["../../src/tools/retirement401k.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,UAAU,EACV,cAAc,GAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,UAAU,EACV,SAAS,GAGV,MAAM,gBAAgB,CAAC;AAExB,yCAAyC;AAC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1,51 @@
1
+ /**
2
+ * MCP tool wrapper for `dc.calculator.socialSecurity.estimate`.
3
+ *
4
+ * Per ADR-0039 § 1: tool name is locked.
5
+ * Per ADR-0039 § 2: Zod input schema with bounds from shared/bounds.ts.
6
+ * Per ADR-0039 § 3: returns ToolResult<SocialSecurityEstimateResult>.
7
+ * Per ADR-0039 § 4: failures funnel through ToolError; tools never throw.
8
+ *
9
+ * YMYL note: SS benefits depend on a person's specific 35-year earnings
10
+ * history; this engine uses the SSA-public bend-points formula on a
11
+ * simplified earnings approximation (`estimateAIME`). For an authoritative
12
+ * estimate, callers should be directed to https://www.ssa.gov/myaccount/.
13
+ * The methodology link covers the simplified-AIME caveat.
14
+ */
15
+ import { z } from "zod";
16
+ import { type SocialSecurityEstimateResult } from "../engines/socialSecurity.js";
17
+ import { type ToolResult, type ToolError } from "../envelope.js";
18
+ /** Locked tool name per ADR-0039 § 1. */
19
+ export declare const TOOL_NAME = "dc.calculator.socialSecurity.estimate";
20
+ export declare const SocialSecurityEstimateInputSchema: z.ZodObject<{
21
+ birthYear: z.ZodNumber;
22
+ currentEarnings: z.ZodNumber;
23
+ claimAge: z.ZodNumber;
24
+ yearsWorked: z.ZodOptional<z.ZodNumber>;
25
+ lifeExpectancy: z.ZodOptional<z.ZodNumber>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ birthYear: number;
28
+ currentEarnings: number;
29
+ claimAge: number;
30
+ yearsWorked?: number | undefined;
31
+ lifeExpectancy?: number | undefined;
32
+ }, {
33
+ birthYear: number;
34
+ currentEarnings: number;
35
+ claimAge: number;
36
+ yearsWorked?: number | undefined;
37
+ lifeExpectancy?: number | undefined;
38
+ }>;
39
+ export type SocialSecurityEstimateToolInput = z.infer<typeof SocialSecurityEstimateInputSchema>;
40
+ export declare const TOOL_DESCRIPTION: string;
41
+ /**
42
+ * Execute the tool.
43
+ */
44
+ export declare function execute(rawInput: unknown): {
45
+ ok: true;
46
+ value: ToolResult<SocialSecurityEstimateResult>;
47
+ } | {
48
+ ok: false;
49
+ error: ToolError;
50
+ };
51
+ //# sourceMappingURL=socialSecurity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"socialSecurity.d.ts","sourceRoot":"","sources":["../../src/tools/socialSecurity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAExB,yCAAyC;AACzC,eAAO,MAAM,SAAS,0CAA0C,CAAC;AAOjE,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;EAsC5C,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,iCAAiC,CACzC,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAMmC,CAAC;AAEjE;;GAEG;AACH,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,GAEf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,4BAA4B,CAAC,CAAA;CAAE,GAC7D;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAuDlC"}