call-me-cloud-mcp 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +26 -0
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -116,6 +116,20 @@ async function main() {
|
|
|
116
116
|
required: ['call_id', 'message'],
|
|
117
117
|
},
|
|
118
118
|
},
|
|
119
|
+
{
|
|
120
|
+
name: 'send_message',
|
|
121
|
+
description: 'Send a WhatsApp message to the user. Use when a phone call is not appropriate or when the user prefers text. Waits for user response.',
|
|
122
|
+
inputSchema: {
|
|
123
|
+
type: 'object',
|
|
124
|
+
properties: {
|
|
125
|
+
message: {
|
|
126
|
+
type: 'string',
|
|
127
|
+
description: 'The message to send via WhatsApp.',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
required: ['message'],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
119
133
|
],
|
|
120
134
|
};
|
|
121
135
|
});
|
|
@@ -211,6 +225,18 @@ async function main() {
|
|
|
211
225
|
};
|
|
212
226
|
}
|
|
213
227
|
|
|
228
|
+
if (request.params.name === 'send_message') {
|
|
229
|
+
const { message } = request.params.arguments as { message: string };
|
|
230
|
+
const result = await apiCall('/api/message', { message }) as { messageId: string; response: string };
|
|
231
|
+
|
|
232
|
+
return {
|
|
233
|
+
content: [{
|
|
234
|
+
type: 'text',
|
|
235
|
+
text: `WhatsApp message sent.\n\nMessage ID: ${result.messageId}\n\nUser's response:\n${result.response}`,
|
|
236
|
+
}],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
|
|
214
240
|
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
215
241
|
} catch (error) {
|
|
216
242
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|