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.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +533 -0
  3. package/dist/constants.d.ts +25 -0
  4. package/dist/constants.d.ts.map +1 -0
  5. package/dist/constants.js +51 -0
  6. package/dist/constants.js.map +1 -0
  7. package/dist/index.d.ts +8 -0
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +93 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/schemas/agent-schemas.d.ts +147 -0
  12. package/dist/schemas/agent-schemas.d.ts.map +1 -0
  13. package/dist/schemas/agent-schemas.js +145 -0
  14. package/dist/schemas/agent-schemas.js.map +1 -0
  15. package/dist/schemas/batch-calling-schemas.d.ts +170 -0
  16. package/dist/schemas/batch-calling-schemas.d.ts.map +1 -0
  17. package/dist/schemas/batch-calling-schemas.js +77 -0
  18. package/dist/schemas/batch-calling-schemas.js.map +1 -0
  19. package/dist/schemas/common-schemas.d.ts +54 -0
  20. package/dist/schemas/common-schemas.d.ts.map +1 -0
  21. package/dist/schemas/common-schemas.js +72 -0
  22. package/dist/schemas/common-schemas.js.map +1 -0
  23. package/dist/schemas/conversation-schemas.d.ts +72 -0
  24. package/dist/schemas/conversation-schemas.d.ts.map +1 -0
  25. package/dist/schemas/conversation-schemas.js +30 -0
  26. package/dist/schemas/conversation-schemas.js.map +1 -0
  27. package/dist/schemas/outbound-schemas.d.ts +115 -0
  28. package/dist/schemas/outbound-schemas.d.ts.map +1 -0
  29. package/dist/schemas/outbound-schemas.js +61 -0
  30. package/dist/schemas/outbound-schemas.js.map +1 -0
  31. package/dist/schemas/phone-number-schemas.d.ts +168 -0
  32. package/dist/schemas/phone-number-schemas.d.ts.map +1 -0
  33. package/dist/schemas/phone-number-schemas.js +116 -0
  34. package/dist/schemas/phone-number-schemas.js.map +1 -0
  35. package/dist/schemas/tool-schemas.d.ts +208 -0
  36. package/dist/schemas/tool-schemas.d.ts.map +1 -0
  37. package/dist/schemas/tool-schemas.js +131 -0
  38. package/dist/schemas/tool-schemas.js.map +1 -0
  39. package/dist/services/elevenlabs-api.d.ts +37 -0
  40. package/dist/services/elevenlabs-api.d.ts.map +1 -0
  41. package/dist/services/elevenlabs-api.js +78 -0
  42. package/dist/services/elevenlabs-api.js.map +1 -0
  43. package/dist/services/formatters.d.ts +76 -0
  44. package/dist/services/formatters.d.ts.map +1 -0
  45. package/dist/services/formatters.js +475 -0
  46. package/dist/services/formatters.js.map +1 -0
  47. package/dist/tools/agent-tools.d.ts +228 -0
  48. package/dist/tools/agent-tools.d.ts.map +1 -0
  49. package/dist/tools/agent-tools.js +369 -0
  50. package/dist/tools/agent-tools.js.map +1 -0
  51. package/dist/tools/batch-calling-tools.d.ts +183 -0
  52. package/dist/tools/batch-calling-tools.d.ts.map +1 -0
  53. package/dist/tools/batch-calling-tools.js +203 -0
  54. package/dist/tools/batch-calling-tools.js.map +1 -0
  55. package/dist/tools/conversation-tools.d.ts +103 -0
  56. package/dist/tools/conversation-tools.d.ts.map +1 -0
  57. package/dist/tools/conversation-tools.js +140 -0
  58. package/dist/tools/conversation-tools.js.map +1 -0
  59. package/dist/tools/knowledge-tools.d.ts +75 -0
  60. package/dist/tools/knowledge-tools.d.ts.map +1 -0
  61. package/dist/tools/knowledge-tools.js +63 -0
  62. package/dist/tools/knowledge-tools.js.map +1 -0
  63. package/dist/tools/outbound-tools.d.ts +44 -0
  64. package/dist/tools/outbound-tools.d.ts.map +1 -0
  65. package/dist/tools/outbound-tools.js +84 -0
  66. package/dist/tools/outbound-tools.js.map +1 -0
  67. package/dist/tools/phone-number-tools.d.ts +215 -0
  68. package/dist/tools/phone-number-tools.d.ts.map +1 -0
  69. package/dist/tools/phone-number-tools.js +295 -0
  70. package/dist/tools/phone-number-tools.js.map +1 -0
  71. package/dist/tools/tool-tools.d.ts +165 -0
  72. package/dist/tools/tool-tools.d.ts.map +1 -0
  73. package/dist/tools/tool-tools.js +166 -0
  74. package/dist/tools/tool-tools.js.map +1 -0
  75. package/dist/tools/utility-tools.d.ts +76 -0
  76. package/dist/tools/utility-tools.d.ts.map +1 -0
  77. package/dist/tools/utility-tools.js +121 -0
  78. package/dist/tools/utility-tools.js.map +1 -0
  79. package/dist/types.d.ts +282 -0
  80. package/dist/types.d.ts.map +1 -0
  81. package/dist/types.js +12 -0
  82. package/dist/types.js.map +1 -0
  83. package/dist/utils/error-handlers.d.ts +29 -0
  84. package/dist/utils/error-handlers.d.ts.map +1 -0
  85. package/dist/utils/error-handlers.js +90 -0
  86. package/dist/utils/error-handlers.js.map +1 -0
  87. package/dist/utils/truncation.d.ts +41 -0
  88. package/dist/utils/truncation.d.ts.map +1 -0
  89. package/dist/utils/truncation.js +78 -0
  90. package/dist/utils/truncation.js.map +1 -0
  91. package/package.json +61 -0
@@ -0,0 +1,183 @@
1
+ /**
2
+ * Batch calling tools
3
+ *
4
+ * MCP tools for submitting batch call jobs, listing batches, and retrieving batch details.
5
+ */
6
+ /**
7
+ * Submits a batch calling job
8
+ */
9
+ export declare const elevenlabs_submit_batch_call: {
10
+ name: string;
11
+ description: string;
12
+ zodSchema: import("zod").ZodObject<{
13
+ call_name: import("zod").ZodString;
14
+ agent_id: import("zod").ZodString;
15
+ recipients: import("zod").ZodArray<import("zod").ZodEffects<import("zod").ZodObject<{
16
+ id: import("zod").ZodOptional<import("zod").ZodString>;
17
+ phone_number: import("zod").ZodOptional<import("zod").ZodString>;
18
+ whatsapp_user_id: import("zod").ZodOptional<import("zod").ZodString>;
19
+ conversation_initiation_client_data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
20
+ }, "strip", import("zod").ZodTypeAny, {
21
+ phone_number?: string | undefined;
22
+ conversation_initiation_client_data?: Record<string, any> | undefined;
23
+ id?: string | undefined;
24
+ whatsapp_user_id?: string | undefined;
25
+ }, {
26
+ phone_number?: string | undefined;
27
+ conversation_initiation_client_data?: Record<string, any> | undefined;
28
+ id?: string | undefined;
29
+ whatsapp_user_id?: string | undefined;
30
+ }>, {
31
+ phone_number?: string | undefined;
32
+ conversation_initiation_client_data?: Record<string, any> | undefined;
33
+ id?: string | undefined;
34
+ whatsapp_user_id?: string | undefined;
35
+ }, {
36
+ phone_number?: string | undefined;
37
+ conversation_initiation_client_data?: Record<string, any> | undefined;
38
+ id?: string | undefined;
39
+ whatsapp_user_id?: string | undefined;
40
+ }>, "many">;
41
+ scheduled_time_unix: import("zod").ZodOptional<import("zod").ZodNumber>;
42
+ agent_phone_number_id: import("zod").ZodOptional<import("zod").ZodString>;
43
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
44
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
45
+ call_name: import("zod").ZodString;
46
+ agent_id: import("zod").ZodString;
47
+ recipients: import("zod").ZodArray<import("zod").ZodEffects<import("zod").ZodObject<{
48
+ id: import("zod").ZodOptional<import("zod").ZodString>;
49
+ phone_number: import("zod").ZodOptional<import("zod").ZodString>;
50
+ whatsapp_user_id: import("zod").ZodOptional<import("zod").ZodString>;
51
+ conversation_initiation_client_data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
52
+ }, "strip", import("zod").ZodTypeAny, {
53
+ phone_number?: string | undefined;
54
+ conversation_initiation_client_data?: Record<string, any> | undefined;
55
+ id?: string | undefined;
56
+ whatsapp_user_id?: string | undefined;
57
+ }, {
58
+ phone_number?: string | undefined;
59
+ conversation_initiation_client_data?: Record<string, any> | undefined;
60
+ id?: string | undefined;
61
+ whatsapp_user_id?: string | undefined;
62
+ }>, {
63
+ phone_number?: string | undefined;
64
+ conversation_initiation_client_data?: Record<string, any> | undefined;
65
+ id?: string | undefined;
66
+ whatsapp_user_id?: string | undefined;
67
+ }, {
68
+ phone_number?: string | undefined;
69
+ conversation_initiation_client_data?: Record<string, any> | undefined;
70
+ id?: string | undefined;
71
+ whatsapp_user_id?: string | undefined;
72
+ }>, "many">;
73
+ scheduled_time_unix: import("zod").ZodOptional<import("zod").ZodNumber>;
74
+ agent_phone_number_id: import("zod").ZodOptional<import("zod").ZodString>;
75
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
76
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
77
+ call_name: import("zod").ZodString;
78
+ agent_id: import("zod").ZodString;
79
+ recipients: import("zod").ZodArray<import("zod").ZodEffects<import("zod").ZodObject<{
80
+ id: import("zod").ZodOptional<import("zod").ZodString>;
81
+ phone_number: import("zod").ZodOptional<import("zod").ZodString>;
82
+ whatsapp_user_id: import("zod").ZodOptional<import("zod").ZodString>;
83
+ conversation_initiation_client_data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
84
+ }, "strip", import("zod").ZodTypeAny, {
85
+ phone_number?: string | undefined;
86
+ conversation_initiation_client_data?: Record<string, any> | undefined;
87
+ id?: string | undefined;
88
+ whatsapp_user_id?: string | undefined;
89
+ }, {
90
+ phone_number?: string | undefined;
91
+ conversation_initiation_client_data?: Record<string, any> | undefined;
92
+ id?: string | undefined;
93
+ whatsapp_user_id?: string | undefined;
94
+ }>, {
95
+ phone_number?: string | undefined;
96
+ conversation_initiation_client_data?: Record<string, any> | undefined;
97
+ id?: string | undefined;
98
+ whatsapp_user_id?: string | undefined;
99
+ }, {
100
+ phone_number?: string | undefined;
101
+ conversation_initiation_client_data?: Record<string, any> | undefined;
102
+ id?: string | undefined;
103
+ whatsapp_user_id?: string | undefined;
104
+ }>, "many">;
105
+ scheduled_time_unix: import("zod").ZodOptional<import("zod").ZodNumber>;
106
+ agent_phone_number_id: import("zod").ZodOptional<import("zod").ZodString>;
107
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
108
+ }, import("zod").ZodTypeAny, "passthrough">>;
109
+ annotations: {
110
+ readOnlyHint: boolean;
111
+ destructiveHint: boolean;
112
+ idempotentHint: boolean;
113
+ openWorldHint: boolean;
114
+ };
115
+ handler: (args: unknown) => Promise<{
116
+ content: {
117
+ type: string;
118
+ text: string;
119
+ }[];
120
+ }>;
121
+ };
122
+ /**
123
+ * Lists all batch calling jobs in workspace
124
+ */
125
+ export declare const elevenlabs_list_batch_calls: {
126
+ name: string;
127
+ description: string;
128
+ zodSchema: import("zod").ZodObject<{
129
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
130
+ last_doc: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
131
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
132
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
133
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
134
+ last_doc: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
135
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
136
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
137
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
138
+ last_doc: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodString>>;
139
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
140
+ }, import("zod").ZodTypeAny, "passthrough">>;
141
+ annotations: {
142
+ readOnlyHint: boolean;
143
+ destructiveHint: boolean;
144
+ idempotentHint: boolean;
145
+ openWorldHint: boolean;
146
+ };
147
+ handler: (args: unknown) => Promise<{
148
+ content: {
149
+ type: string;
150
+ text: string;
151
+ }[];
152
+ }>;
153
+ };
154
+ /**
155
+ * Gets detailed information about a specific batch call
156
+ */
157
+ export declare const elevenlabs_get_batch_call: {
158
+ name: string;
159
+ description: string;
160
+ zodSchema: import("zod").ZodObject<{
161
+ batch_id: import("zod").ZodString;
162
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
163
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
164
+ batch_id: import("zod").ZodString;
165
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
166
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
167
+ batch_id: import("zod").ZodString;
168
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
169
+ }, import("zod").ZodTypeAny, "passthrough">>;
170
+ annotations: {
171
+ readOnlyHint: boolean;
172
+ destructiveHint: boolean;
173
+ idempotentHint: boolean;
174
+ openWorldHint: boolean;
175
+ };
176
+ handler: (args: unknown) => Promise<{
177
+ content: {
178
+ type: string;
179
+ text: string;
180
+ }[];
181
+ }>;
182
+ };
183
+ //# sourceMappingURL=batch-calling-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-calling-tools.d.ts","sourceRoot":"","sources":["../../src/tools/batch-calling-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAuDjB,OAAO;;;;;;CA6B9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;oBAuChB,OAAO;;;;;;CAyB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;oBA4Cd,OAAO;;;;;;CAgB9B,CAAC"}
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Batch calling tools
3
+ *
4
+ * MCP tools for submitting batch call jobs, listing batches, and retrieving batch details.
5
+ */
6
+ import { getRequest, postRequest } from "../services/elevenlabs-api.js";
7
+ import { formatResponse } from "../services/formatters.js";
8
+ import { SubmitBatchCallSchema, ListBatchCallsSchema, GetBatchCallSchema } from "../schemas/batch-calling-schemas.js";
9
+ /**
10
+ * Submits a batch calling job
11
+ */
12
+ export const elevenlabs_submit_batch_call = {
13
+ name: "elevenlabs_submit_batch_call",
14
+ description: `Submit a batch calling job to initiate multiple outbound calls simultaneously.
15
+
16
+ This tool allows you to call multiple phone numbers in parallel using your voice agent. Upload a list of recipients with optional personalization data for each call. Batch calling is ideal for surveys, alerts, reminders, appointment confirmations, and mass outreach.
17
+
18
+ Prerequisites:
19
+ - A Twilio phone number must be imported and associated with an agent
20
+ - Zero Retention Mode (ZRM) must be disabled
21
+ - Minimum 50% workspace concurrency or 70% agent concurrency available
22
+
23
+ Args:
24
+ - call_name (string): Descriptive name for this batch (e.g., "Q4 Customer Survey")
25
+ - agent_id (string): Agent to use for all calls (e.g., 'ag_abc123')
26
+ - recipients (array): Array of recipient objects, each containing:
27
+ - phone_number (string): Phone in E.164 format (e.g., '+1234567890')
28
+ - OR whatsapp_user_id (string): WhatsApp user ID (alternative)
29
+ - id (string, optional): Custom tracking ID for this recipient
30
+ - conversation_initiation_client_data (object, optional): Personalization data
31
+ - dynamic_variables (object): Dynamic variables for personalization
32
+ Example: {dynamic_variables: {name: 'John', appointment_time: '3pm'}}
33
+ - conversation_config_override (object): Override agent settings for this call
34
+ - Special fields: language, first_message, prompt.prompt, voice_id
35
+ - scheduled_time_unix (number, optional): Unix timestamp to schedule for future
36
+ - agent_phone_number_id (string, optional): Phone number ID to use as caller ID
37
+ - response_format ('markdown' | 'json'): Output format
38
+
39
+ Returns:
40
+ Batch job details including ID, status, scheduling info, and call counts.
41
+
42
+ Limits:
43
+ - Minimum: 1 recipient
44
+ - Maximum: 10,000 recipients per batch
45
+
46
+ Examples:
47
+ - Use when: "Call 500 customers with appointment reminders"
48
+ - Use when: "Send survey to all users with personalized greetings"
49
+ - Use when: "Dispatch agent to call lead list from CSV"
50
+ - Don't use when: Making a single call (use elevenlabs_start_outbound_call)
51
+ - Don't use when: Phone number isn't assigned to agent yet
52
+
53
+ Error Handling:
54
+ - Returns "Error: Invalid recipient count" if outside 1-10,000 range
55
+ - Returns "Error: Phone number not assigned" if agent lacks phone number
56
+ - Returns "Error: ZRM enabled" if Zero Retention Mode is active`,
57
+ zodSchema: SubmitBatchCallSchema,
58
+ annotations: {
59
+ readOnlyHint: false,
60
+ destructiveHint: false,
61
+ idempotentHint: false,
62
+ openWorldHint: true
63
+ },
64
+ handler: async (args) => {
65
+ const parsed = SubmitBatchCallSchema.parse(args);
66
+ const requestData = {
67
+ call_name: parsed.call_name,
68
+ agent_id: parsed.agent_id,
69
+ recipients: parsed.recipients,
70
+ ...(parsed.scheduled_time_unix !== undefined && {
71
+ scheduled_time_unix: parsed.scheduled_time_unix
72
+ }),
73
+ ...(parsed.agent_phone_number_id && {
74
+ agent_phone_number_id: parsed.agent_phone_number_id
75
+ })
76
+ };
77
+ const response = await postRequest("/convai/batch-calling/submit", requestData);
78
+ return {
79
+ content: [
80
+ {
81
+ type: "text",
82
+ text: formatResponse(response, parsed.response_format, "batch_call")
83
+ }
84
+ ]
85
+ };
86
+ }
87
+ };
88
+ /**
89
+ * Lists all batch calling jobs in workspace
90
+ */
91
+ export const elevenlabs_list_batch_calls = {
92
+ name: "elevenlabs_list_batch_calls",
93
+ description: `List all batch calling jobs in your workspace with pagination.
94
+
95
+ This tool retrieves all batch call jobs you've submitted, showing their status, scheduling, and progress. Use cursor-based pagination to navigate through large lists.
96
+
97
+ Args:
98
+ - limit (number): Maximum items to return (1-100, default: 20)
99
+ - last_doc (string, optional): Pagination cursor from previous response
100
+ - response_format ('markdown' | 'json'): Output format
101
+
102
+ Returns:
103
+ - batch_calls: Array of batch job objects with status and metrics
104
+ - next_doc: Cursor for next page (null if no more pages)
105
+ - has_more: Whether more batches exist
106
+
107
+ Pagination:
108
+ - First page: Don't include last_doc parameter
109
+ - Next pages: Use next_doc value from previous response as last_doc
110
+
111
+ Examples:
112
+ - Use when: "Show me all my batch calling jobs"
113
+ - Use when: "List recent batch calls"
114
+ - Use when: "Get next page of batches with cursor xyz123"
115
+ - Don't use when: You want details about a specific batch (use elevenlabs_get_batch_call)
116
+
117
+ Error Handling:
118
+ - Returns empty list if no batches exist
119
+ - Returns "Error: Invalid API key" if authentication fails`,
120
+ zodSchema: ListBatchCallsSchema,
121
+ annotations: {
122
+ readOnlyHint: true,
123
+ destructiveHint: false,
124
+ idempotentHint: true,
125
+ openWorldHint: true
126
+ },
127
+ handler: async (args) => {
128
+ const parsed = ListBatchCallsSchema.parse(args);
129
+ const params = {
130
+ limit: parsed.limit
131
+ };
132
+ if (parsed.last_doc) {
133
+ params.last_doc = parsed.last_doc;
134
+ }
135
+ const response = await getRequest("/convai/batch-calling/workspace", params);
136
+ return {
137
+ content: [
138
+ {
139
+ type: "text",
140
+ text: formatResponse(response, parsed.response_format, "batch_call_list")
141
+ }
142
+ ]
143
+ };
144
+ }
145
+ };
146
+ /**
147
+ * Gets detailed information about a specific batch call
148
+ */
149
+ export const elevenlabs_get_batch_call = {
150
+ name: "elevenlabs_get_batch_call",
151
+ description: `Get detailed information about a specific batch calling job including all recipient statuses.
152
+
153
+ This tool retrieves complete details for a batch call job, including the status of each individual recipient. Use this to monitor batch progress, identify failed calls, detect voicemails, and track which recipients have been successfully contacted.
154
+
155
+ Args:
156
+ - batch_id (string): Unique batch job identifier (e.g., 'batch_abc123')
157
+ - response_format ('markdown' | 'json'): Output format
158
+
159
+ Returns:
160
+ Complete batch details including:
161
+ - Batch metadata (name, agent, status, timing)
162
+ - Call metrics (dispatched, scheduled counts)
163
+ - Recipients array with individual statuses:
164
+ - pending: Not yet called
165
+ - initiated: Call started
166
+ - in_progress: Currently in conversation
167
+ - completed: Call finished successfully
168
+ - failed: Call failed
169
+ - cancelled: Call was cancelled
170
+ - voicemail: Went to voicemail
171
+ - Each recipient includes conversation_id for transcript lookup
172
+
173
+ Examples:
174
+ - Use when: "Check status of batch job batch_abc123"
175
+ - Use when: "Show me which recipients answered in the sales batch"
176
+ - Use when: "Get details on appointment reminder batch"
177
+ - Use when: "Find failed calls in batch xyz789"
178
+ - Don't use when: You want to list all batches (use elevenlabs_list_batch_calls)
179
+
180
+ Error Handling:
181
+ - Returns "Error: Batch not found" if batch_id doesn't exist
182
+ - Returns "Error: Invalid API key" if authentication fails`,
183
+ zodSchema: GetBatchCallSchema,
184
+ annotations: {
185
+ readOnlyHint: true,
186
+ destructiveHint: false,
187
+ idempotentHint: true,
188
+ openWorldHint: true
189
+ },
190
+ handler: async (args) => {
191
+ const parsed = GetBatchCallSchema.parse(args);
192
+ const response = await getRequest(`/convai/batch-calling/${parsed.batch_id}`);
193
+ return {
194
+ content: [
195
+ {
196
+ type: "text",
197
+ text: formatResponse(response, parsed.response_format, "batch_call_detail")
198
+ }
199
+ ]
200
+ };
201
+ }
202
+ };
203
+ //# sourceMappingURL=batch-calling-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batch-calling-tools.js","sourceRoot":"","sources":["../../src/tools/batch-calling-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,qCAAqC,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kEA0CmD;IAEhE,SAAS,EAAE,qBAAqB;IAEhC,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,IAAI;KAC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,CAAC,QAAQ,EAAE,CAAC;YACpB,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QACpC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,UAAU,CAC/B,iCAAiC,EACjC,MAAM,CACP,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC;iBAC1E;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6DA+B8C;IAE3D,SAAS,EAAE,kBAAkB;IAE7B,WAAW,EAAE;QACX,YAAY,EAAE,IAAI;QAClB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,IAAI;KACpB;IAED,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,EAAE;QAC/B,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAE9C,MAAM,QAAQ,GAAG,MAAM,UAAU,CAC/B,yBAAyB,MAAM,CAAC,QAAQ,EAAE,CAC3C,CAAC;QAEF,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC;iBAC5E;aACF;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Conversation retrieval tools
3
+ *
4
+ * MCP tools for accessing conversation histories, transcripts, and analytics.
5
+ */
6
+ /**
7
+ * Retrieves a single conversation with full transcript
8
+ */
9
+ export declare const elevenlabs_get_conversation: {
10
+ name: string;
11
+ description: string;
12
+ zodSchema: import("zod").ZodObject<{
13
+ conversation_id: import("zod").ZodString;
14
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
15
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
16
+ conversation_id: import("zod").ZodString;
17
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
18
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
19
+ conversation_id: import("zod").ZodString;
20
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
21
+ }, import("zod").ZodTypeAny, "passthrough">>;
22
+ annotations: {
23
+ readOnlyHint: boolean;
24
+ destructiveHint: boolean;
25
+ idempotentHint: boolean;
26
+ openWorldHint: boolean;
27
+ };
28
+ handler: (args: unknown) => Promise<{
29
+ content: {
30
+ type: string;
31
+ text: string;
32
+ }[];
33
+ }>;
34
+ };
35
+ /**
36
+ * Lists conversations with filtering and pagination
37
+ */
38
+ export declare const elevenlabs_list_conversations: {
39
+ name: string;
40
+ description: string;
41
+ zodSchema: import("zod").ZodObject<{
42
+ agent_id: import("zod").ZodOptional<import("zod").ZodString>;
43
+ status: import("zod").ZodOptional<import("zod").ZodEnum<["in_progress", "completed", "failed"]>>;
44
+ date_range: import("zod").ZodOptional<import("zod").ZodObject<{
45
+ start: import("zod").ZodOptional<import("zod").ZodString>;
46
+ end: import("zod").ZodOptional<import("zod").ZodString>;
47
+ }, "strip", import("zod").ZodTypeAny, {
48
+ start?: string | undefined;
49
+ end?: string | undefined;
50
+ }, {
51
+ start?: string | undefined;
52
+ end?: string | undefined;
53
+ }>>;
54
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
55
+ offset: import("zod").ZodDefault<import("zod").ZodNumber>;
56
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
57
+ }, "passthrough", import("zod").ZodTypeAny, import("zod").objectOutputType<{
58
+ agent_id: import("zod").ZodOptional<import("zod").ZodString>;
59
+ status: import("zod").ZodOptional<import("zod").ZodEnum<["in_progress", "completed", "failed"]>>;
60
+ date_range: import("zod").ZodOptional<import("zod").ZodObject<{
61
+ start: import("zod").ZodOptional<import("zod").ZodString>;
62
+ end: import("zod").ZodOptional<import("zod").ZodString>;
63
+ }, "strip", import("zod").ZodTypeAny, {
64
+ start?: string | undefined;
65
+ end?: string | undefined;
66
+ }, {
67
+ start?: string | undefined;
68
+ end?: string | undefined;
69
+ }>>;
70
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
71
+ offset: import("zod").ZodDefault<import("zod").ZodNumber>;
72
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
73
+ }, import("zod").ZodTypeAny, "passthrough">, import("zod").objectInputType<{
74
+ agent_id: import("zod").ZodOptional<import("zod").ZodString>;
75
+ status: import("zod").ZodOptional<import("zod").ZodEnum<["in_progress", "completed", "failed"]>>;
76
+ date_range: import("zod").ZodOptional<import("zod").ZodObject<{
77
+ start: import("zod").ZodOptional<import("zod").ZodString>;
78
+ end: import("zod").ZodOptional<import("zod").ZodString>;
79
+ }, "strip", import("zod").ZodTypeAny, {
80
+ start?: string | undefined;
81
+ end?: string | undefined;
82
+ }, {
83
+ start?: string | undefined;
84
+ end?: string | undefined;
85
+ }>>;
86
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
87
+ offset: import("zod").ZodDefault<import("zod").ZodNumber>;
88
+ response_format: import("zod").ZodDefault<import("zod").ZodNativeEnum<typeof import("../types.js").ResponseFormat>>;
89
+ }, import("zod").ZodTypeAny, "passthrough">>;
90
+ annotations: {
91
+ readOnlyHint: boolean;
92
+ destructiveHint: boolean;
93
+ idempotentHint: boolean;
94
+ openWorldHint: boolean;
95
+ };
96
+ handler: (args: unknown) => Promise<{
97
+ content: {
98
+ type: string;
99
+ text: string;
100
+ }[];
101
+ }>;
102
+ };
103
+ //# sourceMappingURL=conversation-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-tools.d.ts","sourceRoot":"","sources":["../../src/tools/conversation-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;oBAoChB,OAAO;;;;;;CAgB9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAwClB,OAAO;;;;;;CAoD9B,CAAC"}
@@ -0,0 +1,140 @@
1
+ /**
2
+ * Conversation retrieval tools
3
+ *
4
+ * MCP tools for accessing conversation histories, transcripts, and analytics.
5
+ */
6
+ import { getRequest } from "../services/elevenlabs-api.js";
7
+ import { formatResponse } from "../services/formatters.js";
8
+ import { GetConversationSchema, ListConversationsSchema } from "../schemas/conversation-schemas.js";
9
+ /**
10
+ * Retrieves a single conversation with full transcript
11
+ */
12
+ export const elevenlabs_get_conversation = {
13
+ name: "elevenlabs_get_conversation",
14
+ description: `Retrieve complete details and transcript for a specific conversation.
15
+
16
+ This tool fetches full conversation details including the complete transcript, tool calls made, analysis metrics, and metadata. Use this to review past conversations, debug issues, or analyze agent performance.
17
+
18
+ Args:
19
+ - conversation_id (string): Unique conversation identifier
20
+ - response_format ('markdown' | 'json'): Output format
21
+
22
+ Returns:
23
+ Complete conversation object with:
24
+ - Conversation metadata (status, timestamps, duration)
25
+ - Full transcript with user and agent messages
26
+ - Tool calls made during the conversation
27
+ - Analysis data (sentiment, performance, key topics)
28
+
29
+ Examples:
30
+ - Use when: "Show me the transcript for conversation conv_xyz789"
31
+ - Use when: "What did the agent say in this conversation?"
32
+ - Use when: "Review the conversation that failed"
33
+ - Don't use when: You want to list multiple conversations (use elevenlabs_list_conversations)
34
+
35
+ Error Handling:
36
+ - Returns "Error: Conversation not found" if conversation_id doesn't exist
37
+ - Returns "Error: Invalid API key" if authentication fails`,
38
+ zodSchema: GetConversationSchema,
39
+ annotations: {
40
+ readOnlyHint: true,
41
+ destructiveHint: false,
42
+ idempotentHint: true,
43
+ openWorldHint: true
44
+ },
45
+ handler: async (args) => {
46
+ const parsed = GetConversationSchema.parse(args);
47
+ const conversation = await getRequest(`/convai/conversations/${parsed.conversation_id}`);
48
+ return {
49
+ content: [
50
+ {
51
+ type: "text",
52
+ text: formatResponse(conversation, parsed.response_format, "conversation")
53
+ }
54
+ ]
55
+ };
56
+ }
57
+ };
58
+ /**
59
+ * Lists conversations with filtering and pagination
60
+ */
61
+ export const elevenlabs_list_conversations = {
62
+ name: "elevenlabs_list_conversations",
63
+ description: `List conversations with optional filtering by agent, status, and date range.
64
+
65
+ This tool retrieves a paginated list of conversations. You can filter by agent ID, conversation status, or date range to find specific conversations. Use this for monitoring, analytics, or reviewing agent interactions.
66
+
67
+ Args:
68
+ - agent_id (string): Optional - filter by specific agent
69
+ - status ('in_progress' | 'completed' | 'failed'): Optional - filter by status
70
+ - date_range (object): Optional - filter by date range with:
71
+ - start (string): Start date in ISO 8601 format
72
+ - end (string): End date in ISO 8601 format
73
+ - limit (number): Maximum conversations to return (1-100, default: 20)
74
+ - offset (number): Number to skip for pagination (default: 0)
75
+ - response_format ('markdown' | 'json'): Output format
76
+
77
+ Returns:
78
+ For JSON format: Object with total count, items array, offset, has_more, and next_offset
79
+ For Markdown format: Formatted list of conversations with key details and pagination guidance
80
+
81
+ Examples:
82
+ - Use when: "Show me all conversations from yesterday"
83
+ - Use when: "List failed conversations for agent ag_abc123"
84
+ - Use when: "Get the last 50 conversations"
85
+ - Use when: "Show conversations that are still in progress"
86
+ - Don't use when: You want full transcript (use elevenlabs_get_conversation)
87
+
88
+ Error Handling:
89
+ - Returns empty list if no conversations match filters
90
+ - Returns "Error: Invalid date format" if date_range is malformed`,
91
+ zodSchema: ListConversationsSchema,
92
+ annotations: {
93
+ readOnlyHint: true,
94
+ destructiveHint: false,
95
+ idempotentHint: true,
96
+ openWorldHint: true
97
+ },
98
+ handler: async (args) => {
99
+ const parsed = ListConversationsSchema.parse(args);
100
+ const params = {
101
+ limit: parsed.limit,
102
+ offset: parsed.offset
103
+ };
104
+ if (parsed.agent_id) {
105
+ params.agent_id = parsed.agent_id;
106
+ }
107
+ if (parsed.status) {
108
+ params.status = parsed.status;
109
+ }
110
+ if (parsed.date_range) {
111
+ if (parsed.date_range.start) {
112
+ params.start_date = parsed.date_range.start;
113
+ }
114
+ if (parsed.date_range.end) {
115
+ params.end_date = parsed.date_range.end;
116
+ }
117
+ }
118
+ const response = await getRequest("/convai/conversations", params);
119
+ const conversations = response.conversations || [];
120
+ const total = conversations.length;
121
+ const hasMore = conversations.length === parsed.limit;
122
+ const paginatedResponse = {
123
+ total,
124
+ count: conversations.length,
125
+ offset: parsed.offset,
126
+ items: conversations,
127
+ has_more: hasMore,
128
+ next_offset: hasMore ? parsed.offset + conversations.length : undefined
129
+ };
130
+ return {
131
+ content: [
132
+ {
133
+ type: "text",
134
+ text: formatResponse(paginatedResponse, parsed.response_format, "conversation_list")
135
+ }
136
+ ]
137
+ };
138
+ }
139
+ };
140
+ //# sourceMappingURL=conversation-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-tools.js","sourceRoot":"","sources":["../../src/tools/conversation-tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,oCAAoC,CAAC;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;6DAuB8C;IAE3D,SAAS,EAAE,qBAAqB;IAEhC,WAAW,EAAE;QACX,YAAY,EA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