@vapi-ai/mcp-server 0.0.7 → 0.0.8
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/README.md +38 -2
- package/dist/schemas/index.d.ts +23 -10
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +11 -2
- package/dist/transformers/index.d.ts.map +1 -1
- package/dist/transformers/index.js +7 -2
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -77,6 +77,40 @@ I'd like to speak with my ShopHelper assistant to talk about my recent order. Ca
|
|
|
77
77
|
I need to schedule a call with Mary assistant for next Tuesday at 3:00 PM. My phone number is +1555123456.
|
|
78
78
|
```
|
|
79
79
|
|
|
80
|
+
**Example 3:** Make a call with dynamic variables
|
|
81
|
+
|
|
82
|
+
```md
|
|
83
|
+
I want to call +1234567890 with my appointment reminder assistant. Use these details:
|
|
84
|
+
- Customer name: Sarah Johnson
|
|
85
|
+
- Appointment date: March 25th
|
|
86
|
+
- Appointment time: 2:30 PM
|
|
87
|
+
- Doctor name: Dr. Smith
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Using Variable Values in Assistant Prompts
|
|
91
|
+
|
|
92
|
+
The `create_call` action supports passing dynamic variables through `assistantOverrides.variableValues`. These variables can be used in your assistant's prompts using double curly braces: `{{variableName}}`.
|
|
93
|
+
|
|
94
|
+
### Example Assistant Prompt with Variables
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Hello {{customerName}}, this is a reminder about your appointment on {{appointmentDate}} at {{appointmentTime}} with {{doctorName}}.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Default Variables
|
|
101
|
+
|
|
102
|
+
The following variables are automatically available (no need to pass in variableValues):
|
|
103
|
+
|
|
104
|
+
- `{{now}}` - Current date and time (UTC)
|
|
105
|
+
- `{{date}}` - Current date (UTC)
|
|
106
|
+
- `{{time}}` - Current time (UTC)
|
|
107
|
+
- `{{month}}` - Current month (UTC)
|
|
108
|
+
- `{{day}}` - Current day of month (UTC)
|
|
109
|
+
- `{{year}}` - Current year (UTC)
|
|
110
|
+
- `{{customer.number}}` - Customer's phone number
|
|
111
|
+
|
|
112
|
+
For more details on default variables and advanced date/time formatting, see the [official Vapi documentation](https://docs.vapi.ai/assistants/dynamic-variables#default-variables).
|
|
113
|
+
|
|
80
114
|
## Remote MCP
|
|
81
115
|
|
|
82
116
|
To connect to Vapi's MCP server remotely:
|
|
@@ -187,10 +221,12 @@ The Vapi MCP Server provides the following tools for integration:
|
|
|
187
221
|
### Call Tools
|
|
188
222
|
|
|
189
223
|
- `list_calls`: Lists all Vapi calls
|
|
190
|
-
- `create_call`: Creates an outbound call
|
|
224
|
+
- `create_call`: Creates an outbound call with support for:
|
|
225
|
+
- Immediate or scheduled calls
|
|
226
|
+
- Dynamic variable values through `assistantOverrides`
|
|
191
227
|
- `get_call`: Gets details of a specific call
|
|
192
228
|
|
|
193
|
-
> **Note:** The `create_call` action supports scheduling calls for immediate execution or for a future time.
|
|
229
|
+
> **Note:** The `create_call` action supports scheduling calls for immediate execution or for a future time. You can also pass dynamic variables using `assistantOverrides.variableValues` to personalize assistant messages.
|
|
194
230
|
|
|
195
231
|
### Phone Number Tools
|
|
196
232
|
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -371,27 +371,40 @@ export declare const CallInputSchema: z.ZodObject<{
|
|
|
371
371
|
assistantId: z.ZodOptional<z.ZodString>;
|
|
372
372
|
phoneNumberId: z.ZodOptional<z.ZodString>;
|
|
373
373
|
customer: z.ZodOptional<z.ZodObject<{
|
|
374
|
-
|
|
374
|
+
number: z.ZodString;
|
|
375
375
|
}, "strip", z.ZodTypeAny, {
|
|
376
|
-
|
|
376
|
+
number: string;
|
|
377
377
|
}, {
|
|
378
|
-
|
|
378
|
+
number: string;
|
|
379
379
|
}>>;
|
|
380
380
|
scheduledAt: z.ZodOptional<z.ZodString>;
|
|
381
|
+
assistantOverrides: z.ZodOptional<z.ZodObject<{
|
|
382
|
+
variableValues: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
383
|
+
}, "strip", z.ZodTypeAny, {
|
|
384
|
+
variableValues?: Record<string, any> | undefined;
|
|
385
|
+
}, {
|
|
386
|
+
variableValues?: Record<string, any> | undefined;
|
|
387
|
+
}>>;
|
|
381
388
|
}, "strip", z.ZodTypeAny, {
|
|
382
389
|
assistantId?: string | undefined;
|
|
383
390
|
phoneNumberId?: string | undefined;
|
|
384
391
|
customer?: {
|
|
385
|
-
|
|
392
|
+
number: string;
|
|
386
393
|
} | undefined;
|
|
387
394
|
scheduledAt?: string | undefined;
|
|
395
|
+
assistantOverrides?: {
|
|
396
|
+
variableValues?: Record<string, any> | undefined;
|
|
397
|
+
} | undefined;
|
|
388
398
|
}, {
|
|
389
399
|
assistantId?: string | undefined;
|
|
390
400
|
phoneNumberId?: string | undefined;
|
|
391
401
|
customer?: {
|
|
392
|
-
|
|
402
|
+
number: string;
|
|
393
403
|
} | undefined;
|
|
394
404
|
scheduledAt?: string | undefined;
|
|
405
|
+
assistantOverrides?: {
|
|
406
|
+
variableValues?: Record<string, any> | undefined;
|
|
407
|
+
} | undefined;
|
|
395
408
|
}>;
|
|
396
409
|
export declare const CallOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
397
410
|
id: z.ZodString;
|
|
@@ -403,11 +416,11 @@ export declare const CallOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
403
416
|
assistantId: z.ZodOptional<z.ZodString>;
|
|
404
417
|
phoneNumberId: z.ZodOptional<z.ZodString>;
|
|
405
418
|
customer: z.ZodOptional<z.ZodObject<{
|
|
406
|
-
|
|
419
|
+
number: z.ZodString;
|
|
407
420
|
}, "strip", z.ZodTypeAny, {
|
|
408
|
-
|
|
421
|
+
number: string;
|
|
409
422
|
}, {
|
|
410
|
-
|
|
423
|
+
number: string;
|
|
411
424
|
}>>;
|
|
412
425
|
scheduledAt: z.ZodOptional<z.ZodString>;
|
|
413
426
|
}>, "strip", z.ZodTypeAny, {
|
|
@@ -418,7 +431,7 @@ export declare const CallOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
418
431
|
assistantId?: string | undefined;
|
|
419
432
|
phoneNumberId?: string | undefined;
|
|
420
433
|
customer?: {
|
|
421
|
-
|
|
434
|
+
number: string;
|
|
422
435
|
} | undefined;
|
|
423
436
|
scheduledAt?: string | undefined;
|
|
424
437
|
endedReason?: string | undefined;
|
|
@@ -430,7 +443,7 @@ export declare const CallOutputSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
430
443
|
assistantId?: string | undefined;
|
|
431
444
|
phoneNumberId?: string | undefined;
|
|
432
445
|
customer?: {
|
|
433
|
-
|
|
446
|
+
number: string;
|
|
434
447
|
} | undefined;
|
|
435
448
|
scheduledAt?: string | undefined;
|
|
436
449
|
endedReason?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,eAAO,MAAM,eAAe;;;CAGlB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAC3B,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AACrD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAC/E,MAAM,MAAM,kBAAkB,GAC5B,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC;AACzD,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAqC/E,eAAO,MAAM,W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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgC1B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAIH,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUlC,CAAC;AAIH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;EAM3B,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -233,7 +233,7 @@ export const CallInputSchema = z.object({
|
|
|
233
233
|
.describe('ID of the phone number to use for the call'),
|
|
234
234
|
customer: z
|
|
235
235
|
.object({
|
|
236
|
-
|
|
236
|
+
number: z.string().describe('Customer phone number'),
|
|
237
237
|
})
|
|
238
238
|
.optional()
|
|
239
239
|
.describe('Customer information'),
|
|
@@ -241,6 +241,15 @@ export const CallInputSchema = z.object({
|
|
|
241
241
|
.string()
|
|
242
242
|
.optional()
|
|
243
243
|
.describe('ISO datetime string for when the call should be scheduled (e.g. "2025-03-25T22:39:27.771Z")'),
|
|
244
|
+
assistantOverrides: z
|
|
245
|
+
.object({
|
|
246
|
+
variableValues: z
|
|
247
|
+
.record(z.string(), z.any())
|
|
248
|
+
.optional()
|
|
249
|
+
.describe('Key-value pairs for dynamic variables to use in the assistant\'s prompts (e.g. {"name": "Joe", "age": "24"})'),
|
|
250
|
+
})
|
|
251
|
+
.optional()
|
|
252
|
+
.describe('Overrides for the assistant configuration'),
|
|
244
253
|
});
|
|
245
254
|
export const CallOutputSchema = BaseResponseSchema.extend({
|
|
246
255
|
status: z.string(),
|
|
@@ -249,7 +258,7 @@ export const CallOutputSchema = BaseResponseSchema.extend({
|
|
|
249
258
|
phoneNumberId: z.string().optional(),
|
|
250
259
|
customer: z
|
|
251
260
|
.object({
|
|
252
|
-
|
|
261
|
+
number: z.string(),
|
|
253
262
|
})
|
|
254
263
|
.optional(),
|
|
255
264
|
scheduledAt: z.string().optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transformers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAI7B,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GAChD,IAAI,CAAC,kBAAkB,CA2CzB;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GAChD,IAAI,CAAC,kBAAkB,CAiEzB;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,IAAI,CAAC,SAAS,GACxB,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAqBvC;AA2BD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GACrC,IAAI,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transformers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,0BAA0B,EAC1B,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,gBAAgB,EAChB,0BAA0B,EAC3B,MAAM,qBAAqB,CAAC;AAI7B,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GAChD,IAAI,CAAC,kBAAkB,CA2CzB;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,GAChD,IAAI,CAAC,kBAAkB,CAiEzB;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,IAAI,CAAC,SAAS,GACxB,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAqBvC;AA2BD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,GACrC,IAAI,CAAC,aAAa,CAwBpB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,CAAC,IAAI,GACd,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAgBlC;AAID,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,GAAG,GACf,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CASzC;AAID,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,GAAG,GACR,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CASlC"}
|
|
@@ -141,7 +141,7 @@ export function transformCallInput(input) {
|
|
|
141
141
|
...(input.customer
|
|
142
142
|
? {
|
|
143
143
|
customer: {
|
|
144
|
-
number: input.customer.
|
|
144
|
+
number: input.customer.number,
|
|
145
145
|
},
|
|
146
146
|
}
|
|
147
147
|
: {}),
|
|
@@ -152,6 +152,11 @@ export function transformCallInput(input) {
|
|
|
152
152
|
},
|
|
153
153
|
}
|
|
154
154
|
: {}),
|
|
155
|
+
...(input.assistantOverrides
|
|
156
|
+
? {
|
|
157
|
+
assistantOverrides: input.assistantOverrides,
|
|
158
|
+
}
|
|
159
|
+
: {}),
|
|
155
160
|
};
|
|
156
161
|
}
|
|
157
162
|
export function transformCallOutput(call) {
|
|
@@ -165,7 +170,7 @@ export function transformCallOutput(call) {
|
|
|
165
170
|
phoneNumberId: call.phoneNumberId,
|
|
166
171
|
customer: call.customer
|
|
167
172
|
? {
|
|
168
|
-
|
|
173
|
+
number: call.customer.number || '',
|
|
169
174
|
}
|
|
170
175
|
: undefined,
|
|
171
176
|
scheduledAt: call.schedulePlan?.earliestAt,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vapi-ai/mcp-server",
|
|
3
3
|
"description": "Vapi MCP Server",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"dev": "tsx watch src/index.ts",
|
|
40
40
|
"dev:stdio-example": "tsx examples/stdio-client.ts",
|
|
41
41
|
"dev:sse-example": "tsx examples/sse-client.ts",
|
|
42
|
+
"dev:shttp-example": "tsx examples/shttp-client.ts",
|
|
42
43
|
"inspector": "mcp-inspector",
|
|
43
44
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
|
|
44
45
|
"test:unit": "NODE_OPTIONS=--experimental-vm-modules jest src/tests/mcp-server-mock.test.ts",
|