@trustpager/mcp-server 1.1.47 → 1.1.48
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.
- package/dist/tools/ai.js +30 -30
- package/dist/tools/ai.js.map +1 -1
- package/package.json +1 -1
package/dist/tools/ai.js
CHANGED
|
@@ -2,14 +2,13 @@ import { apiRequest, formatResponse, generateIdempotencyKey } from '../utils/api
|
|
|
2
2
|
export const aiTools = [
|
|
3
3
|
{
|
|
4
4
|
name: 'ai_enrich',
|
|
5
|
-
description: '
|
|
5
|
+
description: 'Enrich a deal\'s primary contact and customer with AI web research -- finds company info, social profiles, job details, and industry data. Costs 5 credits. Provide a deal_id; the system resolves the linked contact and customer automatically.',
|
|
6
6
|
inputSchema: {
|
|
7
7
|
type: 'object',
|
|
8
8
|
properties: {
|
|
9
|
-
|
|
10
|
-
entity_id: { type: 'string', description: 'UUID of the contact or customer (required)' },
|
|
9
|
+
deal_id: { type: 'string', description: 'Deal UUID (required). The system finds the deal\'s primary contact and customer and enriches them.' },
|
|
11
10
|
},
|
|
12
|
-
required: ['
|
|
11
|
+
required: ['deal_id'],
|
|
13
12
|
},
|
|
14
13
|
},
|
|
15
14
|
{
|
|
@@ -20,7 +19,7 @@ export const aiTools = [
|
|
|
20
19
|
properties: {
|
|
21
20
|
text: { type: 'string', description: 'The text to edit (required)' },
|
|
22
21
|
instruction: { type: 'string', description: 'What to do with the text, e.g. "make it more professional" (required)' },
|
|
23
|
-
|
|
22
|
+
writingStyle: { type: 'string', description: 'Writing style ID (optional, e.g. "formal", "casual", "persuasive")' },
|
|
24
23
|
},
|
|
25
24
|
required: ['text', 'instruction'],
|
|
26
25
|
},
|
|
@@ -52,41 +51,42 @@ export const aiTools = [
|
|
|
52
51
|
},
|
|
53
52
|
{
|
|
54
53
|
name: 'ai_generate_pipeline',
|
|
55
|
-
description: 'Auto-generate a complete sales pipeline with stages from a text description. Costs 3 credits. Describe your sales process and optionally
|
|
54
|
+
description: 'Auto-generate a complete sales pipeline with stages from a text description. Costs 3 credits. Describe your sales process and optionally add business_type, industry, success_criteria, lost_criteria, or additional_context for tailored results.',
|
|
56
55
|
inputSchema: {
|
|
57
56
|
type: 'object',
|
|
58
57
|
properties: {
|
|
59
58
|
description: { type: 'string', description: 'Description of the sales process (required)' },
|
|
60
|
-
|
|
59
|
+
business_type: { type: 'string', description: 'Type of business (optional, e.g. "B2B SaaS", "retail")' },
|
|
60
|
+
industry: { type: 'string', description: 'Industry for tailored stage suggestions (optional)' },
|
|
61
|
+
success_criteria: { type: 'string', description: 'What makes a deal "won" (optional)' },
|
|
62
|
+
lost_criteria: { type: 'string', description: 'What makes a deal "lost" (optional)' },
|
|
63
|
+
additional_context: { type: 'string', description: 'Any other relevant context (optional)' },
|
|
61
64
|
},
|
|
62
65
|
required: ['description'],
|
|
63
66
|
},
|
|
64
67
|
},
|
|
65
68
|
{
|
|
66
69
|
name: 'ai_needs_analysis',
|
|
67
|
-
description: '
|
|
70
|
+
description: 'Run an AI needs analysis on a deal -- extracts client requirements, pain points, and recommendations from all linked transcripts and activities. Costs credits. Provide deal_id; the system fetches all related data automatically.',
|
|
68
71
|
inputSchema: {
|
|
69
72
|
type: 'object',
|
|
70
73
|
properties: {
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
deal_id: { type: 'string', description: 'Deal UUID (required). The system fetches all related transcripts, contacts, and activities automatically.' },
|
|
75
|
+
master_prompt: { type: 'string', description: 'Optional custom instructions to guide the analysis focus.' },
|
|
73
76
|
},
|
|
74
|
-
required: ['
|
|
77
|
+
required: ['deal_id'],
|
|
75
78
|
},
|
|
76
79
|
},
|
|
77
80
|
{
|
|
78
81
|
name: 'ai_fill_form',
|
|
79
|
-
description: 'Use AI to auto-fill a form template based on
|
|
82
|
+
description: 'Use AI to auto-fill a form template based on a prompt and optional context. Costs credits. Provide the form template ID and a prompt describing what to fill.',
|
|
80
83
|
inputSchema: {
|
|
81
84
|
type: 'object',
|
|
82
85
|
properties: {
|
|
83
|
-
template_id: { type: 'string', description: 'Form template UUID (required)' },
|
|
84
|
-
|
|
85
|
-
contact_id: { type: 'string', description: 'Contact UUID to pull context from' },
|
|
86
|
-
customer_id: { type: 'string', description: 'Customer UUID to pull context from' },
|
|
87
|
-
context: { type: 'string', description: 'Additional text context for the AI to use when filling the form' },
|
|
86
|
+
template_id: { type: 'string', description: 'Form template UUID (required). Use list_form_templates to find IDs.' },
|
|
87
|
+
prompt: { type: 'string', description: 'Instructions for filling the form, e.g. "Fill this incident report for a slip-and-fall at the warehouse on 28 March 2026" (required).' },
|
|
88
88
|
},
|
|
89
|
-
required: ['template_id'],
|
|
89
|
+
required: ['template_id', 'prompt'],
|
|
90
90
|
},
|
|
91
91
|
},
|
|
92
92
|
{
|
|
@@ -107,16 +107,16 @@ export const aiTools = [
|
|
|
107
107
|
export async function handleAiTool(name, args) {
|
|
108
108
|
switch (name) {
|
|
109
109
|
case 'ai_enrich': {
|
|
110
|
-
const {
|
|
110
|
+
const { deal_id } = args;
|
|
111
111
|
const res = await apiRequest('POST', '/ai/enrich', {
|
|
112
|
-
|
|
112
|
+
deal_id,
|
|
113
113
|
}, generateIdempotencyKey());
|
|
114
114
|
return formatResponse(res);
|
|
115
115
|
}
|
|
116
116
|
case 'ai_edit_text': {
|
|
117
|
-
const { text, instruction,
|
|
117
|
+
const { text, instruction, writingStyle } = args;
|
|
118
118
|
const res = await apiRequest('POST', '/ai/edit-text', {
|
|
119
|
-
text, instruction,
|
|
119
|
+
text, instruction, writingStyle,
|
|
120
120
|
}, generateIdempotencyKey());
|
|
121
121
|
return formatResponse(res);
|
|
122
122
|
}
|
|
@@ -128,30 +128,30 @@ export async function handleAiTool(name, args) {
|
|
|
128
128
|
return formatResponse(res);
|
|
129
129
|
}
|
|
130
130
|
case 'ai_call_coaching': {
|
|
131
|
-
const { transcript_id, transcript_text, team_member_name } = args;
|
|
131
|
+
const { transcript_id, transcript_text, team_member_name, source_type } = args;
|
|
132
132
|
const res = await apiRequest('POST', '/ai/call-coaching', {
|
|
133
|
-
transcript_id, transcript_text, team_member_name,
|
|
133
|
+
transcript_id, transcript_text, team_member_name, source_type,
|
|
134
134
|
}, generateIdempotencyKey());
|
|
135
135
|
return formatResponse(res);
|
|
136
136
|
}
|
|
137
137
|
case 'ai_generate_pipeline': {
|
|
138
|
-
const { description, industry } = args;
|
|
138
|
+
const { description, business_type, industry, success_criteria, lost_criteria, additional_context } = args;
|
|
139
139
|
const res = await apiRequest('POST', '/ai/generate-pipeline', {
|
|
140
|
-
description, industry,
|
|
140
|
+
description, business_type, industry, success_criteria, lost_criteria, additional_context,
|
|
141
141
|
}, generateIdempotencyKey());
|
|
142
142
|
return formatResponse(res);
|
|
143
143
|
}
|
|
144
144
|
case 'ai_needs_analysis': {
|
|
145
|
-
const {
|
|
145
|
+
const { deal_id, master_prompt } = args;
|
|
146
146
|
const res = await apiRequest('POST', '/ai/needs-analysis', {
|
|
147
|
-
|
|
147
|
+
deal_id, master_prompt,
|
|
148
148
|
}, generateIdempotencyKey());
|
|
149
149
|
return formatResponse(res);
|
|
150
150
|
}
|
|
151
151
|
case 'ai_fill_form': {
|
|
152
|
-
const { template_id,
|
|
152
|
+
const { template_id, prompt } = args;
|
|
153
153
|
const res = await apiRequest('POST', '/ai/fill-form', {
|
|
154
|
-
template_id,
|
|
154
|
+
template_id, prompt,
|
|
155
155
|
}, generateIdempotencyKey());
|
|
156
156
|
return formatResponse(res);
|
|
157
157
|
}
|
package/dist/tools/ai.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../../src/tools/ai.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAc,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAExG,MAAM,CAAC,MAAM,OAAO,GAAW;IAC7B;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../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