elevenlabs-voice-agent-mcp 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.
- package/LICENSE +21 -0
- package/README.md +533 -0
- package/dist/constants.d.ts +25 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +51 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +93 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/agent-schemas.d.ts +147 -0
- package/dist/schemas/agent-schemas.d.ts.map +1 -0
- package/dist/schemas/agent-schemas.js +145 -0
- package/dist/schemas/agent-schemas.js.map +1 -0
- package/dist/schemas/batch-calling-schemas.d.ts +170 -0
- package/dist/schemas/batch-calling-schemas.d.ts.map +1 -0
- package/dist/schemas/batch-calling-schemas.js +77 -0
- package/dist/schemas/batch-calling-schemas.js.map +1 -0
- package/dist/schemas/common-schemas.d.ts +54 -0
- package/dist/schemas/common-schemas.d.ts.map +1 -0
- package/dist/schemas/common-schemas.js +72 -0
- package/dist/schemas/common-schemas.js.map +1 -0
- package/dist/schemas/conversation-schemas.d.ts +72 -0
- package/dist/schemas/conversation-schemas.d.ts.map +1 -0
- package/dist/schemas/conversation-schemas.js +30 -0
- package/dist/schemas/conversation-schemas.js.map +1 -0
- package/dist/schemas/outbound-schemas.d.ts +115 -0
- package/dist/schemas/outbound-schemas.d.ts.map +1 -0
- package/dist/schemas/outbound-schemas.js +61 -0
- package/dist/schemas/outbound-schemas.js.map +1 -0
- package/dist/schemas/phone-number-schemas.d.ts +168 -0
- package/dist/schemas/phone-number-schemas.d.ts.map +1 -0
- package/dist/schemas/phone-number-schemas.js +116 -0
- package/dist/schemas/phone-number-schemas.js.map +1 -0
- package/dist/schemas/tool-schemas.d.ts +208 -0
- package/dist/schemas/tool-schemas.d.ts.map +1 -0
- package/dist/schemas/tool-schemas.js +131 -0
- package/dist/schemas/tool-schemas.js.map +1 -0
- package/dist/services/elevenlabs-api.d.ts +37 -0
- package/dist/services/elevenlabs-api.d.ts.map +1 -0
- package/dist/services/elevenlabs-api.js +78 -0
- package/dist/services/elevenlabs-api.js.map +1 -0
- package/dist/services/formatters.d.ts +76 -0
- package/dist/services/formatters.d.ts.map +1 -0
- package/dist/services/formatters.js +475 -0
- package/dist/services/formatters.js.map +1 -0
- package/dist/tools/agent-tools.d.ts +228 -0
- package/dist/tools/agent-tools.d.ts.map +1 -0
- package/dist/tools/agent-tools.js +369 -0
- package/dist/tools/agent-tools.js.map +1 -0
- package/dist/tools/batch-calling-tools.d.ts +183 -0
- package/dist/tools/batch-calling-tools.d.ts.map +1 -0
- package/dist/tools/batch-calling-tools.js +203 -0
- package/dist/tools/batch-calling-tools.js.map +1 -0
- package/dist/tools/conversation-tools.d.ts +103 -0
- package/dist/tools/conversation-tools.d.ts.map +1 -0
- package/dist/tools/conversation-tools.js +140 -0
- package/dist/tools/conversation-tools.js.map +1 -0
- package/dist/tools/knowledge-tools.d.ts +75 -0
- package/dist/tools/knowledge-tools.d.ts.map +1 -0
- package/dist/tools/knowledge-tools.js +63 -0
- package/dist/tools/knowledge-tools.js.map +1 -0
- package/dist/tools/outbound-tools.d.ts +44 -0
- package/dist/tools/outbound-tools.d.ts.map +1 -0
- package/dist/tools/outbound-tools.js +84 -0
- package/dist/tools/outbound-tools.js.map +1 -0
- package/dist/tools/phone-number-tools.d.ts +215 -0
- package/dist/tools/phone-number-tools.d.ts.map +1 -0
- package/dist/tools/phone-number-tools.js +295 -0
- package/dist/tools/phone-number-tools.js.map +1 -0
- package/dist/tools/tool-tools.d.ts +165 -0
- package/dist/tools/tool-tools.d.ts.map +1 -0
- package/dist/tools/tool-tools.js +166 -0
- package/dist/tools/tool-tools.js.map +1 -0
- package/dist/tools/utility-tools.d.ts +76 -0
- package/dist/tools/utility-tools.d.ts.map +1 -0
- package/dist/tools/utility-tools.js +121 -0
- package/dist/tools/utility-tools.js.map +1 -0
- package/dist/types.d.ts +282 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/error-handlers.d.ts +29 -0
- package/dist/utils/error-handlers.d.ts.map +1 -0
- package/dist/utils/error-handlers.js +90 -0
- package/dist/utils/error-handlers.js.map +1 -0
- package/dist/utils/truncation.d.ts +41 -0
- package/dist/utils/truncation.d.ts.map +1 -0
- package/dist/utils/truncation.js +78 -0
- package/dist/utils/truncation.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge base management tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tools for adding documents and URLs to agent knowledge bases.
|
|
5
|
+
*/
|
|
6
|
+
import { ResponseFormat } from "../types.js";
|
|
7
|
+
/**
|
|
8
|
+
* Adds documents to an agent's knowledge base
|
|
9
|
+
*/
|
|
10
|
+
export declare const elevenlabs_add_knowledge_base: {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
zodSchema: import("zod").ZodObject<{
|
|
14
|
+
agent_id: import("zod").ZodString;
|
|
15
|
+
documents: import("zod").ZodArray<import("zod").ZodObject<{
|
|
16
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
17
|
+
content: import("zod").ZodString;
|
|
18
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
19
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
20
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
21
|
+
content: import("zod").ZodString;
|
|
22
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
23
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
24
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
25
|
+
content: import("zod").ZodString;
|
|
26
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
27
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
28
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof ResponseFormat>>;
|
|
29
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
30
|
+
agent_id: import("zod").ZodString;
|
|
31
|
+
documents: import("zod").ZodArray<import("zod").ZodObject<{
|
|
32
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
33
|
+
content: import("zod").ZodString;
|
|
34
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
35
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
36
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
37
|
+
content: import("zod").ZodString;
|
|
38
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
39
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
40
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
41
|
+
content: import("zod").ZodString;
|
|
42
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
43
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
44
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof ResponseFormat>>;
|
|
45
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
46
|
+
agent_id: import("zod").ZodString;
|
|
47
|
+
documents: import("zod").ZodArray<import("zod").ZodObject<{
|
|
48
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
49
|
+
content: import("zod").ZodString;
|
|
50
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
51
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
52
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
53
|
+
content: import("zod").ZodString;
|
|
54
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
55
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
56
|
+
type: import("zod").ZodEnum<["text", "url"]>;
|
|
57
|
+
content: import("zod").ZodString;
|
|
58
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>>;
|
|
59
|
+
}, import("zod").ZodTypeAny, "passthrough">>, "many">;
|
|
60
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof ResponseFormat>>;
|
|
61
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
62
|
+
annotations: {
|
|
63
|
+
readOnlyHint: boolean;
|
|
64
|
+
destructiveHint: boolean;
|
|
65
|
+
idempotentHint: boolean;
|
|
66
|
+
openWorldHint: boolean;
|
|
67
|
+
};
|
|
68
|
+
handler: (args: unknown) => Promise<{
|
|
69
|
+
content: {
|
|
70
|
+
type: string;
|
|
71
|
+
text: string;
|
|
72
|
+
}[];
|
|
73
|
+
}>;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=knowledge-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-tools.d.ts","sourceRoot":"","sources":["../../src/tools/knowledge-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAqClB,OAAO;;;;;;CAqB9B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge base management tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tools for adding documents and URLs to agent knowledge bases.
|
|
5
|
+
*/
|
|
6
|
+
import { postRequest } from "../services/elevenlabs-api.js";
|
|
7
|
+
import { formatResponse } from "../services/formatters.js";
|
|
8
|
+
import { ResponseFormat } from "../types.js";
|
|
9
|
+
import { AddKnowledgeBaseSchema } from "../schemas/tool-schemas.js";
|
|
10
|
+
/**
|
|
11
|
+
* Adds documents to an agent's knowledge base
|
|
12
|
+
*/
|
|
13
|
+
export const elevenlabs_add_knowledge_base = {
|
|
14
|
+
name: "elevenlabs_add_knowledge_base",
|
|
15
|
+
description: `Add documents or URLs to an agent's knowledge base.
|
|
16
|
+
|
|
17
|
+
This tool enables agents to reference custom knowledge when responding to users. You can add text documents or URLs that will be fetched and indexed. The agent will automatically use this information when relevant to the conversation.
|
|
18
|
+
|
|
19
|
+
Args:
|
|
20
|
+
- agent_id (string): Agent identifier to add knowledge to
|
|
21
|
+
- documents (array): Array of document objects with:
|
|
22
|
+
- type ('text' | 'url'): Type of document
|
|
23
|
+
- content (string): For 'text': the actual text. For 'url': the URL to fetch
|
|
24
|
+
- metadata (object): Optional key-value metadata about the document
|
|
25
|
+
- response_format ('markdown' | 'json'): Output format
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
Confirmation message indicating successful knowledge base update.
|
|
29
|
+
|
|
30
|
+
Examples:
|
|
31
|
+
- Use when: "Add this FAQ document to the agent's knowledge base"
|
|
32
|
+
- Use when: "Index the company policy page at https://example.com/policies"
|
|
33
|
+
- Use when: "Give the agent access to product documentation"
|
|
34
|
+
- Don't use when: You want to add webhook tools (use elevenlabs_create_webhook_tool)
|
|
35
|
+
|
|
36
|
+
Error Handling:
|
|
37
|
+
- Returns "Error: Agent not found" if agent_id doesn't exist
|
|
38
|
+
- Returns "Error: Invalid URL" if URL document is not accessible
|
|
39
|
+
- Returns "Error: Document too large" if content exceeds size limits`,
|
|
40
|
+
zodSchema: AddKnowledgeBaseSchema,
|
|
41
|
+
annotations: {
|
|
42
|
+
readOnlyHint: false,
|
|
43
|
+
destructiveHint: false,
|
|
44
|
+
idempotentHint: false,
|
|
45
|
+
openWorldHint: true
|
|
46
|
+
},
|
|
47
|
+
handler: async (args) => {
|
|
48
|
+
const parsed = AddKnowledgeBaseSchema.parse(args);
|
|
49
|
+
const result = await postRequest(`/convai/agents/${parsed.agent_id}/knowledge-base`, { documents: parsed.documents });
|
|
50
|
+
const message = `Successfully added ${parsed.documents.length} document(s) to agent ${parsed.agent_id}'s knowledge base.`;
|
|
51
|
+
return {
|
|
52
|
+
content: [
|
|
53
|
+
{
|
|
54
|
+
type: "text",
|
|
55
|
+
text: parsed.response_format === ResponseFormat.JSON
|
|
56
|
+
? formatResponse({ success: true, message, documents_added: parsed.documents.length }, parsed.response_format, "generic")
|
|
57
|
+
: message
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=knowledge-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-tools.js","sourceRoot":"","sources":["../../src/tools/knowledge-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;uEAwBwD;IAErE,SAAS,EAAE,sBAAsB;IAEjC,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,IAAI;KACpB;IAED,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAElD,MAAM,MAAM,GAAG,MAAM,WAAW,CAC9B,kBAAkB,MAAM,CAAC,QAAQ,iBAAiB,EAClD,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAChC,CAAC;QAEF,MAAM,OAAO,GAAG,sBAAsB,MAAM,CAAC,SAAS,CAAC,MAAM,yBAAyB,MAAM,CAAC,QAAQ,oBAAoB,CAAC;QAE1H,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,MAAM,CAAC,eAAe,KAAK,cAAc,CAAC,IAAI;wBAClD,CAAC,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,eAAe,EAAE,SAAS,CAAC;wBACzH,CAAC,CAAC,OAAO;iBACZ;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outbound calling tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tool for initiating single outbound phone calls via Twilio.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Starts a single outbound call via Twilio
|
|
8
|
+
*/
|
|
9
|
+
export declare const elevenlabs_start_outbound_call: {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
zodSchema: import("zod").ZodObject<{
|
|
13
|
+
agent_id: import("zod").ZodString;
|
|
14
|
+
agent_phone_number_id: import("zod").ZodString;
|
|
15
|
+
to_number: import("zod").ZodString;
|
|
16
|
+
conversation_initiation_client_data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
17
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
18
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
19
|
+
agent_id: import("zod").ZodString;
|
|
20
|
+
agent_phone_number_id: import("zod").ZodString;
|
|
21
|
+
to_number: import("zod").ZodString;
|
|
22
|
+
conversation_initiation_client_data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
23
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
24
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
25
|
+
agent_id: import("zod").ZodString;
|
|
26
|
+
agent_phone_number_id: import("zod").ZodString;
|
|
27
|
+
to_number: import("zod").ZodString;
|
|
28
|
+
conversation_initiation_client_data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
29
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
30
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
31
|
+
annotations: {
|
|
32
|
+
readOnlyHint: boolean;
|
|
33
|
+
destructiveHint: boolean;
|
|
34
|
+
idempotentHint: boolean;
|
|
35
|
+
openWorldHint: boolean;
|
|
36
|
+
};
|
|
37
|
+
handler: (args: unknown) => Promise<{
|
|
38
|
+
content: {
|
|
39
|
+
type: string;
|
|
40
|
+
text: string;
|
|
41
|
+
}[];
|
|
42
|
+
}>;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=outbound-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbound-tools.d.ts","sourceRoot":"","sources":["../../src/tools/outbound-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsDnB,OAAO;;;;;;CA0B9B,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Outbound calling tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tool for initiating single outbound phone calls via Twilio.
|
|
5
|
+
*/
|
|
6
|
+
import { postRequest } from "../services/elevenlabs-api.js";
|
|
7
|
+
import { formatResponse } from "../services/formatters.js";
|
|
8
|
+
import { StartOutboundCallSchema } from "../schemas/outbound-schemas.js";
|
|
9
|
+
/**
|
|
10
|
+
* Starts a single outbound call via Twilio
|
|
11
|
+
*/
|
|
12
|
+
export const elevenlabs_start_outbound_call = {
|
|
13
|
+
name: "elevenlabs_start_outbound_call",
|
|
14
|
+
description: `Initiate a single outbound phone call using an ElevenLabs Voice Agent via Twilio.
|
|
15
|
+
|
|
16
|
+
This tool starts an AI-powered phone call to a specific phone number. The agent will use its configured prompt, voice, and tools to have a conversation with the person who answers. You can personalize the call with dynamic variables and override agent settings for this specific call.
|
|
17
|
+
|
|
18
|
+
Prerequisites:
|
|
19
|
+
- A Twilio phone number must be imported and associated with an agent
|
|
20
|
+
- The agent must be properly configured
|
|
21
|
+
- Destination phone number must be valid
|
|
22
|
+
|
|
23
|
+
Args:
|
|
24
|
+
- agent_id (string): Agent to use for this call (e.g., 'ag_abc123')
|
|
25
|
+
- agent_phone_number_id (string): Phone number ID to use as caller ID
|
|
26
|
+
- to_number (string): Destination phone number in E.164 format (e.g., '+1234567890')
|
|
27
|
+
- conversation_initiation_client_data (object): Optional personalization data
|
|
28
|
+
- dynamic_variables (object): Dynamic variables for personalization
|
|
29
|
+
Example: {dynamic_variables: {name: 'John', user_id: '123', account_balance: 1500}}
|
|
30
|
+
- conversation_config_override (object): Override agent settings for this call
|
|
31
|
+
- agent.first_message: Custom greeting for this call
|
|
32
|
+
- agent.prompt.prompt: Custom system prompt for this call
|
|
33
|
+
- agent.language: Language override
|
|
34
|
+
- tts.voice_id: Voice override
|
|
35
|
+
- conversation.max_duration_seconds: Maximum call duration
|
|
36
|
+
- response_format ('markdown' | 'json'): Output format
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
- success: Whether the call was initiated
|
|
40
|
+
- message: Human-readable status message
|
|
41
|
+
- conversation_id: ID to track this conversation (null if failed)
|
|
42
|
+
- callSid: Twilio call identifier (null if failed)
|
|
43
|
+
|
|
44
|
+
Examples:
|
|
45
|
+
- Use when: "Call +14155551234 with the sales agent"
|
|
46
|
+
- Use when: "Start outbound call to check appointment with customer John"
|
|
47
|
+
- Use when: "Dispatch agent to +447911123456 with custom greeting"
|
|
48
|
+
- Don't use when: You want to make multiple calls at once (use elevenlabs_submit_batch_call)
|
|
49
|
+
- Don't use when: Phone number isn't set up yet (use elevenlabs_import_phone_number first)
|
|
50
|
+
|
|
51
|
+
Error Handling:
|
|
52
|
+
- Returns success: false if call initiation fails
|
|
53
|
+
- Returns "Error: Phone number not found" if agent_phone_number_id is invalid
|
|
54
|
+
- Returns "Error: Agent not found" if agent_id doesn't exist
|
|
55
|
+
- Returns "Error: Invalid phone number format" if to_number is malformed`,
|
|
56
|
+
zodSchema: StartOutboundCallSchema,
|
|
57
|
+
annotations: {
|
|
58
|
+
readOnlyHint: false,
|
|
59
|
+
destructiveHint: false,
|
|
60
|
+
idempotentHint: false,
|
|
61
|
+
openWorldHint: true
|
|
62
|
+
},
|
|
63
|
+
handler: async (args) => {
|
|
64
|
+
const parsed = StartOutboundCallSchema.parse(args);
|
|
65
|
+
const requestData = {
|
|
66
|
+
agent_id: parsed.agent_id,
|
|
67
|
+
agent_phone_number_id: parsed.agent_phone_number_id,
|
|
68
|
+
to_number: parsed.to_number,
|
|
69
|
+
...(parsed.conversation_initiation_client_data && {
|
|
70
|
+
conversation_initiation_client_data: parsed.conversation_initiation_client_data
|
|
71
|
+
})
|
|
72
|
+
};
|
|
73
|
+
const response = await postRequest("/convai/twilio/outbound-call", requestData);
|
|
74
|
+
return {
|
|
75
|
+
content: [
|
|
76
|
+
{
|
|
77
|
+
type: "text",
|
|
78
|
+
text: formatResponse(response, parsed.response_format, "outbound_call")
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=outbound-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbound-tools.js","sourceRoot":"","sources":["../../src/tools/outbound-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2EAyC4D;IAEzE,SAAS,EAAE,uBAAuB;IAElC,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,IAAI;KACpB;IAED,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,uBAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEnD,MAAM,WAAW,GAAG;YAClB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;YACnD,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,GAAG,CAAC,MAAM,CAAC,mCAAmC,IAAI;gBAChD,mCAAmC,EAAE,MAAM,CAAC,mCAAmC;aAChF,CAAC;SACH,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,WAAW,CAChC,8BAA8B,EAC9B,WAAW,CACZ,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE,eAAe,CAAC;iBACxE;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phone number management tools
|
|
3
|
+
*
|
|
4
|
+
* MCP tools for listing, importing, updating, and deleting phone numbers
|
|
5
|
+
* connected to voice agents via Twilio or SIP trunking.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Lists all phone numbers connected to the workspace
|
|
9
|
+
*/
|
|
10
|
+
export declare const elevenlabs_list_phone_numbers: {
|
|
11
|
+
name: string;
|
|
12
|
+
description: string;
|
|
13
|
+
zodSchema: import("zod").ZodObject<{
|
|
14
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
15
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
16
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
17
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
18
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
19
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
20
|
+
annotations: {
|
|
21
|
+
readOnlyHint: boolean;
|
|
22
|
+
destructiveHint: boolean;
|
|
23
|
+
idempotentHint: boolean;
|
|
24
|
+
openWorldHint: boolean;
|
|
25
|
+
};
|
|
26
|
+
handler: (args: unknown) => Promise<{
|
|
27
|
+
content: {
|
|
28
|
+
type: string;
|
|
29
|
+
text: string;
|
|
30
|
+
}[];
|
|
31
|
+
}>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Gets details about a specific phone number
|
|
35
|
+
*/
|
|
36
|
+
export declare const elevenlabs_get_phone_number: {
|
|
37
|
+
name: string;
|
|
38
|
+
description: string;
|
|
39
|
+
zodSchema: import("zod").ZodObject<{
|
|
40
|
+
phone_number_id: import("zod").ZodString;
|
|
41
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
42
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
43
|
+
phone_number_id: import("zod").ZodString;
|
|
44
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
45
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
46
|
+
phone_number_id: import("zod").ZodString;
|
|
47
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
48
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
49
|
+
annotations: {
|
|
50
|
+
readOnlyHint: boolean;
|
|
51
|
+
destructiveHint: boolean;
|
|
52
|
+
idempotentHint: boolean;
|
|
53
|
+
openWorldHint: boolean;
|
|
54
|
+
};
|
|
55
|
+
handler: (args: unknown) => Promise<{
|
|
56
|
+
content: {
|
|
57
|
+
type: string;
|
|
58
|
+
text: string;
|
|
59
|
+
}[];
|
|
60
|
+
}>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Imports a Twilio phone number
|
|
64
|
+
*/
|
|
65
|
+
export declare const elevenlabs_import_phone_number: {
|
|
66
|
+
name: string;
|
|
67
|
+
description: string;
|
|
68
|
+
zodSchema: import("zod").ZodObject<{
|
|
69
|
+
phone_number: import("zod").ZodString;
|
|
70
|
+
label: import("zod").ZodString;
|
|
71
|
+
sid: import("zod").ZodString;
|
|
72
|
+
token: import("zod").ZodString;
|
|
73
|
+
provider: import("zod").ZodLiteral<"twilio">;
|
|
74
|
+
supports_inbound: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
75
|
+
supports_outbound: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
76
|
+
region_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
77
|
+
region_id: import("zod").ZodEnum<["us1", "ie1", "au1"]>;
|
|
78
|
+
token: import("zod").ZodString;
|
|
79
|
+
edge_location: import("zod").ZodEnum<["ashburn", "dublin", "frankfurt", "sao-paulo", "singapore", "sydney", "tokyo", "umatilla", "roaming"]>;
|
|
80
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
81
|
+
region_id: "us1" | "ie1" | "au1";
|
|
82
|
+
token: string;
|
|
83
|
+
edge_location: "ashburn" | "dublin" | "frankfurt" | "sao-paulo" | "singapore" | "sydney" | "tokyo" | "umatilla" | "roaming";
|
|
84
|
+
}, {
|
|
85
|
+
region_id: "us1" | "ie1" | "au1";
|
|
86
|
+
token: string;
|
|
87
|
+
edge_location: "ashburn" | "dublin" | "frankfurt" | "sao-paulo" | "singapore" | "sydney" | "tokyo" | "umatilla" | "roaming";
|
|
88
|
+
}>>;
|
|
89
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
90
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
91
|
+
phone_number: import("zod").ZodString;
|
|
92
|
+
label: import("zod").ZodString;
|
|
93
|
+
sid: import("zod").ZodString;
|
|
94
|
+
token: import("zod").ZodString;
|
|
95
|
+
provider: import("zod").ZodLiteral<"twilio">;
|
|
96
|
+
supports_inbound: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
97
|
+
supports_outbound: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
98
|
+
region_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
99
|
+
region_id: import("zod").ZodEnum<["us1", "ie1", "au1"]>;
|
|
100
|
+
token: import("zod").ZodString;
|
|
101
|
+
edge_location: import("zod").ZodEnum<["ashburn", "dublin", "frankfurt", "sao-paulo", "singapore", "sydney", "tokyo", "umatilla", "roaming"]>;
|
|
102
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
103
|
+
region_id: "us1" | "ie1" | "au1";
|
|
104
|
+
token: string;
|
|
105
|
+
edge_location: "ashburn" | "dublin" | "frankfurt" | "sao-paulo" | "singapore" | "sydney" | "tokyo" | "umatilla" | "roaming";
|
|
106
|
+
}, {
|
|
107
|
+
region_id: "us1" | "ie1" | "au1";
|
|
108
|
+
token: string;
|
|
109
|
+
edge_location: "ashburn" | "dublin" | "frankfurt" | "sao-paulo" | "singapore" | "sydney" | "tokyo" | "umatilla" | "roaming";
|
|
110
|
+
}>>;
|
|
111
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
112
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
113
|
+
phone_number: import("zod").ZodString;
|
|
114
|
+
label: import("zod").ZodString;
|
|
115
|
+
sid: import("zod").ZodString;
|
|
116
|
+
token: import("zod").ZodString;
|
|
117
|
+
provider: import("zod").ZodLiteral<"twilio">;
|
|
118
|
+
supports_inbound: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
119
|
+
supports_outbound: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
|
120
|
+
region_config: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
121
|
+
region_id: import("zod").ZodEnum<["us1", "ie1", "au1"]>;
|
|
122
|
+
token: import("zod").ZodString;
|
|
123
|
+
edge_location: import("zod").ZodEnum<["ashburn", "dublin", "frankfurt", "sao-paulo", "singapore", "sydney", "tokyo", "umatilla", "roaming"]>;
|
|
124
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
125
|
+
region_id: "us1" | "ie1" | "au1";
|
|
126
|
+
token: string;
|
|
127
|
+
edge_location: "ashburn" | "dublin" | "frankfurt" | "sao-paulo" | "singapore" | "sydney" | "tokyo" | "umatilla" | "roaming";
|
|
128
|
+
}, {
|
|
129
|
+
region_id: "us1" | "ie1" | "au1";
|
|
130
|
+
token: string;
|
|
131
|
+
edge_location: "ashburn" | "dublin" | "frankfurt" | "sao-paulo" | "singapore" | "sydney" | "tokyo" | "umatilla" | "roaming";
|
|
132
|
+
}>>;
|
|
133
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
134
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
135
|
+
annotations: {
|
|
136
|
+
readOnlyHint: boolean;
|
|
137
|
+
destructiveHint: boolean;
|
|
138
|
+
idempotentHint: boolean;
|
|
139
|
+
openWorldHint: boolean;
|
|
140
|
+
};
|
|
141
|
+
handler: (args: unknown) => Promise<{
|
|
142
|
+
content: {
|
|
143
|
+
type: string;
|
|
144
|
+
text: string;
|
|
145
|
+
}[];
|
|
146
|
+
}>;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Updates a phone number (primarily for agent assignment)
|
|
150
|
+
*/
|
|
151
|
+
export declare const elevenlabs_update_phone_number: {
|
|
152
|
+
name: string;
|
|
153
|
+
description: string;
|
|
154
|
+
zodSchema: import("zod").ZodObject<{
|
|
155
|
+
phone_number_id: import("zod").ZodString;
|
|
156
|
+
agent_id: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
157
|
+
inbound_trunk_config: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>>;
|
|
158
|
+
outbound_trunk_config: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>>;
|
|
159
|
+
livekit_stack: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodEnum<["standard", "static"]>>>;
|
|
160
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
161
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
162
|
+
phone_number_id: import("zod").ZodString;
|
|
163
|
+
agent_id: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
164
|
+
inbound_trunk_config: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>>;
|
|
165
|
+
outbound_trunk_config: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>>;
|
|
166
|
+
livekit_stack: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodEnum<["standard", "static"]>>>;
|
|
167
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
168
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
169
|
+
phone_number_id: import("zod").ZodString;
|
|
170
|
+
agent_id: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
171
|
+
inbound_trunk_config: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>>;
|
|
172
|
+
outbound_trunk_config: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>>;
|
|
173
|
+
livekit_stack: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodEnum<["standard", "static"]>>>;
|
|
174
|
+
response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
|
|
175
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
176
|
+
annotations: {
|
|
177
|
+
readOnlyHint: boolean;
|
|
178
|
+
destructiveHint: boolean;
|
|
179
|
+
idempotentHint: boolean;
|
|
180
|
+
openWorldHint: boolean;
|
|
181
|
+
};
|
|
182
|
+
handler: (args: unknown) => Promise<{
|
|
183
|
+
content: {
|
|
184
|
+
type: string;
|
|
185
|
+
text: string;
|
|
186
|
+
}[];
|
|
187
|
+
}>;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Deletes a phone number
|
|
191
|
+
*/
|
|
192
|
+
export declare const elevenlabs_delete_phone_number: {
|
|
193
|
+
name: string;
|
|
194
|
+
description: string;
|
|
195
|
+
zodSchema: import("zod").ZodObject<{
|
|
196
|
+
phone_number_id: import("zod").ZodString;
|
|
197
|
+
}, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
|
|
198
|
+
phone_number_id: import("zod").ZodString;
|
|
199
|
+
}, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
|
|
200
|
+
phone_number_id: import("zod").ZodString;
|
|
201
|
+
}, import("zod").ZodTypeAny, "passthrough">>;
|
|
202
|
+
annotations: {
|
|
203
|
+
readOnlyHint: boolean;
|
|
204
|
+
destructiveHint: boolean;
|
|
205
|
+
idempotentHint: boolean;
|
|
206
|
+
openWorldHint: boolean;
|
|
207
|
+
};
|
|
208
|
+
handler: (args: unknown) => Promise<{
|
|
209
|
+
content: {
|
|
210
|
+
type: string;
|
|
211
|
+
text: string;
|
|
212
|
+
}[];
|
|
213
|
+
}>;
|
|
214
|
+
};
|
|
215
|
+
//# sourceMappingURL=phone-number-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-number-tools.d.ts","sourceRoot":"","sources":["../../src/tools/phone-number-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;oBAsClB,OAAO;;;;;;CAc9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;oBAgChB,OAAO;;;;;;CAgB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAiDnB,OAAO;;;;;;CAkC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsCnB,OAAO;;;;;;CAmC9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;oBAkCnB,OAAO;;;;;;CAc9B,CAAC"}
|