@fonoster/mcp 0.9.50 → 0.9.51
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.
|
@@ -54,6 +54,7 @@ function createCallPrompt() {
|
|
|
54
54
|
2. Offer the user a list of numbers to use for the call using the 'listNumbers' tool
|
|
55
55
|
3. Then ask for the name of application and use that to find the 'ref' of the application
|
|
56
56
|
4. Create a call to the selected application using the 'createCall' or 'createCallBatch' tool depending on the user's request
|
|
57
|
+
5. Any additional data must be added as property in the **metadata** parameter of either 'createCall' or 'createCallBatch'
|
|
57
58
|
|
|
58
59
|
## Example 1:
|
|
59
60
|
User: I want to call +1234567890
|
package/dist/schemas.d.ts
CHANGED
|
@@ -42,33 +42,39 @@ declare const CreateCallSchema: z.ZodObject<{
|
|
|
42
42
|
to: z.ZodString;
|
|
43
43
|
app_ref: z.ZodString;
|
|
44
44
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
45
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
45
46
|
}, "strip", z.ZodTypeAny, {
|
|
46
47
|
from?: string;
|
|
47
48
|
to?: string;
|
|
48
49
|
app_ref?: string;
|
|
49
50
|
timeout?: number;
|
|
51
|
+
metadata?: Record<string, any>;
|
|
50
52
|
}, {
|
|
51
53
|
from?: string;
|
|
52
54
|
to?: string;
|
|
53
55
|
app_ref?: string;
|
|
54
56
|
timeout?: number;
|
|
57
|
+
metadata?: Record<string, any>;
|
|
55
58
|
}>;
|
|
56
59
|
declare const CreateCallBatchSchema: z.ZodObject<{
|
|
57
60
|
from: z.ZodString;
|
|
58
61
|
to_array: z.ZodArray<z.ZodString, "many">;
|
|
59
62
|
app_ref: z.ZodString;
|
|
60
63
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
64
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
61
65
|
calls_per_minute: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
62
66
|
}, "strip", z.ZodTypeAny, {
|
|
63
67
|
from?: string;
|
|
64
68
|
app_ref?: string;
|
|
65
69
|
timeout?: number;
|
|
70
|
+
metadata?: Record<string, any>;
|
|
66
71
|
to_array?: string[];
|
|
67
72
|
calls_per_minute?: number;
|
|
68
73
|
}, {
|
|
69
74
|
from?: string;
|
|
70
75
|
app_ref?: string;
|
|
71
76
|
timeout?: number;
|
|
77
|
+
metadata?: Record<string, any>;
|
|
72
78
|
to_array?: string[];
|
|
73
79
|
calls_per_minute?: number;
|
|
74
80
|
}>;
|
package/dist/schemas.js
CHANGED
|
@@ -34,7 +34,11 @@ const CreateCallSchema = zod_1.z.object({
|
|
|
34
34
|
from: zod_1.z.string().describe("The phone number to call from"),
|
|
35
35
|
to: zod_1.z.string().describe("The phone number to call to"),
|
|
36
36
|
app_ref: zod_1.z.string().describe("The application reference to use for the call"),
|
|
37
|
-
timeout: zod_1.z.number().optional().describe("The timeout for the call")
|
|
37
|
+
timeout: zod_1.z.number().optional().describe("The timeout for the call"),
|
|
38
|
+
metadata: zod_1.z
|
|
39
|
+
.record(zod_1.z.string(), zod_1.z.any())
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("The metadata to send to the Voice Application")
|
|
38
42
|
});
|
|
39
43
|
exports.CreateCallSchema = CreateCallSchema;
|
|
40
44
|
const CreateCallBatchSchema = zod_1.z.object({
|
|
@@ -42,6 +46,10 @@ const CreateCallBatchSchema = zod_1.z.object({
|
|
|
42
46
|
to_array: zod_1.z.array(zod_1.z.string().min(1)).min(1),
|
|
43
47
|
app_ref: zod_1.z.string().min(1),
|
|
44
48
|
timeout: zod_1.z.number().optional(),
|
|
49
|
+
metadata: zod_1.z
|
|
50
|
+
.record(zod_1.z.string(), zod_1.z.any())
|
|
51
|
+
.optional()
|
|
52
|
+
.describe("The metadata to send to the Voice Application"),
|
|
45
53
|
calls_per_minute: zod_1.z.number().min(1).max(60).optional().default(20)
|
|
46
54
|
});
|
|
47
55
|
exports.CreateCallBatchSchema = CreateCallBatchSchema;
|
|
@@ -73,13 +73,14 @@ function createCreateCallBatch(client) {
|
|
|
73
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
74
74
|
const calls = new SDK.Calls(client);
|
|
75
75
|
const validatedParams = schemas_1.CreateCallBatchSchema.parse(params);
|
|
76
|
-
const { from, to_array, app_ref, timeout, calls_per_minute } = validatedParams;
|
|
76
|
+
const { from, to_array, app_ref, timeout, metadata, calls_per_minute } = validatedParams;
|
|
77
77
|
const batchId = Date.now().toString();
|
|
78
78
|
const createSingleCall = (to) => calls.createCall({
|
|
79
79
|
from,
|
|
80
80
|
to,
|
|
81
81
|
appRef: app_ref,
|
|
82
|
-
timeout
|
|
82
|
+
timeout,
|
|
83
|
+
metadata
|
|
83
84
|
});
|
|
84
85
|
const delayBetweenCalls = Math.ceil(60000 / calls_per_minute);
|
|
85
86
|
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fonoster/mcp",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.51",
|
|
4
4
|
"description": "Model Context Protocol for Fonoster",
|
|
5
5
|
"author": "Pedro Sanders <psanders@fonoster.com>",
|
|
6
6
|
"homepage": "https://github.com/fonoster/fonoster#readme",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"clean": "rimraf ./dist node_modules tsconfig.tsbuildinfo"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@fonoster/common": "^0.9.
|
|
25
|
-
"@fonoster/logger": "^0.9.
|
|
26
|
-
"@fonoster/sdk": "^0.9.
|
|
24
|
+
"@fonoster/common": "^0.9.51",
|
|
25
|
+
"@fonoster/logger": "^0.9.51",
|
|
26
|
+
"@fonoster/sdk": "^0.9.51",
|
|
27
27
|
"@modelcontextprotocol/sdk": "^1.4.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"bugs": {
|
|
40
40
|
"url": "https://github.com/fonoster/fonoster/issues"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "0de025bb29e91916c4530a00ed2ba0e40eed220f"
|
|
43
43
|
}
|