@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,83 +0,0 @@
1
- /**
2
- * Numeric bounds shared between Zod schemas and engines.
3
- *
4
- * Per ADR-0039 § 2: "Bounds match the constants already defined in the source
5
- * calculator JS (e.g., MAX_HOME_PRICE = 100000000 from mortgage-calculator.js).
6
- * Bounds are imported from a shared bounds.ts module so engine and schema cannot drift."
7
- *
8
- * If the site calculator constants change, update both surfaces in lockstep.
9
- */
10
- export declare const MORTGAGE_BOUNDS: {
11
- readonly MIN_PRINCIPAL: 0;
12
- readonly MAX_PRINCIPAL: 100000000;
13
- readonly MIN_RATE_PERCENT: 0;
14
- readonly MAX_RATE_PERCENT: 30;
15
- readonly MIN_TERM_YEARS: 1;
16
- readonly MAX_TERM_YEARS: 50;
17
- };
18
- export declare const COMPOUND_INTEREST_BOUNDS: {
19
- readonly MIN_PRINCIPAL: 0;
20
- readonly MAX_PRINCIPAL: 100000000;
21
- readonly MIN_RATE_PERCENT: 0;
22
- readonly MAX_RATE_PERCENT: 50;
23
- readonly MIN_YEARS: 0;
24
- readonly MAX_YEARS: 100;
25
- readonly MIN_MONTHLY_CONTRIBUTION: 0;
26
- readonly MAX_MONTHLY_CONTRIBUTION: 1000000;
27
- };
28
- /**
29
- * Allowed compounding-frequency labels and their per-year period counts.
30
- * Matches the site calculator's compoundFrequency input options.
31
- */
32
- export declare const COMPOUNDING_FREQUENCY: Record<"annually" | "semiannually" | "quarterly" | "monthly" | "daily", number>;
33
- export type CompoundingFrequencyLabel = keyof typeof COMPOUNDING_FREQUENCY;
34
- export declare const RETIREMENT_401K_BOUNDS: {
35
- readonly MIN_CURRENT_BALANCE: 0;
36
- readonly MAX_CURRENT_BALANCE: 100000000;
37
- readonly MIN_ANNUAL_SALARY: 0;
38
- readonly MAX_ANNUAL_SALARY: 100000000;
39
- readonly MIN_CONTRIBUTION_PERCENT: 0;
40
- readonly MAX_CONTRIBUTION_PERCENT: 100;
41
- readonly MIN_EMPLOYER_MATCH_PERCENT: 0;
42
- readonly MAX_EMPLOYER_MATCH_PERCENT: 100;
43
- readonly MIN_EMPLOYER_MATCH_LIMIT_PERCENT: 0;
44
- readonly MAX_EMPLOYER_MATCH_LIMIT_PERCENT: 100;
45
- readonly MIN_SALARY_GROWTH_PERCENT: 0;
46
- readonly MAX_SALARY_GROWTH_PERCENT: 20;
47
- readonly MIN_RETURN_PERCENT: 0;
48
- readonly MAX_RETURN_PERCENT: 20;
49
- readonly MIN_AGE: 18;
50
- readonly MAX_AGE: 100;
51
- };
52
- export declare const SOCIAL_SECURITY_BOUNDS: {
53
- readonly MIN_BIRTH_YEAR: 1943;
54
- readonly MAX_BIRTH_YEAR: 2004;
55
- readonly MIN_CURRENT_EARNINGS: 0;
56
- readonly MAX_CURRENT_EARNINGS: 1000000;
57
- readonly MIN_CLAIM_AGE: 62;
58
- readonly MAX_CLAIM_AGE: 70;
59
- readonly MIN_LIFE_EXPECTANCY: 62;
60
- readonly MAX_LIFE_EXPECTANCY: 120;
61
- readonly MIN_YEARS_WORKED: 0;
62
- readonly MAX_YEARS_WORKED: 50;
63
- };
64
- export declare const PAYCHECK_BOUNDS: {
65
- readonly MIN_GROSS_ANNUAL_SALARY: 0;
66
- readonly MAX_GROSS_ANNUAL_SALARY: 10000000;
67
- readonly MIN_DEPENDENTS: 0;
68
- readonly MAX_DEPENDENTS: 20;
69
- readonly MIN_PRETAX_DEDUCTIONS: 0;
70
- readonly MAX_PRETAX_DEDUCTIONS: 1000000;
71
- readonly MIN_POSTTAX_DEDUCTIONS: 0;
72
- readonly MAX_POSTTAX_DEDUCTIONS: 1000000;
73
- };
74
- /**
75
- * Allowed paycheck pay-frequency labels. Mirrors site PAY_PERIODS keys
76
- * (excluding hourly, which is computed differently and out of scope for v1).
77
- */
78
- export declare const PAYCHECK_PAY_FREQUENCY: Record<"weekly" | "biweekly" | "semimonthly" | "monthly" | "quarterly" | "annual", number>;
79
- export type PaycheckPayFrequencyLabel = keyof typeof PAYCHECK_PAY_FREQUENCY;
80
- /** Federal filing-status enum (camelCase, matches paycheck engine). */
81
- export declare const FEDERAL_FILING_STATUS: readonly ["single", "married", "marriedSeparate", "headOfHousehold"];
82
- export type FederalFilingStatusLabel = (typeof FEDERAL_FILING_STATUS)[number];
83
- //# sourceMappingURL=bounds.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bounds.d.ts","sourceRoot":"","sources":["../../src/shared/bounds.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,eAAO,MAAM,eAAe;;;;;;;CAOlB,CAAC;AAKX,eAAO,MAAM,wBAAwB;;;;;;;;;CAS3B,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MAAM,CACxC,UAAU,GAAG,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,EAC/D,MAAM,CAOP,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAQ3E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;CAiBzB,CAAC;AASX,eAAO,MAAM,sBAAsB;;;;;;;;;;;CAWzB,CAAC;AAMX,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,QAAQ,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,EAC1E,MAAM,CAQP,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,sBAAsB,CAAC;AAE5E,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,sEAKxB,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC"}
@@ -1,121 +0,0 @@
1
- /**
2
- * Numeric bounds shared between Zod schemas and engines.
3
- *
4
- * Per ADR-0039 § 2: "Bounds match the constants already defined in the source
5
- * calculator JS (e.g., MAX_HOME_PRICE = 100000000 from mortgage-calculator.js).
6
- * Bounds are imported from a shared bounds.ts module so engine and schema cannot drift."
7
- *
8
- * If the site calculator constants change, update both surfaces in lockstep.
9
- */
10
- // -----------------------------------------------------------------------------
11
- // Mortgage calculator bounds
12
- // -----------------------------------------------------------------------------
13
- export const MORTGAGE_BOUNDS = {
14
- MIN_PRINCIPAL: 0,
15
- MAX_PRINCIPAL: 100_000_000,
16
- MIN_RATE_PERCENT: 0,
17
- MAX_RATE_PERCENT: 30,
18
- MIN_TERM_YEARS: 1,
19
- MAX_TERM_YEARS: 50,
20
- };
21
- // -----------------------------------------------------------------------------
22
- // Compound-interest calculator bounds
23
- // -----------------------------------------------------------------------------
24
- export const COMPOUND_INTEREST_BOUNDS = {
25
- MIN_PRINCIPAL: 0,
26
- MAX_PRINCIPAL: 100_000_000,
27
- MIN_RATE_PERCENT: 0,
28
- MAX_RATE_PERCENT: 50,
29
- MIN_YEARS: 0,
30
- MAX_YEARS: 100,
31
- MIN_MONTHLY_CONTRIBUTION: 0,
32
- MAX_MONTHLY_CONTRIBUTION: 1_000_000,
33
- };
34
- /**
35
- * Allowed compounding-frequency labels and their per-year period counts.
36
- * Matches the site calculator's compoundFrequency input options.
37
- */
38
- export const COMPOUNDING_FREQUENCY = {
39
- annually: 1,
40
- semiannually: 2,
41
- quarterly: 4,
42
- monthly: 12,
43
- daily: 365,
44
- };
45
- // -----------------------------------------------------------------------------
46
- // 401(k) projection bounds (S136)
47
- // -----------------------------------------------------------------------------
48
- // Mirrors the site 401k calculator's form ranges (see formFields config in
49
- // site/src/pages/401k-retirement-calculator/401k-retirement-calculator.js).
50
- // `MAX_RETURN_PERCENT` matches MAX_EXPECTED_RETURN constant in that file.
51
- export const RETIREMENT_401K_BOUNDS = {
52
- MIN_CURRENT_BALANCE: 0,
53
- MAX_CURRENT_BALANCE: 100_000_000,
54
- MIN_ANNUAL_SALARY: 0,
55
- MAX_ANNUAL_SALARY: 100_000_000,
56
- MIN_CONTRIBUTION_PERCENT: 0,
57
- MAX_CONTRIBUTION_PERCENT: 100,
58
- MIN_EMPLOYER_MATCH_PERCENT: 0,
59
- MAX_EMPLOYER_MATCH_PERCENT: 100,
60
- MIN_EMPLOYER_MATCH_LIMIT_PERCENT: 0,
61
- MAX_EMPLOYER_MATCH_LIMIT_PERCENT: 100,
62
- MIN_SALARY_GROWTH_PERCENT: 0,
63
- MAX_SALARY_GROWTH_PERCENT: 20,
64
- MIN_RETURN_PERCENT: 0,
65
- MAX_RETURN_PERCENT: 20,
66
- MIN_AGE: 18,
67
- MAX_AGE: 100,
68
- };
69
- // -----------------------------------------------------------------------------
70
- // Social Security estimate bounds (S136)
71
- // -----------------------------------------------------------------------------
72
- // Mirrors site/src/pages/social-security-calculator form ranges.
73
- // Birth year range matches site min/max (1943..2004) — anyone outside that
74
- // range can't realistically use 2014+ bend points or hasn't been born yet.
75
- // Claim age 62-70 is the SSA-allowed claiming window.
76
- export const SOCIAL_SECURITY_BOUNDS = {
77
- MIN_BIRTH_YEAR: 1943,
78
- MAX_BIRTH_YEAR: 2004,
79
- MIN_CURRENT_EARNINGS: 0,
80
- MAX_CURRENT_EARNINGS: 1_000_000,
81
- MIN_CLAIM_AGE: 62,
82
- MAX_CLAIM_AGE: 70,
83
- MIN_LIFE_EXPECTANCY: 62,
84
- MAX_LIFE_EXPECTANCY: 120,
85
- MIN_YEARS_WORKED: 0,
86
- MAX_YEARS_WORKED: 50,
87
- };
88
- // -----------------------------------------------------------------------------
89
- // Paycheck net-pay bounds (S136)
90
- // -----------------------------------------------------------------------------
91
- // Mirrors site/src/pages/paycheck-calculator form ranges + IRS reasonable caps.
92
- export const PAYCHECK_BOUNDS = {
93
- MIN_GROSS_ANNUAL_SALARY: 0,
94
- MAX_GROSS_ANNUAL_SALARY: 10_000_000,
95
- MIN_DEPENDENTS: 0,
96
- MAX_DEPENDENTS: 20,
97
- MIN_PRETAX_DEDUCTIONS: 0,
98
- MAX_PRETAX_DEDUCTIONS: 1_000_000,
99
- MIN_POSTTAX_DEDUCTIONS: 0,
100
- MAX_POSTTAX_DEDUCTIONS: 1_000_000,
101
- };
102
- /**
103
- * Allowed paycheck pay-frequency labels. Mirrors site PAY_PERIODS keys
104
- * (excluding hourly, which is computed differently and out of scope for v1).
105
- */
106
- export const PAYCHECK_PAY_FREQUENCY = {
107
- weekly: 52,
108
- biweekly: 26,
109
- semimonthly: 24,
110
- monthly: 12,
111
- quarterly: 4,
112
- annual: 1,
113
- };
114
- /** Federal filing-status enum (camelCase, matches paycheck engine). */
115
- export const FEDERAL_FILING_STATUS = [
116
- "single",
117
- "married",
118
- "marriedSeparate",
119
- "headOfHousehold",
120
- ];
121
- //# sourceMappingURL=bounds.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bounds.js","sourceRoot":"","sources":["../../src/shared/bounds.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,gFAAgF;AAChF,6BAA6B;AAC7B,gFAAgF;AAChF,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,WAAW;IAC1B,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,EAAE;IACpB,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,EAAE;CACV,CAAC;AAEX,gFAAgF;AAChF,sCAAsC;AACtC,gFAAgF;AAChF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,aAAa,EAAE,CAAC;IAChB,aAAa,EAAE,WAAW;IAC1B,gBAAgB,EAAE,CAAC;IACnB,gBAAgB,EAAE,EAAE;IACpB,SAAS,EAAE,CAAC;IACZ,SAAS,EAAE,GAAG;IACd,wBAAwB,EAAE,CAAC;IAC3B,wBAAwB,EAAE,SAAS;CAC3B,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAG9B;IACF,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE,CAAC;IACf,SAAS,EAAE,CAAC;IACZ,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,GAAG;CACX,CAAC;AAIF,gFAAgF;AAChF,kCAAkC;AAClC,g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EAAE,SAAS;CACzB,CAAC;AAEX;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAG/B;IACF,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,EAAE;IACX,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;CACV,CAAC;AAIF,uEAAuE;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,QAAQ;IACR,SAAS;IACT,iBAAiB;IACjB,iBAAiB;CACT,CAAC"}
@@ -1,48 +0,0 @@
1
- /**
2
- * MCP tool wrapper for `dc.calculator.compoundInterest.futureValue`.
3
- *
4
- * Per ADR-0039 § 1: tool name locked.
5
- * Per ADR-0039 § 2: Zod input with bounds from shared/bounds.ts; rate as Percent.
6
- * Per ADR-0039 § 3: returns ToolResult<CompoundInterestFutureValueResult>.
7
- * Per ADR-0039 § 4: errors funnel through ToolError.
8
- */
9
- import { z } from "zod";
10
- import { type CompoundInterestFutureValueResult } from "../engines/compoundInterest.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.compoundInterest.futureValue";
14
- /**
15
- * Zod input schema. `compoundingFrequency` is an enum of the supported labels.
16
- */
17
- export declare const CompoundInterestFutureValueInputSchema: z.ZodObject<{
18
- principal: z.ZodNumber;
19
- annualRatePercent: z.ZodNumber;
20
- years: z.ZodNumber;
21
- compoundingFrequency: z.ZodEnum<["annually" | "semiannually" | "quarterly" | "monthly" | "daily", ...("annually" | "semiannually" | "quarterly" | "monthly" | "daily")[]]>;
22
- monthlyContribution: z.ZodOptional<z.ZodNumber>;
23
- }, "strip", z.ZodTypeAny, {
24
- principal: number;
25
- annualRatePercent: number;
26
- years: number;
27
- compoundingFrequency: "annually" | "semiannually" | "quarterly" | "monthly" | "daily";
28
- monthlyContribution?: number | undefined;
29
- }, {
30
- principal: number;
31
- annualRatePercent: number;
32
- years: number;
33
- compoundingFrequency: "annually" | "semiannually" | "quarterly" | "monthly" | "daily";
34
- monthlyContribution?: number | undefined;
35
- }>;
36
- export type CompoundInterestFutureValueToolInput = z.infer<typeof CompoundInterestFutureValueInputSchema>;
37
- export declare const TOOL_DESCRIPTION: string;
38
- /**
39
- * Execute the tool. Tagged-union return; SDK adapter maps to MCP isError.
40
- */
41
- export declare function execute(rawInput: unknown): {
42
- ok: true;
43
- value: ToolResult<CompoundInterestFutureValueResult>;
44
- } | {
45
- ok: false;
46
- error: ToolError;
47
- };
48
- //# sourceMappingURL=compoundInterest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compoundInterest.d.ts","sourceRoot":"","sources":["../../src/tools/compoundInterest.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,iCAAiC,EACvC,MAAM,gCAAgC,CAAC;AAMxC,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAExB,yCAAyC;AACzC,eAAO,MAAM,SAAS,+CAA+C,CAAC;AAYtE;;GAEG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;EA2BjD,CAAC;AAEH,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,sCAAsC,CAC9C,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAGyD,CAAC;AAEvF;;GAEG;AACH,wBAAgB,OAAO,CACrB,QAAQ,EAAE,OAAO,GAEf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC,iCAAiC,CAAC,CAAA;CAAE,GAClE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,CAuDlC"}
@@ -1,107 +0,0 @@
1
- /**
2
- * MCP tool wrapper for `dc.calculator.compoundInterest.futureValue`.
3
- *
4
- * Per ADR-0039 § 1: tool name locked.
5
- * Per ADR-0039 § 2: Zod input with bounds from shared/bounds.ts; rate as Percent.
6
- * Per ADR-0039 § 3: returns ToolResult<CompoundInterestFutureValueResult>.
7
- * Per ADR-0039 § 4: errors funnel through ToolError.
8
- */
9
- import { z } from "zod";
10
- import { futureValue, ENGINE_VERSION, } from "../engines/compoundInterest.js";
11
- import { COMPOUND_INTEREST_BOUNDS, COMPOUNDING_FREQUENCY, } 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.compoundInterest.futureValue";
16
- const METHODOLOGY = {
17
- url: "https://www.digitalcalculator.info/compound-interest-calculator/",
18
- version: "2026-05-09",
19
- };
20
- const FREQUENCY_LABELS = Object.keys(COMPOUNDING_FREQUENCY);
21
- /**
22
- * Zod input schema. `compoundingFrequency` is an enum of the supported labels.
23
- */
24
- export const CompoundInterestFutureValueInputSchema = z.object({
25
- principal: z
26
- .number()
27
- .min(COMPOUND_INTEREST_BOUNDS.MIN_PRINCIPAL)
28
- .max(COMPOUND_INTEREST_BOUNDS.MAX_PRINCIPAL)
29
- .describe("Initial principal in USD."),
30
- annualRatePercent: z
31
- .number()
32
- .min(COMPOUND_INTEREST_BOUNDS.MIN_RATE_PERCENT)
33
- .max(COMPOUND_INTEREST_BOUNDS.MAX_RATE_PERCENT)
34
- .describe("Annual interest rate as whole-number percent (e.g., 7 for 7%)."),
35
- years: z
36
- .number()
37
- .min(COMPOUND_INTEREST_BOUNDS.MIN_YEARS)
38
- .max(COMPOUND_INTEREST_BOUNDS.MAX_YEARS)
39
- .describe("Investment period in years."),
40
- compoundingFrequency: z
41
- .enum(FREQUENCY_LABELS)
42
- .describe("How often interest compounds: annually | semiannually | quarterly | monthly | daily."),
43
- monthlyContribution: z
44
- .number()
45
- .min(COMPOUND_INTEREST_BOUNDS.MIN_MONTHLY_CONTRIBUTION)
46
- .max(COMPOUND_INTEREST_BOUNDS.MAX_MONTHLY_CONTRIBUTION)
47
- .optional()
48
- .describe("Optional monthly contribution in USD. Defaults to 0."),
49
- });
50
- export const TOOL_DESCRIPTION = "Project the future value of an initial principal with optional regular monthly " +
51
- "contributions, compounding at the chosen frequency. Inputs are in USD; rate is a " +
52
- "whole-number percent. Returns { futureValue, totalContributions, interestEarned }.";
53
- /**
54
- * Execute the tool. Tagged-union return; SDK adapter maps to MCP isError.
55
- */
56
- export function execute(rawInput) {
57
- const parsed = CompoundInterestFutureValueInputSchema.safeParse(rawInput);
58
- if (!parsed.success) {
59
- const first = parsed.error.issues[0];
60
- return {
61
- ok: false,
62
- error: makeError({
63
- code: "INPUT_VALIDATION",
64
- message: first?.message ?? "Invalid input.",
65
- field: first?.path.join(".") || undefined,
66
- retriable: false,
67
- }),
68
- };
69
- }
70
- const input = parsed.data;
71
- let payload;
72
- try {
73
- payload = futureValue(input);
74
- }
75
- catch (err) {
76
- return {
77
- ok: false,
78
- error: makeError({
79
- code: "INTERNAL",
80
- message: "Engine error computing compound-interest future value.",
81
- retriable: false,
82
- }),
83
- };
84
- }
85
- if (!Number.isFinite(payload.futureValue) ||
86
- !Number.isFinite(payload.totalContributions) ||
87
- !Number.isFinite(payload.interestEarned)) {
88
- return {
89
- ok: false,
90
- error: makeError({
91
- code: "INTERNAL",
92
- message: "Compound-interest engine produced a non-finite result.",
93
- retriable: false,
94
- }),
95
- };
96
- }
97
- return {
98
- ok: true,
99
- value: makeResult({
100
- result: payload,
101
- methodology: METHODOLOGY,
102
- engineVersion: ENGINE_VERSION,
103
- disclaimer: YMYL_DISCLAIMER,
104
- }),
105
- };
106
- }
107
- //# sourceMappingURL=compoundInterest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compoundInterest.js","sourceRoot":"","sources":["../../src/tools/compoundInterest.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EA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kB,CAAC;QAC5C,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,EACxC,CAAC;QACD,OAAO;YACL,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,SAAS,CAAC;gBACf,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,wDAAwD;gBACjE,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.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 { type MortgageMonthlyPaymentResult } from "../engines/mortgage.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.mortgage.monthlyPayment";
14
- /**
15
- * Zod input schema. Bounds come from shared/bounds.ts so engine and schema cannot drift.
16
- */
17
- export declare const MortgageMonthlyPaymentInputSchema: z.ZodObject<{
18
- principal: z.ZodNumber;
19
- annualRatePercent: z.ZodNumber;
20
- termYears: z.ZodNumber;
21
- }, "strip", z.ZodTypeAny, {
22
- principal: number;
23
- annualRatePercent: number;
24
- termYears: number;
25
- }, {
26
- principal: number;
27
- annualRatePercent: number;
28
- termYears: number;
29
- }>;
30
- export type MortgageMonthlyPaymentToolInput = z.infer<typeof MortgageMonthlyPaymentInputSchema>;
31
- /**
32
- * Tool description used in mcp.tools/list.
33
- */
34
- export declare const TOOL_DESCRIPTION: string;
35
- /**
36
- * Execute the tool. Validation + engine call wrapped in the standard envelope.
37
- *
38
- * Returns a tagged union:
39
- * { ok: true, value: ToolResult<...> }
40
- * { ok: false, error: ToolError }
41
- *
42
- * The MCP SDK adapter at src/index.ts maps `ok=false` to `isError: true`.
43
- */
44
- export declare function execute(rawInput: unknown): {
45
- ok: true;
46
- value: ToolResult<MortgageMonthlyPaymentResult>;
47
- } | {
48
- ok: false;
49
- error: ToolError;
50
- };
51
- //# sourceMappingURL=mortgage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mortgage.d.ts","sourceRoot":"","sources":["../../src/tools/mortgage.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAExB,yCAAyC;AACzC,eAAO,MAAM,SAAS,0CAA0C,CAAC;AAQjE;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;EAiB5C,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,QAIoB,CAAC;AAElD;;;;;;;;GAQG;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,CA0DlC"}
@@ -1,112 +0,0 @@
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
- //# sourceMappingURL=mortgage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mortgage.js","sourceRoot":"","sources":["../../src/tools/mortgage.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,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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,54 +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 { 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
@@ -1 +0,0 @@
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"}