@trustpager/mcp-server 1.0.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 (61) hide show
  1. package/dist/index.d.ts +22 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +149 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/tools/activities.d.ts +7 -0
  6. package/dist/tools/activities.d.ts.map +1 -0
  7. package/dist/tools/activities.js +109 -0
  8. package/dist/tools/activities.js.map +1 -0
  9. package/dist/tools/ai.d.ts +7 -0
  10. package/dist/tools/ai.d.ts.map +1 -0
  11. package/dist/tools/ai.js +105 -0
  12. package/dist/tools/ai.js.map +1 -0
  13. package/dist/tools/automations.d.ts +7 -0
  14. package/dist/tools/automations.d.ts.map +1 -0
  15. package/dist/tools/automations.js +190 -0
  16. package/dist/tools/automations.js.map +1 -0
  17. package/dist/tools/communications.d.ts +7 -0
  18. package/dist/tools/communications.d.ts.map +1 -0
  19. package/dist/tools/communications.js +141 -0
  20. package/dist/tools/communications.js.map +1 -0
  21. package/dist/tools/contacts.d.ts +7 -0
  22. package/dist/tools/contacts.d.ts.map +1 -0
  23. package/dist/tools/contacts.js +125 -0
  24. package/dist/tools/contacts.js.map +1 -0
  25. package/dist/tools/customers.d.ts +7 -0
  26. package/dist/tools/customers.d.ts.map +1 -0
  27. package/dist/tools/customers.js +83 -0
  28. package/dist/tools/customers.js.map +1 -0
  29. package/dist/tools/deals.d.ts +7 -0
  30. package/dist/tools/deals.d.ts.map +1 -0
  31. package/dist/tools/deals.js +264 -0
  32. package/dist/tools/deals.js.map +1 -0
  33. package/dist/tools/documents.d.ts +7 -0
  34. package/dist/tools/documents.d.ts.map +1 -0
  35. package/dist/tools/documents.js +173 -0
  36. package/dist/tools/documents.js.map +1 -0
  37. package/dist/tools/forms.d.ts +7 -0
  38. package/dist/tools/forms.d.ts.map +1 -0
  39. package/dist/tools/forms.js +179 -0
  40. package/dist/tools/forms.js.map +1 -0
  41. package/dist/tools/pipelines.d.ts +7 -0
  42. package/dist/tools/pipelines.d.ts.map +1 -0
  43. package/dist/tools/pipelines.js +207 -0
  44. package/dist/tools/pipelines.js.map +1 -0
  45. package/dist/tools/platform.d.ts +7 -0
  46. package/dist/tools/platform.d.ts.map +1 -0
  47. package/dist/tools/platform.js +188 -0
  48. package/dist/tools/platform.js.map +1 -0
  49. package/dist/tools/products.d.ts +7 -0
  50. package/dist/tools/products.d.ts.map +1 -0
  51. package/dist/tools/products.js +105 -0
  52. package/dist/tools/products.js.map +1 -0
  53. package/dist/tools/tasks.d.ts +7 -0
  54. package/dist/tools/tasks.d.ts.map +1 -0
  55. package/dist/tools/tasks.js +130 -0
  56. package/dist/tools/tasks.js.map +1 -0
  57. package/dist/utils/api-client.d.ts +40 -0
  58. package/dist/utils/api-client.d.ts.map +1 -0
  59. package/dist/utils/api-client.js +98 -0
  60. package/dist/utils/api-client.js.map +1 -0
  61. package/package.json +44 -0
@@ -0,0 +1,179 @@
1
+ import { apiRequest, formatResponse, buildQuery, generateIdempotencyKey } from '../utils/api-client.js';
2
+ export const formTools = [
3
+ {
4
+ name: 'list_form_templates',
5
+ description: 'List all form templates.',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {
9
+ limit: { type: 'number', description: 'Items per page (default 25, max 100)' },
10
+ after: { type: 'string', description: 'Cursor: get items after this ID' },
11
+ },
12
+ },
13
+ },
14
+ {
15
+ name: 'get_form_template',
16
+ description: 'Get a form template by ID with its fields inline.',
17
+ inputSchema: {
18
+ type: 'object',
19
+ properties: {
20
+ id: { type: 'string', description: 'Form template UUID' },
21
+ },
22
+ required: ['id'],
23
+ },
24
+ },
25
+ {
26
+ name: 'create_form_template',
27
+ description: 'Create a new form template.',
28
+ inputSchema: {
29
+ type: 'object',
30
+ properties: {
31
+ name: { type: 'string', description: 'Form template name (required)' },
32
+ description: { type: 'string', description: 'Form template description' },
33
+ },
34
+ required: ['name'],
35
+ },
36
+ },
37
+ {
38
+ name: 'add_form_field',
39
+ description: 'Add a field to a form template.',
40
+ inputSchema: {
41
+ type: 'object',
42
+ properties: {
43
+ templateId: { type: 'string', description: 'Form template UUID' },
44
+ type: {
45
+ type: 'string',
46
+ description: 'Field type (required). Options: text, textarea, number, date, select, checkbox, radio, file',
47
+ },
48
+ label: { type: 'string', description: 'Field label (required)' },
49
+ placeholder: { type: 'string', description: 'Placeholder text' },
50
+ is_required: { type: 'boolean', description: 'Whether the field is required' },
51
+ order_index: { type: 'number', description: 'Display order' },
52
+ step_number: { type: 'number', description: 'Multi-step form: which step this field belongs to' },
53
+ content: {
54
+ type: 'object',
55
+ description: 'Field content config. For select/checkbox/radio: { options: string[] }',
56
+ },
57
+ },
58
+ required: ['templateId', 'type', 'label'],
59
+ },
60
+ },
61
+ {
62
+ name: 'update_form_field',
63
+ description: 'Update a field on a form template. Only include fields you want to change.',
64
+ inputSchema: {
65
+ type: 'object',
66
+ properties: {
67
+ templateId: { type: 'string', description: 'Form template UUID' },
68
+ fieldId: { type: 'string', description: 'Field UUID' },
69
+ type: { type: 'string' },
70
+ label: { type: 'string' },
71
+ placeholder: { type: 'string' },
72
+ is_required: { type: 'boolean' },
73
+ order_index: { type: 'number' },
74
+ step_number: { type: 'number' },
75
+ content: { type: 'object' },
76
+ },
77
+ required: ['templateId', 'fieldId'],
78
+ },
79
+ },
80
+ {
81
+ name: 'delete_form_field',
82
+ description: 'Delete a field from a form template.',
83
+ inputSchema: {
84
+ type: 'object',
85
+ properties: {
86
+ templateId: { type: 'string', description: 'Form template UUID' },
87
+ fieldId: { type: 'string', description: 'Field UUID' },
88
+ },
89
+ required: ['templateId', 'fieldId'],
90
+ },
91
+ },
92
+ {
93
+ name: 'send_form',
94
+ description: 'Send a form to a recipient via email. Costs 3 credits.',
95
+ inputSchema: {
96
+ type: 'object',
97
+ properties: {
98
+ template_id: { type: 'string', description: 'Form template UUID (required)' },
99
+ recipient_email: { type: 'string', description: 'Recipient email address (required)' },
100
+ recipient_name: { type: 'string', description: 'Recipient display name (required)' },
101
+ deal_id: { type: 'string', description: 'Link to a deal UUID' },
102
+ personal_message: { type: 'string', description: 'Personal message included in the email' },
103
+ expires_in_days: { type: 'number', description: 'Number of days before the form link expires' },
104
+ },
105
+ required: ['template_id', 'recipient_email', 'recipient_name'],
106
+ },
107
+ },
108
+ {
109
+ name: 'list_form_submissions',
110
+ description: 'List form submissions with optional filters.',
111
+ inputSchema: {
112
+ type: 'object',
113
+ properties: {
114
+ template_id: { type: 'string', description: 'Filter by form template UUID' },
115
+ deal_id: { type: 'string', description: 'Filter by deal UUID' },
116
+ contact_id: { type: 'string', description: 'Filter by contact UUID' },
117
+ status: { type: 'string', description: 'Filter by status' },
118
+ limit: { type: 'number', description: 'Items per page (default 25, max 100)' },
119
+ after: { type: 'string', description: 'Cursor: get items after this ID' },
120
+ },
121
+ },
122
+ },
123
+ {
124
+ name: 'delete_form_template',
125
+ description: 'Permanently delete a form template.',
126
+ inputSchema: {
127
+ type: 'object',
128
+ properties: { id: { type: 'string', description: 'Form template UUID' } },
129
+ required: ['id'],
130
+ },
131
+ },
132
+ ];
133
+ export async function handleFormTool(name, args) {
134
+ switch (name) {
135
+ case 'list_form_templates': {
136
+ const { limit, after } = args;
137
+ const query = buildQuery({ limit: limit, after: after });
138
+ return formatResponse(await apiRequest('GET', `/forms/templates${query}`));
139
+ }
140
+ case 'get_form_template':
141
+ return formatResponse(await apiRequest('GET', `/forms/templates/${args.id}`));
142
+ case 'create_form_template': {
143
+ const { id: _, ...body } = args;
144
+ return formatResponse(await apiRequest('POST', '/forms/templates', body, generateIdempotencyKey()));
145
+ }
146
+ case 'add_form_field': {
147
+ const { templateId, ...body } = args;
148
+ return formatResponse(await apiRequest('POST', `/forms/templates/${templateId}/fields`, body, generateIdempotencyKey()));
149
+ }
150
+ case 'update_form_field': {
151
+ const { templateId, fieldId, ...body } = args;
152
+ return formatResponse(await apiRequest('PATCH', `/forms/templates/${templateId}/fields/${fieldId}`, body));
153
+ }
154
+ case 'delete_form_field': {
155
+ const { templateId, fieldId } = args;
156
+ return formatResponse(await apiRequest('DELETE', `/forms/templates/${templateId}/fields/${fieldId}`));
157
+ }
158
+ case 'send_form': {
159
+ return formatResponse(await apiRequest('POST', '/forms/send', args, generateIdempotencyKey()));
160
+ }
161
+ case 'list_form_submissions': {
162
+ const { template_id, deal_id, contact_id, status, limit, after } = args;
163
+ const query = buildQuery({
164
+ template_id: template_id,
165
+ deal_id: deal_id,
166
+ contact_id: contact_id,
167
+ status: status,
168
+ limit: limit,
169
+ after: after,
170
+ });
171
+ return formatResponse(await apiRequest('GET', `/forms/submissions${query}`));
172
+ }
173
+ case 'delete_form_template':
174
+ return formatResponse(await apiRequest('DELETE', `/forms/templates/${args.id}`));
175
+ default:
176
+ return { text: `Unknown form tool: ${name}`, isError: true };
177
+ }
178
+ }
179
+ //# sourceMappingURL=forms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forms.js","sourceRoot":"","sources":["../../src/tools/forms.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAExG,MAAM,CAAC,MAAM,SAAS,GAAW;IAC/B;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,0BAA0B;QACvC,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;gBAC9E,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iCAAiC,EAAE;aAC1E;SACF;KACF;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,mDAAmD;QAChE,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;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lePipelineTool(name: string, args: Record<string, unknown>): Promise<{
4
+ text: string;
5
+ isError: boolean;
6
+ }>;
7
+ //# sourceMappingURL=pipelines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipelines.d.ts","sourceRoot":"","sources":["../../src/tools/pipelines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,aAAa,EAAE,IAAI,EAgJ/B,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;GA2DnF"}
@@ -0,0 +1,207 @@
1
+ import { apiRequest, formatResponse, generateIdempotencyKey } from '../utils/api-client.js';
2
+ export const pipelineTools = [
3
+ {
4
+ name: 'list_pipelines',
5
+ description: 'List all sales pipelines. Each pipeline contains stages that deals move through.',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {},
9
+ },
10
+ },
11
+ {
12
+ name: 'get_pipeline',
13
+ description: 'Get a single pipeline by ID with full details.',
14
+ inputSchema: {
15
+ type: 'object',
16
+ properties: {
17
+ id: { type: 'string', description: 'Pipeline UUID' },
18
+ },
19
+ required: ['id'],
20
+ },
21
+ },
22
+ {
23
+ name: 'create_pipeline',
24
+ description: 'Create a new sales pipeline.',
25
+ inputSchema: {
26
+ type: 'object',
27
+ properties: {
28
+ name: { type: 'string', description: 'Pipeline name (required)' },
29
+ description: { type: 'string', description: 'Pipeline description' },
30
+ },
31
+ required: ['name'],
32
+ },
33
+ },
34
+ {
35
+ name: 'update_pipeline',
36
+ description: 'Update an existing pipeline. Only include fields you want to change.',
37
+ inputSchema: {
38
+ type: 'object',
39
+ properties: {
40
+ id: { type: 'string', description: 'Pipeline UUID' },
41
+ name: { type: 'string' },
42
+ description: { type: 'string' },
43
+ },
44
+ required: ['id'],
45
+ },
46
+ },
47
+ {
48
+ name: 'delete_pipeline',
49
+ description: 'Permanently delete a pipeline. All deals in the pipeline will be unlinked from it.',
50
+ inputSchema: {
51
+ type: 'object',
52
+ properties: { id: { type: 'string', description: 'Pipeline UUID' } },
53
+ required: ['id'],
54
+ },
55
+ },
56
+ {
57
+ name: 'list_pipeline_stages',
58
+ description: 'List stages in a pipeline, ordered by position. Use stage IDs with move_deal.',
59
+ inputSchema: {
60
+ type: 'object',
61
+ properties: {
62
+ pipeline_id: { type: 'string', description: 'Pipeline UUID' },
63
+ },
64
+ required: ['pipeline_id'],
65
+ },
66
+ },
67
+ {
68
+ name: 'create_pipeline_stage',
69
+ description: 'Create a new stage in a pipeline.',
70
+ inputSchema: {
71
+ type: 'object',
72
+ properties: {
73
+ pipeline_id: { type: 'string', description: 'Pipeline UUID' },
74
+ name: { type: 'string', description: 'Stage name (required)' },
75
+ position: { type: 'number', description: 'Position in the pipeline (0-based)' },
76
+ color: { type: 'string', description: 'Stage color (hex code or name)' },
77
+ is_won_stage: { type: 'boolean', description: 'Mark as the winning/closed-won stage' },
78
+ is_lost_stage: { type: 'boolean', description: 'Mark as the lost/closed-lost stage' },
79
+ },
80
+ required: ['pipeline_id', 'name'],
81
+ },
82
+ },
83
+ {
84
+ name: 'update_pipeline_stage',
85
+ description: 'Update an existing pipeline stage. Only include fields you want to change.',
86
+ inputSchema: {
87
+ type: 'object',
88
+ properties: {
89
+ pipeline_id: { type: 'string', description: 'Pipeline UUID' },
90
+ stage_id: { type: 'string', description: 'Stage UUID' },
91
+ name: { type: 'string' },
92
+ position: { type: 'number' },
93
+ color: { type: 'string' },
94
+ is_won_stage: { type: 'boolean' },
95
+ is_lost_stage: { type: 'boolean' },
96
+ },
97
+ required: ['pipeline_id', 'stage_id'],
98
+ },
99
+ },
100
+ {
101
+ name: 'delete_pipeline_stage',
102
+ description: 'Permanently delete a pipeline stage. Deals in this stage will need to be moved.',
103
+ inputSchema: {
104
+ type: 'object',
105
+ properties: {
106
+ pipeline_id: { type: 'string', description: 'Pipeline UUID' },
107
+ stage_id: { type: 'string', description: 'Stage UUID' },
108
+ },
109
+ required: ['pipeline_id', 'stage_id'],
110
+ },
111
+ },
112
+ {
113
+ name: 'reorder_pipeline_stages',
114
+ description: 'Reorder stages in a pipeline by providing the full ordered list of stage IDs.',
115
+ inputSchema: {
116
+ type: 'object',
117
+ properties: {
118
+ pipeline_id: { type: 'string', description: 'Pipeline UUID' },
119
+ stage_ids: { type: 'array', items: { type: 'string' }, description: 'Ordered array of all stage UUIDs in desired order' },
120
+ },
121
+ required: ['pipeline_id', 'stage_ids'],
122
+ },
123
+ },
124
+ {
125
+ name: 'get_pipeline_summary',
126
+ description: 'Get deal count and total value per stage — overview of pipeline performance.',
127
+ inputSchema: {
128
+ type: 'object',
129
+ properties: {
130
+ id: { type: 'string', description: 'Pipeline UUID' },
131
+ },
132
+ required: ['id'],
133
+ },
134
+ },
135
+ {
136
+ name: 'get_pipeline_deals',
137
+ description: 'Get all deals in a specific pipeline.',
138
+ inputSchema: {
139
+ type: 'object',
140
+ properties: {
141
+ id: { type: 'string', description: 'Pipeline UUID' },
142
+ },
143
+ required: ['id'],
144
+ },
145
+ },
146
+ ];
147
+ export async function handlePipelineTool(name, args) {
148
+ switch (name) {
149
+ case 'list_pipelines': {
150
+ const res = await apiRequest('GET', '/pipelines');
151
+ return formatResponse(res);
152
+ }
153
+ case 'get_pipeline': {
154
+ const res = await apiRequest('GET', `/pipelines/${args.id}`);
155
+ return formatResponse(res);
156
+ }
157
+ case 'create_pipeline': {
158
+ const { id: _, ...body } = args;
159
+ const res = await apiRequest('POST', '/pipelines', body, generateIdempotencyKey());
160
+ return formatResponse(res);
161
+ }
162
+ case 'update_pipeline': {
163
+ const { id, ...body } = args;
164
+ const res = await apiRequest('PATCH', `/pipelines/${id}`, body);
165
+ return formatResponse(res);
166
+ }
167
+ case 'delete_pipeline': {
168
+ const res = await apiRequest('DELETE', `/pipelines/${args.id}`);
169
+ return formatResponse(res);
170
+ }
171
+ case 'list_pipeline_stages': {
172
+ const res = await apiRequest('GET', `/pipelines/${args.pipeline_id}/stages`);
173
+ return formatResponse(res);
174
+ }
175
+ case 'create_pipeline_stage': {
176
+ const { pipeline_id, ...body } = args;
177
+ const res = await apiRequest('POST', `/pipelines/${pipeline_id}/stages`, body, generateIdempotencyKey());
178
+ return formatResponse(res);
179
+ }
180
+ case 'update_pipeline_stage': {
181
+ const { pipeline_id, stage_id, ...body } = args;
182
+ const res = await apiRequest('PATCH', `/pipelines/${pipeline_id}/stages/${stage_id}`, body);
183
+ return formatResponse(res);
184
+ }
185
+ case 'delete_pipeline_stage': {
186
+ const res = await apiRequest('DELETE', `/pipelines/${args.pipeline_id}/stages/${args.stage_id}`);
187
+ return formatResponse(res);
188
+ }
189
+ case 'reorder_pipeline_stages': {
190
+ const res = await apiRequest('POST', `/pipelines/${args.pipeline_id}/stages/reorder`, {
191
+ stage_ids: args.stage_ids,
192
+ }, generateIdempotencyKey());
193
+ return formatResponse(res);
194
+ }
195
+ case 'get_pipeline_summary': {
196
+ const res = await apiRequest('GET', `/pipelines/${args.id}/summary`);
197
+ return formatResponse(res);
198
+ }
199
+ case 'get_pipeline_deals': {
200
+ const res = await apiRequest('GET', `/pipelines/${args.id}/deals`);
201
+ return formatResponse(res);
202
+ }
203
+ default:
204
+ return { text: `Unknown pipeline tool: ${name}`, isError: true };
205
+ }
206
+ }
207
+ //# sourceMappingURL=pipelines.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipelines.js","sourceRoot":"","sources":["../../src/tools/pipelines.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAc,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAExG,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,kFAAkF;QAC/F,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;KACF;IACD;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,gD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,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,sBAAsB,CAAC,CAAC,CAAC;YAC5B,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,cAAc,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;YACrE,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,oBAAoB,CAAC,CAAC,CAAC;YAC1B,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,cAAc,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;YACnE,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD;YACE,OAAO,EAAE,IAAI,EAAE,0BAA0B,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACrE,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ export declare const platformTools: Tool[];
3
+ export declare function handlePlatformTool(name: string, args: Record<string, unknown>): Promise<{
4
+ text: string;
5
+ isError: boolean;
6
+ }>;
7
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/tools/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,aAAa,EAAE,IAAI,EA+H/B,CAAC;AAEF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;GAyDnF"}
@@ -0,0 +1,188 @@
1
+ import { apiRequest, formatResponse, generateIdempotencyKey } from '../utils/api-client.js';
2
+ export const platformTools = [
3
+ {
4
+ name: 'get_company',
5
+ description: 'Get company details including name, branding, timezone, industry.',
6
+ inputSchema: {
7
+ type: 'object',
8
+ properties: {},
9
+ },
10
+ },
11
+ {
12
+ name: 'update_company',
13
+ description: 'Update company settings. Only include fields you want to change.',
14
+ inputSchema: {
15
+ type: 'object',
16
+ properties: {
17
+ name: { type: 'string', description: 'Company name' },
18
+ industry: { type: 'string', description: 'Industry' },
19
+ timezone: { type: 'string', description: 'Timezone (e.g. Australia/Sydney)' },
20
+ website: { type: 'string', description: 'Company website URL' },
21
+ phone: { type: 'string', description: 'Company phone number' },
22
+ address: { type: 'string', description: 'Company address' },
23
+ logo_url: { type: 'string', description: 'Logo URL' },
24
+ primary_color: { type: 'string', description: 'Primary brand colour hex code' },
25
+ },
26
+ },
27
+ },
28
+ {
29
+ name: 'get_crm_settings',
30
+ description: 'Get CRM configuration: custom fields, lead sources, lost/won reasons.',
31
+ inputSchema: {
32
+ type: 'object',
33
+ properties: {},
34
+ },
35
+ },
36
+ {
37
+ name: 'update_crm_settings',
38
+ description: 'Update CRM configuration. Only include settings you want to change.',
39
+ inputSchema: {
40
+ type: 'object',
41
+ properties: {
42
+ custom_fields: { type: 'object', description: 'Custom field definitions' },
43
+ lead_sources: { type: 'array', items: { type: 'string' }, description: 'Available lead sources' },
44
+ lost_reasons: { type: 'array', items: { type: 'string' }, description: 'Available lost reasons' },
45
+ won_reasons: { type: 'array', items: { type: 'string' }, description: 'Available won reasons' },
46
+ },
47
+ },
48
+ },
49
+ {
50
+ name: 'list_company_users',
51
+ description: 'List all users in the company with their roles.',
52
+ inputSchema: {
53
+ type: 'object',
54
+ properties: {},
55
+ },
56
+ },
57
+ {
58
+ name: 'invite_user',
59
+ description: 'Invite a new user to the company.',
60
+ inputSchema: {
61
+ type: 'object',
62
+ properties: {
63
+ email: { type: 'string', description: 'Email address to invite (required)' },
64
+ role: { type: 'string', description: 'Role to assign (required)' },
65
+ full_name: { type: 'string', description: 'Full name of the invitee' },
66
+ },
67
+ required: ['email', 'role'],
68
+ },
69
+ },
70
+ {
71
+ name: 'list_websites',
72
+ description: 'List all websites/landing pages for the company.',
73
+ inputSchema: {
74
+ type: 'object',
75
+ properties: {},
76
+ },
77
+ },
78
+ {
79
+ name: 'get_website',
80
+ description: 'Get a single website by ID with full configuration.',
81
+ inputSchema: {
82
+ type: 'object',
83
+ properties: {
84
+ id: { type: 'string', description: 'Website UUID' },
85
+ },
86
+ required: ['id'],
87
+ },
88
+ },
89
+ {
90
+ name: 'update_website',
91
+ description: 'Update website settings (branding, navbar, footer, SEO, scripts).',
92
+ inputSchema: {
93
+ type: 'object',
94
+ properties: {
95
+ id: { type: 'string', description: 'Website UUID (required)' },
96
+ branding: { type: 'object', description: 'Branding settings' },
97
+ navbar: { type: 'object', description: 'Navbar configuration' },
98
+ footer: { type: 'object', description: 'Footer configuration' },
99
+ seo: { type: 'object', description: 'SEO meta tags and settings' },
100
+ scripts: { type: 'object', description: 'Custom scripts (head, body)' },
101
+ },
102
+ required: ['id'],
103
+ },
104
+ },
105
+ {
106
+ name: 'list_integrations',
107
+ description: 'List all configured integrations for the company.',
108
+ inputSchema: {
109
+ type: 'object',
110
+ properties: {},
111
+ },
112
+ },
113
+ {
114
+ name: 'get_credit_balance',
115
+ description: 'Check remaining credit balance.',
116
+ inputSchema: {
117
+ type: 'object',
118
+ properties: {},
119
+ },
120
+ },
121
+ {
122
+ name: 'get_billing_plan',
123
+ description: 'Get current subscription plan details.',
124
+ inputSchema: {
125
+ type: 'object',
126
+ properties: {},
127
+ },
128
+ },
129
+ ];
130
+ export async function handlePlatformTool(name, args) {
131
+ switch (name) {
132
+ case 'get_company': {
133
+ const res = await apiRequest('GET', '/company');
134
+ return formatResponse(res);
135
+ }
136
+ case 'update_company': {
137
+ const res = await apiRequest('PATCH', '/company', args);
138
+ return formatResponse(res);
139
+ }
140
+ case 'get_crm_settings': {
141
+ const res = await apiRequest('GET', '/company/crm-settings');
142
+ return formatResponse(res);
143
+ }
144
+ case 'update_crm_settings': {
145
+ const res = await apiRequest('PATCH', '/company/crm-settings', args);
146
+ return formatResponse(res);
147
+ }
148
+ case 'list_company_users': {
149
+ const res = await apiRequest('GET', '/company/users');
150
+ return formatResponse(res);
151
+ }
152
+ case 'invite_user': {
153
+ const { email, role, full_name } = args;
154
+ const res = await apiRequest('POST', '/company/users/invite', {
155
+ email, role, full_name,
156
+ }, generateIdempotencyKey());
157
+ return formatResponse(res);
158
+ }
159
+ case 'list_websites': {
160
+ const res = await apiRequest('GET', '/websites');
161
+ return formatResponse(res);
162
+ }
163
+ case 'get_website': {
164
+ const res = await apiRequest('GET', `/websites/${args.id}`);
165
+ return formatResponse(res);
166
+ }
167
+ case 'update_website': {
168
+ const { id, ...body } = args;
169
+ const res = await apiRequest('PATCH', `/websites/${id}`, body);
170
+ return formatResponse(res);
171
+ }
172
+ case 'list_integrations': {
173
+ const res = await apiRequest('GET', '/integrations');
174
+ return formatResponse(res);
175
+ }
176
+ case 'get_credit_balance': {
177
+ const res = await apiRequest('GET', '/billing/balance');
178
+ return formatResponse(res);
179
+ }
180
+ case 'get_billing_plan': {
181
+ const res = await apiRequest('GET', '/billing/plan');
182
+ return formatResponse(res);
183
+ }
184
+ default:
185
+ return { text: `Unknown platform tool: ${name}`, isError: true };
186
+ }
187
+ }
188
+ //# sourceMappingURL=platform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/tools/platform.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAc,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAExG,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,mEAAmE;QAChF,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;KACF;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,kEAAkE;QAC/E,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;gBACrD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AI,CAAC;YAC7B,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YAC/D,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,mBAAmB,CAAC,CAAC,CAAC;YACzB,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;YACrD,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,oBAAoB,CAAC,CAAC,CAAC;YAC1B,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;YACxD,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD,KAAK,kBAAkB,CAAC,CAAC,CAAC;YACxB,MAAM,GAAG,GAAG,MAAM,UAAU,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;YACrD,OAAO,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC;QACD;YACE,OAAO,EAAE,IAAI,EAAE,0BAA0B,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IACrE,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ export declare const productTools: Tool[];
3
+ export declare function handleProductTool(name: string, args: Record<string, unknown>): Promise<{
4
+ text: string;
5
+ isError: boolean;
6
+ }>;
7
+ //# sourceMappingURL=products.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/tools/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAG1D,eAAO,MAAM,YAAY,EAAE,IAAI,EAuE9B,CAAC;AAEF,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;GA8BlF"}