@markcolabs/mcp 0.2.0 → 0.4.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 (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -205
  3. package/dist/index.d.ts +9 -23
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +51 -186
  6. package/dist/index.js.map +1 -1
  7. package/package.json +21 -12
  8. package/dist/disclaimers/ymyl.d.ts +0 -16
  9. package/dist/disclaimers/ymyl.d.ts.map +0 -1
  10. package/dist/disclaimers/ymyl.js +0 -20
  11. package/dist/disclaimers/ymyl.js.map +0 -1
  12. package/dist/engines/compoundInterest.d.ts +0 -75
  13. package/dist/engines/compoundInterest.d.ts.map +0 -1
  14. package/dist/engines/compoundInterest.js +0 -74
  15. package/dist/engines/compoundInterest.js.map +0 -1
  16. package/dist/engines/data/federalTax.d.ts +0 -47
  17. package/dist/engines/data/federalTax.d.ts.map +0 -1
  18. package/dist/engines/data/federalTax.js +0 -111
  19. package/dist/engines/data/federalTax.js.map +0 -1
  20. package/dist/engines/data/irs2026.d.ts +0 -30
  21. package/dist/engines/data/irs2026.d.ts.map +0 -1
  22. package/dist/engines/data/irs2026.js +0 -30
  23. package/dist/engines/data/irs2026.js.map +0 -1
  24. package/dist/engines/data/ssa.d.ts +0 -39
  25. package/dist/engines/data/ssa.d.ts.map +0 -1
  26. package/dist/engines/data/ssa.js +0 -55
  27. package/dist/engines/data/ssa.js.map +0 -1
  28. package/dist/engines/mortgage.d.ts +0 -70
  29. package/dist/engines/mortgage.d.ts.map +0 -1
  30. package/dist/engines/mortgage.js +0 -60
  31. package/dist/engines/mortgage.js.map +0 -1
  32. package/dist/engines/paycheck.d.ts +0 -93
  33. package/dist/engines/paycheck.d.ts.map +0 -1
  34. package/dist/engines/paycheck.js +0 -113
  35. package/dist/engines/paycheck.js.map +0 -1
  36. package/dist/engines/retirement401k.d.ts +0 -109
  37. package/dist/engines/retirement401k.d.ts.map +0 -1
  38. package/dist/engines/retirement401k.js +0 -130
  39. package/dist/engines/retirement401k.js.map +0 -1
  40. package/dist/engines/socialSecurity.d.ts +0 -63
  41. package/dist/engines/socialSecurity.d.ts.map +0 -1
  42. package/dist/engines/socialSecurity.js +0 -139
  43. package/dist/engines/socialSecurity.js.map +0 -1
  44. package/dist/envelope.d.ts +0 -76
  45. package/dist/envelope.d.ts.map +0 -1
  46. package/dist/envelope.js +0 -34
  47. package/dist/envelope.js.map +0 -1
  48. package/dist/shared/bounds.d.ts +0 -83
  49. package/dist/shared/bounds.d.ts.map +0 -1
  50. package/dist/shared/bounds.js +0 -121
  51. package/dist/shared/bounds.js.map +0 -1
  52. package/dist/tools/compoundInterest.d.ts +0 -48
  53. package/dist/tools/compoundInterest.d.ts.map +0 -1
  54. package/dist/tools/compoundInterest.js +0 -107
  55. package/dist/tools/compoundInterest.js.map +0 -1
  56. package/dist/tools/mortgage.d.ts +0 -51
  57. package/dist/tools/mortgage.d.ts.map +0 -1
  58. package/dist/tools/mortgage.js +0 -112
  59. package/dist/tools/mortgage.js.map +0 -1
  60. package/dist/tools/paycheck.d.ts +0 -54
  61. package/dist/tools/paycheck.d.ts.map +0 -1
  62. package/dist/tools/paycheck.js +0 -122
  63. package/dist/tools/paycheck.js.map +0 -1
  64. package/dist/tools/retirement401k.d.ts +0 -85
  65. package/dist/tools/retirement401k.d.ts.map +0 -1
  66. package/dist/tools/retirement401k.js +0 -141
  67. package/dist/tools/retirement401k.js.map +0 -1
  68. package/dist/tools/socialSecurity.d.ts +0 -51
  69. package/dist/tools/socialSecurity.d.ts.map +0 -1
  70. package/dist/tools/socialSecurity.js +0 -117
  71. package/dist/tools/socialSecurity.js.map +0 -1
  72. package/dist/util/zod-to-json-schema.d.ts +0 -28
  73. package/dist/util/zod-to-json-schema.d.ts.map +0 -1
  74. package/dist/util/zod-to-json-schema.js +0 -98
  75. package/dist/util/zod-to-json-schema.js.map +0 -1
@@ -1,122 +0,0 @@
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
@@ -1 +0,0 @@
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,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,UAAU,EACV,SAAS,GAGV,MAAM,gBAAgB,CAAC;AAExB,yCAAyC;AACzC,MAAM,CAAC,MAAM,SAAS,GAAG,+BAA+B,CAAC;AAEzD,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,qEAAqE;IAC1E,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAG9D,CAAC;AAEF,MAAM,oBAAoB,GAGtB;IACF,qBAAqB,CAAC,CAAC,CAAC;IACxB,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC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AE,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"}
@@ -1,85 +0,0 @@
1
- /**
2
- * MCP tool wrapper for `dc.calculator.retirement401k.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 (corrected v0.2.0 per ADR-0041 D2). */
13
- export declare const TOOL_NAME = "dc.calculator.retirement401k.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
@@ -1 +0,0 @@
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,4EAA4E;AAC5E,eAAO,MAAM,SAAS,4CAA4C,CAAC;AAOnE;;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"}
@@ -1,141 +0,0 @@
1
- /**
2
- * MCP tool wrapper for `dc.calculator.retirement401k.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 (corrected v0.2.0 per ADR-0041 D2). */
15
- export const TOOL_NAME = "dc.calculator.retirement401k.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
@@ -1 +0,0 @@
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,4EAA4E;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAG,yCAAyC,CAAC;AAEnE,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,4EAA4E;IACjF,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC;KACjD,MAAM,CAAC;IACN,cAAc,EAAE,CAAC;SACd,MAAM,EAAE;SACR,GAAG,CAAC,sBAAsB,CAAC,mBAAmB,CAAC;SAC/C,GAAG,CAAC,sBAAsB,CAAC,mBAAmB,CAAC;SAC/C,QAAQ,CAAC,gCAAgC,CAAC;IAC7C,YAAY,EAAE,CAAC;SACZ,MAAM,EAAE;SACR,GAAG,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;SAC7C,GAAG,CAAC,sBAAsB,CAAC,iBAAiB,CAAC;SAC7C,QAAQ,CAAC,qCAAqC,CAAC;IAClD,mBAAmB,EAAE,CAAC;SACnB,MAAM,EAAE;SACR,GAAG,CAAC,sBAAsB,CAAC,wBAAwB,CAAC;SACpD,GAAG,CAAC,sBAAsB,CAA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AAQ,CAAC,OAAO,CAAC,kBAAkB,CAAC;QAC5C,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,oBAAoB,CAAC;QAC9C,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,EACtC,CAAC;QACD,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,SAAS,CAAC;gBACf,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,6CAA6C;gBACtD,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"}
@@ -1,51 +0,0 @@
1
- /**
2
- * MCP tool wrapper for `dc.calculator.socialSecurity.estimatedBenefit`.
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 (corrected v0.2.0 per ADR-0041 D2). */
19
- export declare const TOOL_NAME = "dc.calculator.socialSecurity.estimatedBenefit";
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
@@ -1 +0,0 @@
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,4EAA4E;AAC5E,eAAO,MAAM,SAAS,kDAAkD,CAAC;AAOzE,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"}
@@ -1,117 +0,0 @@
1
- /**
2
- * MCP tool wrapper for `dc.calculator.socialSecurity.estimatedBenefit`.
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 { estimate, ENGINE_VERSION, } from "../engines/socialSecurity.js";
17
- import { SOCIAL_SECURITY_BOUNDS } 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 (corrected v0.2.0 per ADR-0041 D2). */
21
- export const TOOL_NAME = "dc.calculator.socialSecurity.estimatedBenefit";
22
- const METHODOLOGY = {
23
- url: "https://www.digitalcalculator.info/social-security-calculator/methodology/",
24
- version: "2026-05-09",
25
- };
26
- export const SocialSecurityEstimateInputSchema = z.object({
27
- birthYear: z
28
- .number()
29
- .int()
30
- .min(SOCIAL_SECURITY_BOUNDS.MIN_BIRTH_YEAR)
31
- .max(SOCIAL_SECURITY_BOUNDS.MAX_BIRTH_YEAR)
32
- .describe("Birth year. SSA bend-point lookups support eligibility years (birthYear + 62) from 2014 onward."),
33
- currentEarnings: z
34
- .number()
35
- .min(SOCIAL_SECURITY_BOUNDS.MIN_CURRENT_EARNINGS)
36
- .max(SOCIAL_SECURITY_BOUNDS.MAX_CURRENT_EARNINGS)
37
- .describe("Current/final annual earnings in USD."),
38
- claimAge: z
39
- .number()
40
- .min(SOCIAL_SECURITY_BOUNDS.MIN_CLAIM_AGE)
41
- .max(SOCIAL_SECURITY_BOUNDS.MAX_CLAIM_AGE)
42
- .describe("Age at which to start claiming benefits (62-70). Earlier = reduced; later = delayed credit."),
43
- yearsWorked: z
44
- .number()
45
- .int()
46
- .min(SOCIAL_SECURITY_BOUNDS.MIN_YEARS_WORKED)
47
- .max(SOCIAL_SECURITY_BOUNDS.MAX_YEARS_WORKED)
48
- .optional()
49
- .describe("Years of work earning SS credits. Defaults to 35 (the SSA averaging window)."),
50
- lifeExpectancy: z
51
- .number()
52
- .min(SOCIAL_SECURITY_BOUNDS.MIN_LIFE_EXPECTANCY)
53
- .max(SOCIAL_SECURITY_BOUNDS.MAX_LIFE_EXPECTANCY)
54
- .optional()
55
- .describe("Life expectancy assumption for lifetime benefit projection. Defaults to 85."),
56
- });
57
- export const TOOL_DESCRIPTION = "Estimate Social Security retirement benefits using the SSA bend-point " +
58
- "formula and a simplified AIME approximation. Returns monthly benefit at " +
59
- "Full Retirement Age, the adjusted monthly benefit at the chosen claim " +
60
- "age (early reduction or delayed credit), and a lifetime projection to " +
61
- "the assumed life expectancy. For an authoritative estimate based on your " +
62
- "actual earnings history, see https://www.ssa.gov/myaccount/.";
63
- /**
64
- * Execute the tool.
65
- */
66
- export function execute(rawInput) {
67
- const parsed = SocialSecurityEstimateInputSchema.safeParse(rawInput);
68
- if (!parsed.success) {
69
- const first = parsed.error.issues[0];
70
- return {
71
- ok: false,
72
- error: makeError({
73
- code: "INPUT_VALIDATION",
74
- message: first?.message ?? "Invalid input.",
75
- field: first?.path.join(".") || undefined,
76
- retriable: false,
77
- }),
78
- };
79
- }
80
- const input = parsed.data;
81
- let payload;
82
- try {
83
- payload = estimate(input);
84
- }
85
- catch (err) {
86
- return {
87
- ok: false,
88
- error: makeError({
89
- code: "INTERNAL",
90
- message: "Engine error computing Social Security estimate.",
91
- retriable: false,
92
- }),
93
- };
94
- }
95
- if (!Number.isFinite(payload.monthlyBenefitAtFRA) ||
96
- !Number.isFinite(payload.adjustedMonthlyBenefit) ||
97
- !Number.isFinite(payload.lifetimeBenefitProjection)) {
98
- return {
99
- ok: false,
100
- error: makeError({
101
- code: "INTERNAL",
102
- message: "Social Security engine produced a non-finite result.",
103
- retriable: false,
104
- }),
105
- };
106
- }
107
- return {
108
- ok: true,
109
- value: makeResult({
110
- result: payload,
111
- methodology: METHODOLOGY,
112
- engineVersion: ENGINE_VERSION,
113
- disclaimer: YMYL_DISCLAIMER,
114
- }),
115
- };
116
- }
117
- //# sourceMappingURL=socialSecurity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"socialSecurity.js","sourceRoot":"","sources":["../../src/tools/socialSecurity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,QAAQ,EACR,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,4EAA4E;AAC5E,MAAM,CAAC,MAAM,SAAS,GAAG,+CAA+C,CAAC;AAEzE,MAAM,WAAW,GAAG;IAClB,GAAG,EAAE,4EAA4E;IACjF,OAAO,EAAE,YAAY;CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,sBAAsB,CAAC,cAAc,CAAC;SAC1C,GAAG,CAAC,sBAAsB,CAAC,cAAc,CAA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P SDK expects a JSON Schema object on each tool descriptor. Rather than
5
- * pulling in the `zod-to-json-schema` npm package (extra dep, infrequent updates),
6
- * this file implements the small subset we need for v1 input shapes:
7
- * - z.object({...})
8
- * - z.number() with .min()/.max()/.int()
9
- * - z.enum([...])
10
- * - .optional() / .describe() metadata
11
- *
12
- * If a schema feature added later isn't supported here, extend this util — or
13
- * swap in the `zod-to-json-schema` package.
14
- */
15
- import { type ZodTypeAny } from "zod";
16
- interface JsonSchema {
17
- type?: string;
18
- properties?: Record<string, JsonSchema>;
19
- required?: string[];
20
- description?: string;
21
- minimum?: number;
22
- maximum?: number;
23
- enum?: string[];
24
- additionalProperties?: boolean;
25
- }
26
- export declare function zodToJsonSchema(schema: ZodTypeAny): JsonSchema;
27
- export {};
28
- //# sourceMappingURL=zod-to-json-schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"zod-to-json-schema.d.ts","sourceRoot":"","sources":["../../src/util/zod-to-json-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAK,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAEzC,UAAU,UAAU;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAE9D"}