Added call functionality for 11labs#101
Conversation
| "lint-staged": "^15.2.0", | ||
| "msw": "^2.10.4", | ||
| "tsdown": "^0.14.0", | ||
| "tsx": "^4.20.5", |
There was a problem hiding this comment.
Unused devDependency added: tsx is not referenced by any scripts or packages, adding unnecessary install weight and maintenance overhead.
Prompt for AI agents
Address the following comment on package.json at line 32:
<comment>Unused devDependency added: tsx is not referenced by any scripts or packages, adding unnecessary install weight and maintenance overhead.</comment>
<file context>
@@ -29,6 +29,7 @@
"lint-staged": "^15.2.0",
"msw": "^2.10.4",
"tsdown": "^0.14.0",
+ "tsx": "^4.20.5",
"turbo": "latest",
"typescript": "^5.9.0",
</file context>
| it("includes the additional context", async () => { | ||
| server.use( | ||
| http.post("https://api.elevenlabs.io/v1/convai/twilio/outbound-call", (req) => { | ||
| // Verify the request body includes additional_context |
There was a problem hiding this comment.
Test claims to verify inclusion of additional_context/message but never asserts the request body; add an assertion by reading req.json() and checking the field.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/elevenlabs.spec.ts at line 428:
<comment>Test claims to verify inclusion of additional_context/message but never asserts the request body; add an assertion by reading req.json() and checking the field.</comment>
<file context>
@@ -0,0 +1,654 @@
+ it("includes the additional context", async () => {
+ server.use(
+ http.post("https://api.elevenlabs.io/v1/convai/twilio/outbound-call", (req) => {
+ // Verify the request body includes additional_context
+ return HttpResponse.json({
+ success: true,
</file context>
| import { http, HttpResponse } from "msw"; | ||
| import { setupServer } from "msw/node"; | ||
|
|
||
| const server = setupServer(); |
There was a problem hiding this comment.
MSW server lifecycle is managed per-test without beforeAll/afterAll and no afterEach reset; handlers can accumulate and server may not close if a test fails, risking flaky tests.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/elevenlabs.spec.ts at line 8:
<comment>MSW server lifecycle is managed per-test without beforeAll/afterAll and no afterEach reset; handlers can accumulate and server may not close if a test fails, risking flaky tests.</comment>
<file context>
@@ -0,0 +1,654 @@
+import { http, HttpResponse } from "msw";
+import { setupServer } from "msw/node";
+
+const server = setupServer();
+
+describe("#ElevenLabsConnector", () => {
</file context>
| const dataStore = new Map<string, unknown>(); | ||
| const cacheStore = new Map<string, string>(); | ||
|
|
||
| return { |
There was a problem hiding this comment.
Error responses from tool handlers should include isError: true so clients can reliably detect failures.
Prompt for AI agents
Address the following comment on scripts/start-server.ts at line 41:
<comment>Error responses from tool handlers should include isError: true so clients can reliably detect failures.</comment>
<file context>
@@ -0,0 +1,364 @@
+ const dataStore = new Map<string, unknown>();
+ const cacheStore = new Map<string, string>();
+
+ return {
+ getCredentials: async () => credentials,
+ getSetup: async () => setup,
</file context>
| }); | ||
|
|
||
| for (const tool of Object.values(connectorConfig.tools)) { | ||
| server.tool(tool.name, tool.description, tool.schema.shape, async (args: unknown) => { |
There was a problem hiding this comment.
Accessing tool.schema.shape directly can be undefined for non-object Zod schemas; use a safe fallback to prevent runtime errors.
Prompt for AI agents
Address the following comment on scripts/start-server.ts at line 193:
<comment>Accessing tool.schema.shape directly can be undefined for non-object Zod schemas; use a safe fallback to prevent runtime errors.</comment>
<file context>
@@ -0,0 +1,364 @@
+ });
+
+ for (const tool of Object.values(connectorConfig.tools)) {
+ server.tool(tool.name, tool.description, tool.schema.shape, async (args: unknown) => {
+ const startTime = Date.now();
+ customLogger(`Tool invoked: ${tool.name}`, 'info');
</file context>
| country_code: phone.country_code || phone.country, | ||
| })), | ||
| count: phoneNumbers.length, | ||
| raw_response: result, |
There was a problem hiding this comment.
Do not include the raw API response in returned data; it can expose sensitive information. Remove this field or gate it behind a debug flag.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/elevenlabs.ts at line 703:
<comment>Do not include the raw API response in returned data; it can expose sensitive information. Remove this field or gate it behind a debug flag.</comment>
<file context>
@@ -505,5 +556,239 @@ export const ElevenLabsConnectorConfig = mcpConnectorConfig({
+ country_code: phone.country_code || phone.country,
+ })),
+ count: phoneNumbers.length,
+ raw_response: result,
+ message:
+ phoneNumbers.length > 0
</file context>
| raw_response: result, | |
| raw_response: undefined, |
| phoneNumbers = result; | ||
| } else { | ||
| // Log the actual response structure for debugging | ||
| console.log('Unexpected API response structure:', JSON.stringify(result, null, 2)); |
There was a problem hiding this comment.
Avoid logging full API responses; this may leak phone numbers or other sensitive data. Log a minimal message without payload or remove the log.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/elevenlabs.ts at line 689:
<comment>Avoid logging full API responses; this may leak phone numbers or other sensitive data. Log a minimal message without payload or remove the log.</comment>
<file context>
@@ -505,5 +556,239 @@ export const ElevenLabsConnectorConfig = mcpConnectorConfig({
+ phoneNumbers = result;
+ } else {
+ // Log the actual response structure for debugging
+ console.log('Unexpected API response structure:', JSON.stringify(result, null, 2));
+ }
+
</file context>
| console.log('Unexpected API response structure:', JSON.stringify(result, null, 2)); | |
| console.warn('Unexpected API response structure'); |
CLAUDE.md
Outdated
|
|
||
| # With credentials for production connectors | ||
| bun start --connector asana --credentials '{"apiKey":"your-api-key"}' | ||
| bun start --connector github --credentials '{"token":"ghp_xxx"}' --setup '{"org":"myorg"}' |
There was a problem hiding this comment.
CLI example doesn’t forward arguments past Turbo; use "--" so connector flags reach the server process.
Prompt for AI agents
Address the following comment on CLAUDE.md at line 23:
<comment>CLI example doesn’t forward arguments past Turbo; use "--" so connector flags reach the server process.</comment>
<file context>
@@ -0,0 +1,90 @@
+
+# With credentials for production connectors
+bun start --connector asana --credentials '{"apiKey":"your-api-key"}'
+bun start --connector github --credentials '{"token":"ghp_xxx"}' --setup '{"org":"myorg"}'
+```
+
</file context>
| bun start --connector github --credentials '{"token":"ghp_xxx"}' --setup '{"org":"myorg"}' | |
| bun run start -- --connector github --credentials '{"token":"ghp_xxx"}' --setup '{"org":"myorg"}' |
CLAUDE.md
Outdated
| bun start --connector test | ||
|
|
||
| # With credentials for production connectors | ||
| bun start --connector asana --credentials '{"apiKey":"your-api-key"}' |
There was a problem hiding this comment.
CLI example doesn’t forward arguments past Turbo; use "--" so connector flags reach the server process.
Prompt for AI agents
Address the following comment on CLAUDE.md at line 22:
<comment>CLI example doesn’t forward arguments past Turbo; use "--" so connector flags reach the server process.</comment>
<file context>
@@ -0,0 +1,90 @@
+bun start --connector test
+
+# With credentials for production connectors
+bun start --connector asana --credentials '{"apiKey":"your-api-key"}'
+bun start --connector github --credentials '{"token":"ghp_xxx"}' --setup '{"org":"myorg"}'
+```
</file context>
| bun start --connector asana --credentials '{"apiKey":"your-api-key"}' | |
| bun run start -- --connector asana --credentials '{"apiKey":"your-api-key"}' |
CLAUDE.md
Outdated
| ### Start a connector server for testing | ||
| ```bash | ||
| # No credentials needed (test connector) | ||
| bun start --connector test |
There was a problem hiding this comment.
CLI example doesn’t forward arguments past Turbo; use "--" so connector flags reach the server process.
Prompt for AI agents
Address the following comment on CLAUDE.md at line 19:
<comment>CLI example doesn’t forward arguments past Turbo; use "--" so connector flags reach the server process.</comment>
<file context>
@@ -0,0 +1,90 @@
+### Start a connector server for testing
+```bash
+# No credentials needed (test connector)
+bun start --connector test
+
+# With credentials for production connectors
</file context>
| bun start --connector test | |
| bun run start -- --connector test |
|
should be all ready :) |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude review PR & make relevant updates based on best practices of creating connectors per .md guidelines |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Ever been stuck in hyper-focused coding in Cursor or ClaudeCode or your agent of choice? And been like: "Oh fuck! I'm supposed to be at the pub in five minutes but I've got to finish this! And you don't wanna break the flow and call your friends? Well now we have the solution!
Get elevenlabs to call them up for you and tell them all the things that would keep them occupied on the phone for the half an hour you're gonna be gone. Use your own voice clone, and it's even better. What could possibly go wrong?
Summary by cubic
Adds outbound call support to the ElevenLabs connector with tools to create agents, list phone numbers, and place calls. Also adds a local MCP dev server and test coverage for new and existing ElevenLabs features.
New Features
Dependencies