-
Notifications
You must be signed in to change notification settings - Fork 28
Unipile Connector #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Unipile Connector #102
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
14 issues found across 10 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.
|
|
||
| ```typescript | ||
| { | ||
| account_id: string, // Account ID for messages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter description should specify source ID to match the connector API.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/UNIPILE_README.md at line 89:
<comment>Parameter description should specify source ID to match the connector API.</comment>
<file context>
@@ -0,0 +1,412 @@
+
+```typescript
+{
+ account_id: string, // Account ID for messages
+ batch_size?: number // Messages per chat (default: 20)
+}
</file context>
|
|
||
| ```typescript | ||
| { | ||
| account_id: string, // Account ID to get chats from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameter description is misleading; this tool expects the source ID from account.sources, not the generic account ID.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/UNIPILE_README.md at line 69:
<comment>Parameter description is misleading; this tool expects the source ID from account.sources, not the generic account ID.</comment>
<file context>
@@ -0,0 +1,412 @@
+
+```typescript
+{
+ account_id: string, // Account ID to get chats from
+ limit?: number // Max chats to return (default: 10)
+}
</file context>
| **Messages not being tracked:** | ||
| - Ensure all optional parameters are provided to `send_message` | ||
| - Check that contact data is being stored with `get_all_stored_contacts` | ||
| - Verify persistence is working with `get_top_contacts` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect tool name; use unipile_get_top_contacts to match the defined tool.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/UNIPILE_README.md at line 379:
<comment>Incorrect tool name; use `unipile_get_top_contacts` to match the defined tool.</comment>
<file context>
@@ -0,0 +1,412 @@
+**Messages not being tracked:**
+- Ensure all optional parameters are provided to `send_message`
+- Check that contact data is being stored with `get_all_stored_contacts`
+- Verify persistence is working with `get_top_contacts`
+
+### Debug Mode
</file context>
| - Verify persistence is working with `get_top_contacts` | |
| - Verify persistence is working with `unipile_get_top_contacts` |
|
|
||
| **Messages not being tracked:** | ||
| - Ensure all optional parameters are provided to `send_message` | ||
| - Check that contact data is being stored with `get_all_stored_contacts` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect tool name; use unipile_get_all_stored_contacts to match the defined tool.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/UNIPILE_README.md at line 378:
<comment>Incorrect tool name; use `unipile_get_all_stored_contacts` to match the defined tool.</comment>
<file context>
@@ -0,0 +1,412 @@
+
+**Messages not being tracked:**
+- Ensure all optional parameters are provided to `send_message`
+- Check that contact data is being stored with `get_all_stored_contacts`
+- Verify persistence is working with `get_top_contacts`
+
</file context>
| - Check that contact data is being stored with `get_all_stored_contacts` | |
| - Check that contact data is being stored with `unipile_get_all_stored_contacts` |
| - Refresh chat list to get current IDs | ||
|
|
||
| **Messages not being tracked:** | ||
| - Ensure all optional parameters are provided to `send_message` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect tool name; use unipile_send_message to match the defined tool.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/UNIPILE_README.md at line 377:
<comment>Incorrect tool name; use `unipile_send_message` to match the defined tool.</comment>
<file context>
@@ -0,0 +1,412 @@
+- Refresh chat list to get current IDs
+
+**Messages not being tracked:**
+- Ensure all optional parameters are provided to `send_message`
+- Check that contact data is being stored with `get_all_stored_contacts`
+- Verify persistence is working with `get_top_contacts`
</file context>
| server.tool(tool.name, tool.description, tool.schema.shape, async (args: unknown) => { | ||
| const startTime = Date.now(); | ||
| customLogger(`Tool invoked: ${tool.name}`, 'info'); | ||
| customLogger(`Tool args: ${JSON.stringify(args, null, 2)}`, 'debug'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid logging raw tool arguments to prevent leaking sensitive data; redact or log only metadata.
Prompt for AI agents
Address the following comment on scripts/start-server.ts at line 196:
<comment>Avoid logging raw tool arguments to prevent leaking sensitive data; redact or log only metadata.</comment>
<file context>
@@ -0,0 +1,364 @@
+ server.tool(tool.name, tool.description, tool.schema.shape, async (args: unknown) => {
+ const startTime = Date.now();
+ customLogger(`Tool invoked: ${tool.name}`, 'info');
+ customLogger(`Tool args: ${JSON.stringify(args, null, 2)}`, 'debug');
+
+ try {
</file context>
| } | ||
| }, | ||
| readCache: async (key: string): Promise<string | null> => { | ||
| return cacheStore.get(key) || null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty-string cache values are incorrectly converted to null; prefer nullish coalescing for Map.get results.
Prompt for AI agents
Address the following comment on scripts/start-server.ts at line 63:
<comment>Empty-string cache values are incorrectly converted to null; prefer nullish coalescing for Map.get results.</comment>
<file context>
@@ -0,0 +1,364 @@
+ }
+ },
+ readCache: async (key: string): Promise<string | null> => {
+ return cacheStore.get(key) || null;
+ },
+ writeCache: async (key: string, value: string): Promise<void> => {
</file context>
| return cacheStore.get(key) || null; | |
| return cacheStore.get(key) ?? null; |
| if (key === undefined) { | ||
| return Object.fromEntries(dataStore) as T; | ||
| } | ||
| return (dataStore.get(key) as T) || null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using || null here drops valid falsy values from the data store; use has() or nullish coalescing to preserve them.
Prompt for AI agents
Address the following comment on scripts/start-server.ts at line 48:
<comment>Using || null here drops valid falsy values from the data store; use has() or nullish coalescing to preserve them.</comment>
<file context>
@@ -0,0 +1,364 @@
+ if (key === undefined) {
+ return Object.fromEntries(dataStore) as T;
+ }
+ return (dataStore.get(key) as T) || null;
+ },
+ setData: async (
</file context>
| country_code: phone.country_code || phone.country, | ||
| })), | ||
| count: phoneNumbers.length, | ||
| raw_response: result, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning the full raw API response can expose unnecessary or sensitive fields. Omit this field or include only sanitized data.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/elevenlabs.ts at line 703:
<comment>Returning the full raw API response can expose unnecessary or sensitive fields. Omit this field or include only sanitized data.</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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid logging entire API responses; this may leak sensitive data. Log a brief message instead or guard behind a debug flag.
Prompt for AI agents
Address the following comment on packages/mcp-connectors/src/connectors/elevenlabs.ts at line 689:
<comment>Avoid logging entire API responses; this may leak sensitive data. Log a brief message instead or guard behind a debug flag.</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 from /convai/phone-numbers'); |
…t storage function.
…hen searches through previous chats to find contacts as quickly as possible, allowing you to send messages with the functions.
15ae64f to
8541e82
Compare
Start coding and realize you forgot to send an important message? Use the Unipile connector to send messages to all of your WhatsApp contacts and on LinkedIn. And then even better take the number from your WhatsApp contact and call them up with the 11 Labs call functionality. Whoop whoop what more would you possibly want in life?
Summary by cubic
Adds a Unipile MCP connector for multi-platform messaging with persistent contact memory, and extends ElevenLabs to create agents and place outbound phone calls. Also adds a local MCP server for testing and comprehensive specs.
New Features
Dependencies