elevenlabs-voice-agent-mcp 1.0.14 → 1.1.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.
Files changed (158) hide show
  1. package/README.md +202 -23
  2. package/dist/__tests__/mocks/fixtures.d.ts +136 -0
  3. package/dist/__tests__/mocks/fixtures.d.ts.map +1 -0
  4. package/dist/__tests__/mocks/fixtures.js +393 -0
  5. package/dist/__tests__/mocks/fixtures.js.map +1 -0
  6. package/dist/__tests__/schemas/schemas.test.d.ts +7 -0
  7. package/dist/__tests__/schemas/schemas.test.d.ts.map +1 -0
  8. package/dist/__tests__/schemas/schemas.test.js +537 -0
  9. package/dist/__tests__/schemas/schemas.test.js.map +1 -0
  10. package/dist/__tests__/services/elevenlabs-api.test.d.ts +7 -0
  11. package/dist/__tests__/services/elevenlabs-api.test.d.ts.map +1 -0
  12. package/dist/__tests__/services/elevenlabs-api.test.js +272 -0
  13. package/dist/__tests__/services/elevenlabs-api.test.js.map +1 -0
  14. package/dist/__tests__/services/formatters.test.d.ts +7 -0
  15. package/dist/__tests__/services/formatters.test.d.ts.map +1 -0
  16. package/dist/__tests__/services/formatters.test.js +387 -0
  17. package/dist/__tests__/services/formatters.test.js.map +1 -0
  18. package/dist/__tests__/setup.d.ts +7 -0
  19. package/dist/__tests__/setup.d.ts.map +1 -0
  20. package/dist/__tests__/setup.js +25 -0
  21. package/dist/__tests__/setup.js.map +1 -0
  22. package/dist/__tests__/tools/agent-tools.test.d.ts +7 -0
  23. package/dist/__tests__/tools/agent-tools.test.d.ts.map +1 -0
  24. package/dist/__tests__/tools/agent-tools.test.js +343 -0
  25. package/dist/__tests__/tools/agent-tools.test.js.map +1 -0
  26. package/dist/__tests__/tools/batch-calling-tools.test.d.ts +7 -0
  27. package/dist/__tests__/tools/batch-calling-tools.test.d.ts.map +1 -0
  28. package/dist/__tests__/tools/batch-calling-tools.test.js +236 -0
  29. package/dist/__tests__/tools/batch-calling-tools.test.js.map +1 -0
  30. package/dist/__tests__/tools/conversation-tools.test.d.ts +7 -0
  31. package/dist/__tests__/tools/conversation-tools.test.d.ts.map +1 -0
  32. package/dist/__tests__/tools/conversation-tools.test.js +212 -0
  33. package/dist/__tests__/tools/conversation-tools.test.js.map +1 -0
  34. package/dist/__tests__/tools/knowledge-tools.test.d.ts +7 -0
  35. package/dist/__tests__/tools/knowledge-tools.test.d.ts.map +1 -0
  36. package/dist/__tests__/tools/knowledge-tools.test.js +209 -0
  37. package/dist/__tests__/tools/knowledge-tools.test.js.map +1 -0
  38. package/dist/__tests__/tools/outbound-tools.test.d.ts +7 -0
  39. package/dist/__tests__/tools/outbound-tools.test.d.ts.map +1 -0
  40. package/dist/__tests__/tools/outbound-tools.test.js +194 -0
  41. package/dist/__tests__/tools/outbound-tools.test.js.map +1 -0
  42. package/dist/__tests__/tools/phone-number-tools.test.d.ts +7 -0
  43. package/dist/__tests__/tools/phone-number-tools.test.d.ts.map +1 -0
  44. package/dist/__tests__/tools/phone-number-tools.test.js +314 -0
  45. package/dist/__tests__/tools/phone-number-tools.test.js.map +1 -0
  46. package/dist/__tests__/tools/tool-tools.test.d.ts +7 -0
  47. package/dist/__tests__/tools/tool-tools.test.d.ts.map +1 -0
  48. package/dist/__tests__/tools/tool-tools.test.js +287 -0
  49. package/dist/__tests__/tools/tool-tools.test.js.map +1 -0
  50. package/dist/__tests__/tools/utility-tools.test.d.ts +7 -0
  51. package/dist/__tests__/tools/utility-tools.test.d.ts.map +1 -0
  52. package/dist/__tests__/tools/utility-tools.test.js +207 -0
  53. package/dist/__tests__/tools/utility-tools.test.js.map +1 -0
  54. package/dist/__tests__/utils/error-handlers.test.d.ts +7 -0
  55. package/dist/__tests__/utils/error-handlers.test.d.ts.map +1 -0
  56. package/dist/__tests__/utils/error-handlers.test.js +237 -0
  57. package/dist/__tests__/utils/error-handlers.test.js.map +1 -0
  58. package/dist/__tests__/utils/phone-normalizer.test.d.ts +7 -0
  59. package/dist/__tests__/utils/phone-normalizer.test.d.ts.map +1 -0
  60. package/dist/__tests__/utils/phone-normalizer.test.js +224 -0
  61. package/dist/__tests__/utils/phone-normalizer.test.js.map +1 -0
  62. package/dist/__tests__/utils/truncation.test.d.ts +7 -0
  63. package/dist/__tests__/utils/truncation.test.d.ts.map +1 -0
  64. package/dist/__tests__/utils/truncation.test.js +208 -0
  65. package/dist/__tests__/utils/truncation.test.js.map +1 -0
  66. package/dist/constants.d.ts +129 -5
  67. package/dist/constants.d.ts.map +1 -1
  68. package/dist/constants.js +150 -24
  69. package/dist/constants.js.map +1 -1
  70. package/dist/index.d.ts +13 -2
  71. package/dist/index.d.ts.map +1 -1
  72. package/dist/index.js +27 -3
  73. package/dist/index.js.map +1 -1
  74. package/dist/schemas/agent-schemas.d.ts +23 -8
  75. package/dist/schemas/agent-schemas.d.ts.map +1 -1
  76. package/dist/schemas/agent-schemas.js +23 -8
  77. package/dist/schemas/agent-schemas.js.map +1 -1
  78. package/dist/schemas/batch-calling-schemas.d.ts +24 -9
  79. package/dist/schemas/batch-calling-schemas.d.ts.map +1 -1
  80. package/dist/schemas/batch-calling-schemas.js +24 -9
  81. package/dist/schemas/batch-calling-schemas.js.map +1 -1
  82. package/dist/schemas/common-schemas.d.ts +45 -13
  83. package/dist/schemas/common-schemas.d.ts.map +1 -1
  84. package/dist/schemas/common-schemas.js +45 -13
  85. package/dist/schemas/common-schemas.js.map +1 -1
  86. package/dist/schemas/conversation-schemas.d.ts +12 -5
  87. package/dist/schemas/conversation-schemas.d.ts.map +1 -1
  88. package/dist/schemas/conversation-schemas.js +12 -5
  89. package/dist/schemas/conversation-schemas.js.map +1 -1
  90. package/dist/schemas/outbound-schemas.d.ts +23 -8
  91. package/dist/schemas/outbound-schemas.d.ts.map +1 -1
  92. package/dist/schemas/outbound-schemas.js +23 -8
  93. package/dist/schemas/outbound-schemas.js.map +1 -1
  94. package/dist/schemas/phone-number-schemas.d.ts +37 -14
  95. package/dist/schemas/phone-number-schemas.d.ts.map +1 -1
  96. package/dist/schemas/phone-number-schemas.js +37 -14
  97. package/dist/schemas/phone-number-schemas.js.map +1 -1
  98. package/dist/schemas/tool-schemas.d.ts +27 -9
  99. package/dist/schemas/tool-schemas.d.ts.map +1 -1
  100. package/dist/schemas/tool-schemas.js +34 -11
  101. package/dist/schemas/tool-schemas.js.map +1 -1
  102. package/dist/services/elevenlabs-api.d.ts +108 -14
  103. package/dist/services/elevenlabs-api.d.ts.map +1 -1
  104. package/dist/services/elevenlabs-api.js +108 -14
  105. package/dist/services/elevenlabs-api.js.map +1 -1
  106. package/dist/services/formatters.d.ts +147 -21
  107. package/dist/services/formatters.d.ts.map +1 -1
  108. package/dist/services/formatters.js +147 -21
  109. package/dist/services/formatters.js.map +1 -1
  110. package/dist/tools/agent-tools.d.ts +5 -3
  111. package/dist/tools/agent-tools.d.ts.map +1 -1
  112. package/dist/tools/agent-tools.js +5 -3
  113. package/dist/tools/agent-tools.js.map +1 -1
  114. package/dist/tools/batch-calling-tools.d.ts +5 -3
  115. package/dist/tools/batch-calling-tools.d.ts.map +1 -1
  116. package/dist/tools/batch-calling-tools.js +5 -3
  117. package/dist/tools/batch-calling-tools.js.map +1 -1
  118. package/dist/tools/conversation-tools.d.ts +5 -3
  119. package/dist/tools/conversation-tools.d.ts.map +1 -1
  120. package/dist/tools/conversation-tools.js +5 -3
  121. package/dist/tools/conversation-tools.js.map +1 -1
  122. package/dist/tools/knowledge-tools.d.ts +5 -3
  123. package/dist/tools/knowledge-tools.d.ts.map +1 -1
  124. package/dist/tools/knowledge-tools.js +5 -3
  125. package/dist/tools/knowledge-tools.js.map +1 -1
  126. package/dist/tools/outbound-tools.d.ts +5 -3
  127. package/dist/tools/outbound-tools.d.ts.map +1 -1
  128. package/dist/tools/outbound-tools.js +5 -3
  129. package/dist/tools/outbound-tools.js.map +1 -1
  130. package/dist/tools/phone-number-tools.d.ts +5 -4
  131. package/dist/tools/phone-number-tools.d.ts.map +1 -1
  132. package/dist/tools/phone-number-tools.js +5 -4
  133. package/dist/tools/phone-number-tools.js.map +1 -1
  134. package/dist/tools/tool-tools.d.ts +5 -3
  135. package/dist/tools/tool-tools.d.ts.map +1 -1
  136. package/dist/tools/tool-tools.js +5 -3
  137. package/dist/tools/tool-tools.js.map +1 -1
  138. package/dist/tools/utility-tools.d.ts +5 -3
  139. package/dist/tools/utility-tools.d.ts.map +1 -1
  140. package/dist/tools/utility-tools.js +5 -3
  141. package/dist/tools/utility-tools.js.map +1 -1
  142. package/dist/types.d.ts +457 -10
  143. package/dist/types.d.ts.map +1 -1
  144. package/dist/types.js +15 -3
  145. package/dist/types.js.map +1 -1
  146. package/dist/utils/error-handlers.d.ts +47 -14
  147. package/dist/utils/error-handlers.d.ts.map +1 -1
  148. package/dist/utils/error-handlers.js +47 -14
  149. package/dist/utils/error-handlers.js.map +1 -1
  150. package/dist/utils/phone-normalizer.d.ts +43 -22
  151. package/dist/utils/phone-normalizer.d.ts.map +1 -1
  152. package/dist/utils/phone-normalizer.js +43 -22
  153. package/dist/utils/phone-normalizer.js.map +1 -1
  154. package/dist/utils/truncation.d.ts +46 -22
  155. package/dist/utils/truncation.d.ts.map +1 -1
  156. package/dist/utils/truncation.js +46 -22
  157. package/dist/utils/truncation.js.map +1 -1
  158. package/package.json +10 -4
@@ -0,0 +1,208 @@
1
+ /**
2
+ * Tests for truncation utilities
3
+ *
4
+ * Tests content truncation and formatting functions.
5
+ */
6
+ import { describe, it, expect } from "vitest";
7
+ import { truncateIfNeeded, truncateArray, truncateMiddle, formatJSON } from "../../utils/truncation.js";
8
+ import { CHARACTER_LIMIT } from "../../constants.js";
9
+ describe("Truncation Utilities", () => {
10
+ describe("truncateIfNeeded", () => {
11
+ it("should return content unchanged if under limit", () => {
12
+ const content = "Short content";
13
+ const result = truncateIfNeeded(content);
14
+ expect(result).toBe(content);
15
+ });
16
+ it("should return content unchanged at exactly limit", () => {
17
+ const content = "x".repeat(CHARACTER_LIMIT);
18
+ const result = truncateIfNeeded(content);
19
+ expect(result).toBe(content);
20
+ });
21
+ it("should truncate content exceeding limit", () => {
22
+ const content = "x".repeat(CHARACTER_LIMIT + 100);
23
+ const result = truncateIfNeeded(content);
24
+ // Result includes the truncated content + truncation message, so it's slightly longer
25
+ // but the original content portion is truncated
26
+ expect(result).toContain("[TRUNCATED:");
27
+ expect(result).toContain(`${CHARACTER_LIMIT} characters`);
28
+ });
29
+ it("should include default guidance in truncation message", () => {
30
+ const content = "x".repeat(CHARACTER_LIMIT + 100);
31
+ const result = truncateIfNeeded(content);
32
+ expect(result).toContain("Consider using filters or pagination");
33
+ });
34
+ it("should include custom context in truncation message", () => {
35
+ const content = "x".repeat(CHARACTER_LIMIT + 100);
36
+ const context = "Use offset=50 to continue";
37
+ const result = truncateIfNeeded(content, context);
38
+ expect(result).toContain("Use offset=50 to continue");
39
+ });
40
+ it("should preserve content start when truncating", () => {
41
+ const content = "START" + "x".repeat(CHARACTER_LIMIT + 100);
42
+ const result = truncateIfNeeded(content);
43
+ expect(result.startsWith("START")).toBe(true);
44
+ });
45
+ });
46
+ describe("truncateArray", () => {
47
+ const formatter = (item, idx) => `${idx + 1}. ${item}\n`;
48
+ it("should format all items if under limit", () => {
49
+ const items = ["Item 1", "Item 2", "Item 3"];
50
+ const result = truncateArray(items, formatter);
51
+ expect(result).toContain("1. Item 1");
52
+ expect(result).toContain("2. Item 2");
53
+ expect(result).toContain("3. Item 3");
54
+ expect(result).not.toContain("[TRUNCATED:");
55
+ });
56
+ it("should truncate when formatted content exceeds limit", () => {
57
+ // Create items that will exceed CHARACTER_LIMIT when formatted
58
+ const longItem = "x".repeat(5000);
59
+ const items = Array(10).fill(longItem);
60
+ const result = truncateArray(items, formatter);
61
+ expect(result).toContain("[TRUNCATED:");
62
+ });
63
+ it("should include offset in truncation guidance", () => {
64
+ const longItem = "x".repeat(5000);
65
+ const items = Array(10).fill(longItem);
66
+ const result = truncateArray(items, formatter, 5);
67
+ // Should include next offset based on items processed
68
+ expect(result).toContain("offset=");
69
+ });
70
+ it("should include custom context in truncation", () => {
71
+ const longItem = "x".repeat(5000);
72
+ const items = Array(10).fill(longItem);
73
+ const result = truncateArray(items, formatter, 0, "Custom guidance here");
74
+ expect(result).toContain("Custom guidance here");
75
+ });
76
+ it("should handle empty array", () => {
77
+ const result = truncateArray([], formatter);
78
+ expect(result).toBe("");
79
+ });
80
+ it("should handle single item", () => {
81
+ const items = ["Single item"];
82
+ const result = truncateArray(items, formatter);
83
+ expect(result).toBe("1. Single item\n");
84
+ });
85
+ it("should work with complex formatter", () => {
86
+ const agents = [
87
+ { name: "Agent 1", id: "ag_1" },
88
+ { name: "Agent 2", id: "ag_2" }
89
+ ];
90
+ const agentFormatter = (agent, idx) => `## ${idx + 1}. ${agent.name}\nID: ${agent.id}\n\n`;
91
+ const result = truncateArray(agents, agentFormatter);
92
+ expect(result).toContain("## 1. Agent 1");
93
+ expect(result).toContain("ID: ag_1");
94
+ expect(result).toContain("## 2. Agent 2");
95
+ });
96
+ });
97
+ describe("truncateMiddle", () => {
98
+ it("should return content unchanged if under maxLength", () => {
99
+ const content = "Short";
100
+ const result = truncateMiddle(content, 10);
101
+ expect(result).toBe("Short");
102
+ });
103
+ it("should return content unchanged at exactly maxLength", () => {
104
+ const content = "Exactly10!";
105
+ const result = truncateMiddle(content, 10);
106
+ expect(result).toBe("Exactly10!");
107
+ });
108
+ it("should truncate middle when exceeding maxLength", () => {
109
+ const content = "Hello World! This is a long string.";
110
+ const result = truncateMiddle(content, 20);
111
+ // The length may be slightly less than maxLength due to how halfLength is calculated
112
+ expect(result.length).toBeLessThanOrEqual(20);
113
+ expect(result).toContain("...");
114
+ expect(result.startsWith("Hello")).toBe(true);
115
+ expect(result.endsWith("ing.")).toBe(true);
116
+ });
117
+ it("should preserve start and end equally", () => {
118
+ const content = "AAAAABBBBBCCCCC";
119
+ const result = truncateMiddle(content, 11);
120
+ // With maxLength 11 and "..." taking 3 chars, we have 8 chars for content
121
+ // That's 4 chars at start and 4 at end
122
+ expect(result).toMatch(/^AAAA\.\.\.CCCC$/);
123
+ });
124
+ it("should handle very short maxLength", () => {
125
+ const content = "This is too long";
126
+ const result = truncateMiddle(content, 5);
127
+ expect(result.length).toBe(5);
128
+ expect(result).toContain("...");
129
+ });
130
+ it("should handle maxLength of 3 (just ellipsis)", () => {
131
+ const content = "Long content";
132
+ const result = truncateMiddle(content, 3);
133
+ // With maxLength 3, halfLength = (3-3)/2 = 0, so we get "..."
134
+ expect(result).toBe("...");
135
+ });
136
+ });
137
+ describe("formatJSON", () => {
138
+ it("should format object with default indentation", () => {
139
+ const obj = { key: "value", nested: { a: 1 } };
140
+ const result = formatJSON(obj);
141
+ expect(result).toBe(JSON.stringify(obj, null, 2));
142
+ });
143
+ it("should format object with custom indentation", () => {
144
+ const obj = { key: "value" };
145
+ const result = formatJSON(obj, 4);
146
+ expect(result).toBe(JSON.stringify(obj, null, 4));
147
+ });
148
+ it("should truncate large JSON objects", () => {
149
+ // Create object larger than CHARACTER_LIMIT
150
+ const largeObj = {
151
+ items: Array(1000).fill({ id: "x".repeat(100), data: "y".repeat(100) })
152
+ };
153
+ const result = formatJSON(largeObj);
154
+ expect(result).toContain("[TRUNCATED:");
155
+ expect(result).toContain(`${CHARACTER_LIMIT} characters`);
156
+ });
157
+ it("should not truncate small objects", () => {
158
+ const smallObj = { a: 1, b: 2, c: 3 };
159
+ const result = formatJSON(smallObj);
160
+ expect(result).not.toContain("[TRUNCATED:");
161
+ });
162
+ it("should handle arrays", () => {
163
+ const arr = [1, 2, 3];
164
+ const result = formatJSON(arr);
165
+ expect(result).toBe("[\n 1,\n 2,\n 3\n]");
166
+ });
167
+ it("should handle null", () => {
168
+ const result = formatJSON(null);
169
+ expect(result).toBe("null");
170
+ });
171
+ it("should handle strings", () => {
172
+ const result = formatJSON("test string");
173
+ expect(result).toBe('"test string"');
174
+ });
175
+ it("should handle numbers", () => {
176
+ const result = formatJSON(42);
177
+ expect(result).toBe("42");
178
+ });
179
+ it("should handle booleans", () => {
180
+ expect(formatJSON(true)).toBe("true");
181
+ expect(formatJSON(false)).toBe("false");
182
+ });
183
+ it("should handle deeply nested objects", () => {
184
+ const obj = {
185
+ level1: {
186
+ level2: {
187
+ level3: {
188
+ value: "deep"
189
+ }
190
+ }
191
+ }
192
+ };
193
+ const result = formatJSON(obj);
194
+ expect(result).toContain('"level1"');
195
+ expect(result).toContain('"level2"');
196
+ expect(result).toContain('"level3"');
197
+ expect(result).toContain('"deep"');
198
+ });
199
+ it("should handle special characters in strings", () => {
200
+ const obj = { text: "Hello\nWorld\t\"Quoted\"" };
201
+ const result = formatJSON(obj);
202
+ expect(result).toContain("\\n");
203
+ expect(result).toContain("\\t");
204
+ expect(result).toContain('\\"');
205
+ });
206
+ });
207
+ });
208
+ //# sourceMappingURL=truncation.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"truncation.test.js","sourceRoot":"","sources":["../../../src/__tests__/utils/truncation.test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAM,MAAM,QAAQ,CAAC;AAClD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACpC,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACxD,MAAM,OAAO,GAAG,eAAe,CAAC;YAEhC,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAEzC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;YAC1D,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;YAE5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C,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,25 +1,149 @@
1
1
  /**
2
- * Constants for ElevenLabs Voice Agent MCP Server
3
- *
4
- * Contains API URLs, character limits, default values, and supported options
5
- * for ElevenLabs Voice Agent API integration.
2
+ * @fileoverview Constants for ElevenLabs Voice Agent MCP Server
3
+ * @description Contains API URLs, character limits, default values, and supported options
4
+ * for ElevenLabs Voice Agent API integration. These constants define the operational
5
+ * parameters and configuration options available throughout the MCP server.
6
+ * @module constants
7
+ */
8
+ /**
9
+ * Base URL for all ElevenLabs API requests.
10
+ * @description The root endpoint for the ElevenLabs REST API. All API calls
11
+ * are made relative to this URL.
12
+ * @constant {string}
13
+ * @example
14
+ * // Used internally by the API client
15
+ * const url = `${API_BASE_URL}/convai/agents`;
6
16
  */
7
17
  export declare const API_BASE_URL = "https://api.elevenlabs.io/v1";
18
+ /**
19
+ * Maximum character limit for MCP tool responses.
20
+ * @description Responses exceeding this limit are automatically truncated
21
+ * with pagination guidance to prevent overwhelming clients.
22
+ * @constant {number}
23
+ */
8
24
  export declare const CHARACTER_LIMIT = 25000;
25
+ /**
26
+ * Default number of items returned in paginated list responses.
27
+ * @description Used when no limit is specified in list operations.
28
+ * @constant {number}
29
+ */
9
30
  export declare const DEFAULT_LIMIT = 20;
31
+ /**
32
+ * Maximum number of items that can be requested in a single paginated response.
33
+ * @description Prevents excessive data transfer in single requests.
34
+ * @constant {number}
35
+ */
10
36
  export declare const MAX_LIMIT = 100;
37
+ /**
38
+ * Default LLM model for voice agents.
39
+ * @description Claude Sonnet 4.5 with version date. The @ format specifies
40
+ * the exact model version for consistent behavior.
41
+ * @constant {string}
42
+ */
11
43
  export declare const DEFAULT_LLM = "claude-sonnet-4-5@20250929";
12
- export declare const DEFAULT_VOICE_MODEL = "eleven_turbo_v2";
44
+ /**
45
+ * Default voice synthesis model for agents.
46
+ * @description Turbo v2.5 provides high-quality synthesis with support for
47
+ * 32 languages. Balances speed and quality for conversational AI.
48
+ * @constant {string}
49
+ */
50
+ export declare const DEFAULT_VOICE_MODEL = "eleven_turbo_v2_5";
51
+ /**
52
+ * Default voice ID for new agents.
53
+ * @description Rachel voice - a natural, professional female voice suitable
54
+ * for customer service and general conversation.
55
+ * @constant {string}
56
+ */
13
57
  export declare const DEFAULT_VOICE_ID = "21m00Tcm4TlvDq8ikWAM";
58
+ /**
59
+ * Default language code for voice agents.
60
+ * @description English (US) is the default language for agent conversations.
61
+ * @constant {string}
62
+ */
14
63
  export declare const DEFAULT_LANGUAGE = "en";
64
+ /**
65
+ * Array of commonly used LLM model identifiers.
66
+ * @description These are provided as defaults/examples. ElevenLabs may add new
67
+ * models that work without code changes. Any valid ElevenLabs model identifier
68
+ * is accepted by the API. Use @ format for versioned models.
69
+ * @constant {readonly string[]}
70
+ * @example
71
+ * // Using a supported LLM
72
+ * const agent = await createAgent({
73
+ * llm: "claude-sonnet-4-5@20250929",
74
+ * // ... other config
75
+ * });
76
+ */
15
77
  export declare const SUPPORTED_LLMS: readonly ["gpt-4o", "gpt-4o-mini", "claude-sonnet-4-5", "claude-sonnet-4-5@20250929", "claude-sonnet-4", "claude-sonnet-4@20250514", "claude-haiku-4-5", "claude-haiku-4-5@20251001", "claude-3-5-sonnet", "claude-3-5-sonnet@20240620", "claude-3-5-sonnet-v2@20241022", "claude-3-haiku", "claude-3-haiku@20240307", "gemini-2.0-flash", "gemini-2.0-flash-exp"];
78
+ /**
79
+ * Supported voice models for conversational AI agents.
80
+ * @description Each model has different characteristics:
81
+ * - `eleven_turbo_v2`: English only, optimized for speed
82
+ * - `eleven_turbo_v2_5`: 32 languages, higher quality
83
+ * - `eleven_flash_v2`: English only, lowest latency
84
+ * - `eleven_flash_v2_5`: 32 languages, low latency
85
+ * - `eleven_multilingual_v2`: Full multilingual support
86
+ * @constant {readonly string[]}
87
+ */
16
88
  export declare const SUPPORTED_VOICE_MODELS: readonly ["eleven_turbo_v2", "eleven_turbo_v2_5", "eleven_flash_v2", "eleven_flash_v2_5", "eleven_multilingual_v2"];
89
+ /**
90
+ * Supported language codes for voice agents.
91
+ * @description ISO 639-1 language codes supported by ElevenLabs voice agents.
92
+ * The actual language support depends on the selected voice model.
93
+ * @constant {readonly string[]}
94
+ */
17
95
  export declare const SUPPORTED_LANGUAGES: readonly ["en", "es", "fr", "de", "it", "pt", "pl", "nl", "ja", "zh", "ko", "ar", "hi"];
96
+ /**
97
+ * Widget authentication types.
98
+ * @description Controls how users authenticate when using the web widget:
99
+ * - `none`: No authentication required
100
+ * - `manual`: Requires manual authentication
101
+ * - `open`: Open access with optional authentication
102
+ * @constant {readonly string[]}
103
+ */
18
104
  export declare const AUTH_TYPES: readonly ["none", "manual", "open"];
105
+ /**
106
+ * Request timeout in milliseconds.
107
+ * @description Maximum time to wait for an API response before timing out.
108
+ * Set to 30 seconds to accommodate voice agent operations.
109
+ * @constant {number}
110
+ */
19
111
  export declare const REQUEST_TIMEOUT = 30000;
112
+ /**
113
+ * Maximum number of recipients in a single batch call job.
114
+ * @description ElevenLabs limits batch calling to 10,000 recipients per job
115
+ * to ensure system stability and processing capacity.
116
+ * @constant {number}
117
+ */
20
118
  export declare const MAX_BATCH_RECIPIENTS = 10000;
119
+ /**
120
+ * Minimum number of recipients required for a batch call job.
121
+ * @description At least one recipient must be specified for batch calling.
122
+ * @constant {number}
123
+ */
21
124
  export declare const MIN_BATCH_RECIPIENTS = 1;
125
+ /**
126
+ * Supported phone number providers.
127
+ * @description Phone numbers can be provisioned through:
128
+ * - `twilio`: Twilio-managed phone numbers
129
+ * - `sip_trunk`: Self-managed SIP trunk connections
130
+ * @constant {readonly string[]}
131
+ */
22
132
  export declare const PHONE_PROVIDERS: readonly ["twilio", "sip_trunk"];
133
+ /**
134
+ * ElevenLabs region identifiers.
135
+ * @description Geographic regions for phone number routing:
136
+ * - `us1`: United States
137
+ * - `ie1`: Ireland (Europe)
138
+ * - `au1`: Australia
139
+ * @constant {readonly string[]}
140
+ */
23
141
  export declare const REGION_IDS: readonly ["us1", "ie1", "au1"];
142
+ /**
143
+ * Twilio edge locations for voice routing.
144
+ * @description Geographic points of presence for Twilio voice traffic
145
+ * optimization. Choose the location closest to your users for best latency.
146
+ * @constant {readonly string[]}
147
+ */
24
148
  export declare const EDGE_LOCATIONS: readonly ["ashburn", "dublin", "frankfurt", "sao-paulo", "singapore", "sydney", "tokyo", "umatilla", "roaming"];
25
149
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,YAAY,iCAAiC,CAAC;AAG3D,eAAO,MAAM,eAAe,QAAQ,CAAC;AACrC,eAAO,MAAM,aAAa,KAAK,CAAC;AAChC,eAAO,MAAM,SAAS,MAAM,CAAC;AAG7B,eAAO,MAAM,WAAW,+BAA+B,CAAC;AACxD,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AACvD,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAKrC,eAAO,MAAM,cAAc,oWAgBjB,CAAC;AAMX,eAAO,MAAM,sBAAsB,qHAMzB,CAAC;AAGX,eAAO,MAAM,mBAAmB,yFAEtB,CAAC;AAGX,eAAO,MAAM,UAAU,qCAAsC,CAAC;AAG9D,eAAO,MAAM,eAAe,QAAQ,CAAC;AAGrC,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAC1C,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAGtC,eAAO,MAAM,eAAe,kCAAmC,CAAC;AAGhE,eAAO,MAAM,UAAU,gCAAiC,CAAC;AAGzD,eAAO,MAAM,cAAc,iHAGjB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,iCAAiC,CAAC;AAM3D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAQ,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,SAAS,MAAM,CAAC;AAM7B;;;;;GAKG;AACH,eAAO,MAAM,WAAW,+BAA+B,CAAC;AAExD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,yBAAyB,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAMrC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,oWAgBjB,CAAC;AAEX;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,qHAMzB,CAAC;AAEX;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,yFAEtB,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,qCAAsC,CAAC;AAM9D;;;;;GAKG;AACH,eAAO,MAAM,eAAe,QAAQ,CAAC;AAMrC;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAMtC;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,kCAAmC,CAAC;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,gCAAiC,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,iHAGjB,CAAC"}
package/dist/constants.js CHANGED
@@ -1,22 +1,88 @@
1
1
  /**
2
- * Constants for ElevenLabs Voice Agent MCP Server
3
- *
4
- * Contains API URLs, character limits, default values, and supported options
5
- * for ElevenLabs Voice Agent API integration.
2
+ * @fileoverview Constants for ElevenLabs Voice Agent MCP Server
3
+ * @description Contains API URLs, character limits, default values, and supported options
4
+ * for ElevenLabs Voice Agent API integration. These constants define the operational
5
+ * parameters and configuration options available throughout the MCP server.
6
+ * @module constants
7
+ */
8
+ /**
9
+ * Base URL for all ElevenLabs API requests.
10
+ * @description The root endpoint for the ElevenLabs REST API. All API calls
11
+ * are made relative to this URL.
12
+ * @constant {string}
13
+ * @example
14
+ * // Used internally by the API client
15
+ * const url = `${API_BASE_URL}/convai/agents`;
6
16
  */
7
17
  export const API_BASE_URL = "https://api.elevenlabs.io/v1";
8
- // Response limits
18
+ // ============================================================================
19
+ // Response Limits
20
+ // ============================================================================
21
+ /**
22
+ * Maximum character limit for MCP tool responses.
23
+ * @description Responses exceeding this limit are automatically truncated
24
+ * with pagination guidance to prevent overwhelming clients.
25
+ * @constant {number}
26
+ */
9
27
  export const CHARACTER_LIMIT = 25000;
28
+ /**
29
+ * Default number of items returned in paginated list responses.
30
+ * @description Used when no limit is specified in list operations.
31
+ * @constant {number}
32
+ */
10
33
  export const DEFAULT_LIMIT = 20;
34
+ /**
35
+ * Maximum number of items that can be requested in a single paginated response.
36
+ * @description Prevents excessive data transfer in single requests.
37
+ * @constant {number}
38
+ */
11
39
  export const MAX_LIMIT = 100;
12
- // Default configuration values
13
- export const DEFAULT_LLM = "claude-sonnet-4-5@20250929"; // Claude Sonnet 4.5 (using @ date format)
14
- export const DEFAULT_VOICE_MODEL = "eleven_turbo_v2"; // Turbo v2 for English agents
15
- export const DEFAULT_VOICE_ID = "21m00Tcm4TlvDq8ikWAM"; // Rachel voice
40
+ // ============================================================================
41
+ // Default Configuration Values
42
+ // ============================================================================
43
+ /**
44
+ * Default LLM model for voice agents.
45
+ * @description Claude Sonnet 4.5 with version date. The @ format specifies
46
+ * the exact model version for consistent behavior.
47
+ * @constant {string}
48
+ */
49
+ export const DEFAULT_LLM = "claude-sonnet-4-5@20250929";
50
+ /**
51
+ * Default voice synthesis model for agents.
52
+ * @description Turbo v2.5 provides high-quality synthesis with support for
53
+ * 32 languages. Balances speed and quality for conversational AI.
54
+ * @constant {string}
55
+ */
56
+ export const DEFAULT_VOICE_MODEL = "eleven_turbo_v2_5";
57
+ /**
58
+ * Default voice ID for new agents.
59
+ * @description Rachel voice - a natural, professional female voice suitable
60
+ * for customer service and general conversation.
61
+ * @constant {string}
62
+ */
63
+ export const DEFAULT_VOICE_ID = "21m00Tcm4TlvDq8ikWAM";
64
+ /**
65
+ * Default language code for voice agents.
66
+ * @description English (US) is the default language for agent conversations.
67
+ * @constant {string}
68
+ */
16
69
  export const DEFAULT_LANGUAGE = "en";
17
- // Common LLM models (examples - any valid ElevenLabs model identifier is accepted)
18
- // These are provided as defaults/examples; ElevenLabs may add new models that work without code changes
19
- // Note: Use @ format for versioned models (e.g., claude-sonnet-4-5@20250929)
70
+ // ============================================================================
71
+ // Supported Models and Options
72
+ // ============================================================================
73
+ /**
74
+ * Array of commonly used LLM model identifiers.
75
+ * @description These are provided as defaults/examples. ElevenLabs may add new
76
+ * models that work without code changes. Any valid ElevenLabs model identifier
77
+ * is accepted by the API. Use @ format for versioned models.
78
+ * @constant {readonly string[]}
79
+ * @example
80
+ * // Using a supported LLM
81
+ * const agent = await createAgent({
82
+ * llm: "claude-sonnet-4-5@20250929",
83
+ * // ... other config
84
+ * });
85
+ */
20
86
  export const SUPPORTED_LLMS = [
21
87
  "gpt-4o",
22
88
  "gpt-4o-mini",
@@ -34,10 +100,16 @@ export const SUPPORTED_LLMS = [
34
100
  "gemini-2.0-flash",
35
101
  "gemini-2.0-flash-exp"
36
102
  ];
37
- // Supported voice models for conversational AI agents
38
- // v2 models (turbo_v2, flash_v2) are optimized for English only
39
- // v2.5 models (turbo_v2_5, flash_v2_5) support 32 languages
40
- // multilingual_v2 supports multiple languages
103
+ /**
104
+ * Supported voice models for conversational AI agents.
105
+ * @description Each model has different characteristics:
106
+ * - `eleven_turbo_v2`: English only, optimized for speed
107
+ * - `eleven_turbo_v2_5`: 32 languages, higher quality
108
+ * - `eleven_flash_v2`: English only, lowest latency
109
+ * - `eleven_flash_v2_5`: 32 languages, low latency
110
+ * - `eleven_multilingual_v2`: Full multilingual support
111
+ * @constant {readonly string[]}
112
+ */
41
113
  export const SUPPORTED_VOICE_MODELS = [
42
114
  "eleven_turbo_v2",
43
115
  "eleven_turbo_v2_5",
@@ -45,22 +117,76 @@ export const SUPPORTED_VOICE_MODELS = [
45
117
  "eleven_flash_v2_5",
46
118
  "eleven_multilingual_v2"
47
119
  ];
48
- // Supported languages
120
+ /**
121
+ * Supported language codes for voice agents.
122
+ * @description ISO 639-1 language codes supported by ElevenLabs voice agents.
123
+ * The actual language support depends on the selected voice model.
124
+ * @constant {readonly string[]}
125
+ */
49
126
  export const SUPPORTED_LANGUAGES = [
50
127
  "en", "es", "fr", "de", "it", "pt", "pl", "nl", "ja", "zh", "ko", "ar", "hi"
51
128
  ];
52
- // Authentication types
129
+ /**
130
+ * Widget authentication types.
131
+ * @description Controls how users authenticate when using the web widget:
132
+ * - `none`: No authentication required
133
+ * - `manual`: Requires manual authentication
134
+ * - `open`: Open access with optional authentication
135
+ * @constant {readonly string[]}
136
+ */
53
137
  export const AUTH_TYPES = ["none", "manual", "open"];
54
- // API timeouts
55
- export const REQUEST_TIMEOUT = 30000; // 30 seconds
56
- // Batch calling limits
138
+ // ============================================================================
139
+ // API Configuration
140
+ // ============================================================================
141
+ /**
142
+ * Request timeout in milliseconds.
143
+ * @description Maximum time to wait for an API response before timing out.
144
+ * Set to 30 seconds to accommodate voice agent operations.
145
+ * @constant {number}
146
+ */
147
+ export const REQUEST_TIMEOUT = 30000;
148
+ // ============================================================================
149
+ // Batch Calling Limits
150
+ // ============================================================================
151
+ /**
152
+ * Maximum number of recipients in a single batch call job.
153
+ * @description ElevenLabs limits batch calling to 10,000 recipients per job
154
+ * to ensure system stability and processing capacity.
155
+ * @constant {number}
156
+ */
57
157
  export const MAX_BATCH_RECIPIENTS = 10000;
158
+ /**
159
+ * Minimum number of recipients required for a batch call job.
160
+ * @description At least one recipient must be specified for batch calling.
161
+ * @constant {number}
162
+ */
58
163
  export const MIN_BATCH_RECIPIENTS = 1;
59
- // Phone providers
164
+ // ============================================================================
165
+ // Phone Number Configuration
166
+ // ============================================================================
167
+ /**
168
+ * Supported phone number providers.
169
+ * @description Phone numbers can be provisioned through:
170
+ * - `twilio`: Twilio-managed phone numbers
171
+ * - `sip_trunk`: Self-managed SIP trunk connections
172
+ * @constant {readonly string[]}
173
+ */
60
174
  export const PHONE_PROVIDERS = ["twilio", "sip_trunk"];
61
- // Phone number regions
175
+ /**
176
+ * ElevenLabs region identifiers.
177
+ * @description Geographic regions for phone number routing:
178
+ * - `us1`: United States
179
+ * - `ie1`: Ireland (Europe)
180
+ * - `au1`: Australia
181
+ * @constant {readonly string[]}
182
+ */
62
183
  export const REGION_IDS = ["us1", "ie1", "au1"];
63
- // Edge locations
184
+ /**
185
+ * Twilio edge locations for voice routing.
186
+ * @description Geographic points of presence for Twilio voice traffic
187
+ * optimization. Choose the location closest to your users for best latency.
188
+ * @constant {readonly string[]}
189
+ */
64
190
  export const EDGE_LOCATIONS = [
65
191
  "ashburn", "dublin", "frankfurt", "sao-paulo",
66
192
  "singapore", "sydney", "tokyo", "umatilla", "roaming"
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,8BAA8B,CAAC;AAE3D,kBAAkB;AAClB,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC;AACrC,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAChC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,CAAC;AAE7B,+BAA+B;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,4BAA4B,CAAC,CAAC,0CAA0C;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,CAAC,8BAA8B;AACpF,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAC,CAAC,eAAe;AACvE,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,mFAAmF;AACnF,wGAAwG;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P Server
4
+ * @description Main entry point for the MCP server providing tools for voice agent development.
5
+ * This server implements the Model Context Protocol (MCP) to expose 23 specialized tools
6
+ * for creating, configuring, testing, monitoring, and deploying ElevenLabs Voice Agents.
4
7
  *
5
- * Main entry point for the MCP server providing tools for voice agent development.
8
+ * @requires @modelcontextprotocol/sdk
9
+ * @requires axios
10
+ * @requires zod
11
+ *
12
+ * @example
13
+ * // Start the server (stdio transport)
14
+ * $ ELEVENLABS_API_KEY=your_key node dist/index.js
15
+ *
16
+ * @module index
6
17
  */
7
18
  export {};
8
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;GAIG"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG"}