@opencapstack/mcp-server 0.1.3 → 0.1.5

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 (64) hide show
  1. package/dist/auth.d.ts.map +1 -1
  2. package/dist/auth.js +5 -1
  3. package/dist/auth.js.map +1 -1
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/client.js +17 -5
  6. package/dist/client.js.map +1 -1
  7. package/dist/schema.d.ts +13 -0
  8. package/dist/schema.d.ts.map +1 -0
  9. package/dist/schema.js +22 -0
  10. package/dist/schema.js.map +1 -0
  11. package/dist/server.d.ts.map +1 -1
  12. package/dist/server.js +5 -1
  13. package/dist/server.js.map +1 -1
  14. package/dist/tools/dilution.d.ts.map +1 -1
  15. package/dist/tools/dilution.js +6 -13
  16. package/dist/tools/dilution.js.map +1 -1
  17. package/dist/tools/documents.d.ts.map +1 -1
  18. package/dist/tools/documents.js +3 -2
  19. package/dist/tools/documents.js.map +1 -1
  20. package/dist/tools/equityGrants.d.ts +3 -0
  21. package/dist/tools/equityGrants.d.ts.map +1 -0
  22. package/dist/tools/equityGrants.js +145 -0
  23. package/dist/tools/equityGrants.js.map +1 -0
  24. package/dist/tools/equityPlans.d.ts.map +1 -1
  25. package/dist/tools/equityPlans.js +30 -21
  26. package/dist/tools/equityPlans.js.map +1 -1
  27. package/dist/tools/financialReports.d.ts.map +1 -1
  28. package/dist/tools/financialReports.js +33 -17
  29. package/dist/tools/financialReports.js.map +1 -1
  30. package/dist/tools/meta.d.ts +3 -0
  31. package/dist/tools/meta.d.ts.map +1 -0
  32. package/dist/tools/meta.js +161 -0
  33. package/dist/tools/meta.js.map +1 -0
  34. package/dist/tools/safes.d.ts.map +1 -1
  35. package/dist/tools/safes.js +59 -42
  36. package/dist/tools/safes.js.map +1 -1
  37. package/dist/tools/shareClasses.d.ts.map +1 -1
  38. package/dist/tools/shareClasses.js +31 -23
  39. package/dist/tools/shareClasses.js.map +1 -1
  40. package/dist/tools/stakeholders.d.ts.map +1 -1
  41. package/dist/tools/stakeholders.js +51 -17
  42. package/dist/tools/stakeholders.js.map +1 -1
  43. package/dist/tools/valuations.d.ts.map +1 -1
  44. package/dist/tools/valuations.js +30 -17
  45. package/dist/tools/valuations.js.map +1 -1
  46. package/dist/tools/waterfall.d.ts.map +1 -1
  47. package/dist/tools/waterfall.js +7 -16
  48. package/dist/tools/waterfall.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/auth.ts +7 -1
  51. package/src/client.ts +23 -6
  52. package/src/schema.ts +28 -0
  53. package/src/server.ts +5 -1
  54. package/src/tools/dilution.ts +12 -13
  55. package/src/tools/documents.ts +3 -2
  56. package/src/tools/equityGrants.ts +154 -0
  57. package/src/tools/equityPlans.ts +30 -21
  58. package/src/tools/financialReports.ts +37 -17
  59. package/src/tools/meta.ts +169 -0
  60. package/src/tools/safes.ts +59 -42
  61. package/src/tools/shareClasses.ts +34 -23
  62. package/src/tools/stakeholders.ts +51 -17
  63. package/src/tools/valuations.ts +29 -20
  64. package/src/tools/waterfall.ts +13 -16
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { coerceInt, coerceFloat } from '../schema.js';
2
3
  import { type ToolDefinition } from '../types.js';
3
4
 
4
5
  export const valuationTools: ToolDefinition[] = [
@@ -10,10 +11,9 @@ export const valuationTools: ToolDefinition[] = [
10
11
  companyId: z.string().describe('Company ID'),
11
12
  }),
12
13
  handler: async (input, client) => {
13
- const { data } = await client.get(
14
- `/api/v1/valuations/latest`,
15
- { params: { companyId: input.companyId } }
16
- );
14
+ const { data } = await client.get('/api/v1/valuations/latest', {
15
+ params: { companyId: input.companyId },
16
+ });
17
17
  return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
18
18
  },
19
19
  },
@@ -22,7 +22,7 @@ export const valuationTools: ToolDefinition[] = [
22
22
  description: 'Get the historical valuation timeline for the company.',
23
23
  inputSchema: z.object({
24
24
  companyId: z.string().describe('Company ID'),
25
- limit: z.number().optional().default(20).describe('Max results to return'),
25
+ limit: coerceInt('Max results to return').optional().default(20),
26
26
  }),
27
27
  handler: async (input, client) => {
28
28
  const { data } = await client.get('/api/v1/valuations', { params: input });
@@ -42,15 +42,8 @@ export const valuationTools: ToolDefinition[] = [
42
42
  .enum(['409A', 'board_approved', 'preferred_round', 'other'])
43
43
  .describe('Type of valuation'),
44
44
  valuationDate: z.string().describe('Effective date in ISO 8601 format (YYYY-MM-DD)'),
45
- commonStockFMV: z
46
- .union([z.number(), z.string()])
47
- .transform((v) => parseFloat(String(v)))
48
- .describe('Fair market value per common share in USD'),
49
- postMoneyValuation: z
50
- .union([z.number(), z.string()])
51
- .transform((v) => parseFloat(String(v)))
52
- .optional()
53
- .describe('Total post-money company valuation in USD'),
45
+ commonStockFMV: coerceFloat('Fair market value per common share in USD'),
46
+ postMoneyValuation: coerceFloat('Total post-money company valuation in USD').optional(),
54
47
  provider: z
55
48
  .string()
56
49
  .optional()
@@ -62,12 +55,28 @@ export const valuationTools: ToolDefinition[] = [
62
55
  .describe('URL to the valuation report document'),
63
56
  }),
64
57
  handler: async (input, client) => {
65
- const { data } = await client.post('/api/v1/valuations', input);
66
- return {
67
- content: [
68
- { type: 'text', text: `Valuation recorded: ${JSON.stringify(data, null, 2)}` },
69
- ],
70
- };
58
+ const { data: created } = await client.post('/api/v1/valuations', input);
59
+ const id = created.row_id ?? created._id;
60
+ try {
61
+ const { data: confirmed } = await client.get(`/api/v1/valuations/${id}`);
62
+ return {
63
+ content: [
64
+ {
65
+ type: 'text',
66
+ text: `Valuation recorded:\n${JSON.stringify(confirmed, null, 2)}\n\nID for follow-up operations: ${id}`,
67
+ },
68
+ ],
69
+ };
70
+ } catch {
71
+ return {
72
+ content: [
73
+ {
74
+ type: 'text',
75
+ text: `Valuation recorded (could not confirm persisted state — verify with get_valuation_history):\n${JSON.stringify(created, null, 2)}`,
76
+ },
77
+ ],
78
+ };
79
+ }
71
80
  },
72
81
  },
73
82
  ];
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { coerceFloat, coerceBool } from '../schema.js';
2
3
  import { type ToolDefinition } from '../types.js';
3
4
 
4
5
  export const waterfallTools: ToolDefinition[] = [
@@ -10,29 +11,25 @@ export const waterfallTools: ToolDefinition[] = [
10
11
  'Returns proceeds per stakeholder and per share class at the given exit amount.',
11
12
  inputSchema: z.object({
12
13
  companyId: z.string().describe('Company ID'),
13
- exitAmount: z
14
- .number()
15
- .positive()
16
- .describe('Total exit/acquisition proceeds in USD'),
14
+ exitAmount: coerceFloat('Total exit/acquisition proceeds in USD'),
17
15
  exitType: z
18
16
  .enum(['acquisition', 'ipo', 'dissolution'])
19
17
  .optional()
20
18
  .default('acquisition')
21
19
  .describe('Type of exit event'),
22
- deductTransactionCosts: z
23
- .boolean()
20
+ deductTransactionCosts: coerceBool(
21
+ 'Whether to deduct estimated transaction costs before distribution'
22
+ )
24
23
  .optional()
25
- .default(false)
26
- .describe('Whether to deduct estimated transaction costs before distribution'),
27
- transactionCostsAmount: z
28
- .number()
24
+ .default(false),
25
+ transactionCostsAmount: coerceFloat(
26
+ 'Transaction costs amount in USD (used if deductTransactionCosts is true)'
27
+ ).optional(),
28
+ includeOptionPoolSweep: coerceBool(
29
+ 'Whether to include pre-exit option pool sweep'
30
+ )
29
31
  .optional()
30
- .describe('Transaction costs amount in USD (used if deductTransactionCosts is true)'),
31
- includeOptionPoolSweep: z
32
- .boolean()
33
- .optional()
34
- .default(false)
35
- .describe('Whether to include pre-exit option pool sweep'),
32
+ .default(false),
36
33
  asOfDate: z
37
34
  .string()
38
35
  .optional()