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,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response truncation utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles truncation of large responses to stay within MCP character limits
|
|
5
|
+
* while providing clear guidance to users.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Truncates content if it exceeds the character limit
|
|
9
|
+
*
|
|
10
|
+
* @param content - The content to potentially truncate
|
|
11
|
+
* @param context - Additional context or guidance for the user
|
|
12
|
+
* @returns Original or truncated content with indicator
|
|
13
|
+
*/
|
|
14
|
+
export declare function truncateIfNeeded(content: string, context?: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Truncates an array of items and provides pagination guidance
|
|
17
|
+
*
|
|
18
|
+
* @param items - Array of items that might need truncation
|
|
19
|
+
* @param formatter - Function to format each item as a string
|
|
20
|
+
* @param currentOffset - Current pagination offset
|
|
21
|
+
* @param context - Additional context for users
|
|
22
|
+
* @returns Formatted and potentially truncated string
|
|
23
|
+
*/
|
|
24
|
+
export declare function truncateArray<T>(items: T[], formatter: (item: T, index: number) => string, currentOffset?: number, context?: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Safely truncates a string in the middle, preserving start and end
|
|
27
|
+
*
|
|
28
|
+
* @param content - Content to truncate
|
|
29
|
+
* @param maxLength - Maximum length
|
|
30
|
+
* @returns Truncated string with "..." indicator
|
|
31
|
+
*/
|
|
32
|
+
export declare function truncateMiddle(content: string, maxLength: number): string;
|
|
33
|
+
/**
|
|
34
|
+
* Formats a large JSON object with optional truncation
|
|
35
|
+
*
|
|
36
|
+
* @param obj - Object to format
|
|
37
|
+
* @param indent - Indentation spaces (default: 2)
|
|
38
|
+
* @returns JSON string, potentially truncated
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatJSON(obj: unknown, indent?: number): string;
|
|
41
|
+
//# sourceMappingURL=truncation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truncation.d.ts","sourceRoot":"","sources":["../../src/utils/truncation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAS1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,EAC7C,aAAa,GAAE,MAAU,EACzB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,CAmBR;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAUzE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,MAAU,GAAG,MAAM,CAQnE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response truncation utilities
|
|
3
|
+
*
|
|
4
|
+
* Handles truncation of large responses to stay within MCP character limits
|
|
5
|
+
* while providing clear guidance to users.
|
|
6
|
+
*/
|
|
7
|
+
import { CHARACTER_LIMIT } from "../constants.js";
|
|
8
|
+
/**
|
|
9
|
+
* Truncates content if it exceeds the character limit
|
|
10
|
+
*
|
|
11
|
+
* @param content - The content to potentially truncate
|
|
12
|
+
* @param context - Additional context or guidance for the user
|
|
13
|
+
* @returns Original or truncated content with indicator
|
|
14
|
+
*/
|
|
15
|
+
export function truncateIfNeeded(content, context) {
|
|
16
|
+
if (content.length <= CHARACTER_LIMIT) {
|
|
17
|
+
return content;
|
|
18
|
+
}
|
|
19
|
+
const truncated = content.substring(0, CHARACTER_LIMIT);
|
|
20
|
+
const guidance = context || "Consider using filters or pagination to see more results";
|
|
21
|
+
return `${truncated}\n\n[TRUNCATED: Response exceeded ${CHARACTER_LIMIT} characters. ${guidance}]`;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Truncates an array of items and provides pagination guidance
|
|
25
|
+
*
|
|
26
|
+
* @param items - Array of items that might need truncation
|
|
27
|
+
* @param formatter - Function to format each item as a string
|
|
28
|
+
* @param currentOffset - Current pagination offset
|
|
29
|
+
* @param context - Additional context for users
|
|
30
|
+
* @returns Formatted and potentially truncated string
|
|
31
|
+
*/
|
|
32
|
+
export function truncateArray(items, formatter, currentOffset = 0, context) {
|
|
33
|
+
let result = "";
|
|
34
|
+
let count = 0;
|
|
35
|
+
for (let i = 0; i < items.length; i++) {
|
|
36
|
+
const formatted = formatter(items[i], i);
|
|
37
|
+
if (result.length + formatted.length > CHARACTER_LIMIT) {
|
|
38
|
+
const nextOffset = currentOffset + count;
|
|
39
|
+
const guidance = context || `Use offset=${nextOffset} to continue from where truncation occurred`;
|
|
40
|
+
result += `\n\n[TRUNCATED: Response exceeded ${CHARACTER_LIMIT} characters. ${guidance}]`;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
result += formatted;
|
|
44
|
+
count++;
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Safely truncates a string in the middle, preserving start and end
|
|
50
|
+
*
|
|
51
|
+
* @param content - Content to truncate
|
|
52
|
+
* @param maxLength - Maximum length
|
|
53
|
+
* @returns Truncated string with "..." indicator
|
|
54
|
+
*/
|
|
55
|
+
export function truncateMiddle(content, maxLength) {
|
|
56
|
+
if (content.length <= maxLength) {
|
|
57
|
+
return content;
|
|
58
|
+
}
|
|
59
|
+
const halfLength = Math.floor((maxLength - 3) / 2);
|
|
60
|
+
const start = content.substring(0, halfLength);
|
|
61
|
+
const end = content.substring(content.length - halfLength);
|
|
62
|
+
return `${start}...${end}`;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Formats a large JSON object with optional truncation
|
|
66
|
+
*
|
|
67
|
+
* @param obj - Object to format
|
|
68
|
+
* @param indent - Indentation spaces (default: 2)
|
|
69
|
+
* @returns JSON string, potentially truncated
|
|
70
|
+
*/
|
|
71
|
+
export function formatJSON(obj, indent = 2) {
|
|
72
|
+
const json = JSON.stringify(obj, null, indent);
|
|
73
|
+
if (json.length > CHARACTER_LIMIT) {
|
|
74
|
+
return truncateIfNeeded(json, "Response is very large. Consider using filters or requesting specific fields");
|
|
75
|
+
}
|
|
76
|
+
return json;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=truncation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"truncation.js","sourceRoot":"","sources":["../../src/utils/truncation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe,EAAE,OAAgB;IAChE,IAAI,OAAO,CAAC,MAAM,IAAI,eAAe,EAAE,CAAC;QACtC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,OAAO,IAAI,0DAA0D,CAAC;IAEvF,OAAO,GAAG,SAAS,qCAAqC,eAAe,gBAAgB,QAAQ,GAAG,CAAC;AACrG,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAC3B,KAAU,EACV,SAA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;IACzD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAE/C,IAAI,IAAI,CAAC,MAAM,GAAG,eAAe,EAAE,CAAC;QAClC,OAAO,gBAAgB,CAAC,IAAI,EAAE,8EAA8E,CAAC,CAAC;IAChH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "elevenlabs-voice-agent-mcp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for ElevenLabs Voice Agent Development with 23 specialized tools for creating, configuring, testing, and deploying AI voice agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"elevenlabs-voice-agent-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "node dist/index.js",
|
|
17
|
+
"dev": "tsx watch src/index.ts",
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"clean": "rm -rf dist",
|
|
20
|
+
"test": "echo \"No tests yet\" && exit 0",
|
|
21
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"mcp",
|
|
28
|
+
"model-context-protocol",
|
|
29
|
+
"elevenlabs",
|
|
30
|
+
"voice-agent",
|
|
31
|
+
"ai-voice",
|
|
32
|
+
"conversational-ai",
|
|
33
|
+
"voice-assistant",
|
|
34
|
+
"outbound-calling",
|
|
35
|
+
"twilio",
|
|
36
|
+
"claude",
|
|
37
|
+
"chatbot",
|
|
38
|
+
"voice-bot"
|
|
39
|
+
],
|
|
40
|
+
"author": "Griffin Long",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/griffinwork40/elevenlabs-voice-agent-mcp.git"
|
|
45
|
+
},
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "https://github.com/griffinwork40/elevenlabs-voice-agent-mcp/issues"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/griffinwork40/elevenlabs-voice-agent-mcp#readme",
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@modelcontextprotocol/sdk": "^1.6.1",
|
|
52
|
+
"axios": "^1.7.9",
|
|
53
|
+
"zod": "^3.23.8",
|
|
54
|
+
"zod-to-json-schema": "^3.25.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/node": "^22.10.0",
|
|
58
|
+
"tsx": "^4.19.2",
|
|
59
|
+
"typescript": "^5.7.2"
|
|
60
|
+
}
|
|
61
|
+
}
|