@sendinel/mcp-server 1.0.85 → 1.0.87
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/build/tools/campaigns.js +7 -50
- package/build/tools/connector.js +9 -3
- package/package.json +1 -1
package/build/tools/campaigns.js
CHANGED
|
@@ -2223,62 +2223,19 @@ Do not include body_html in your response; Sendinel renders body_html from block
|
|
|
2223
2223
|
idempotentHint: true,
|
|
2224
2224
|
openWorldHint: false,
|
|
2225
2225
|
},
|
|
2226
|
-
description: 'Preview email
|
|
2226
|
+
description: 'Preview email through the real send renderer using sample contact data; unresolved_tags lists remaining tags. Provide content via step_id, draft_id, or raw body_html/subject.',
|
|
2227
2227
|
inputSchema: {
|
|
2228
|
+
site_id: z.string().uuid().optional().describe('Site UUID for sender tags and footers'),
|
|
2228
2229
|
step_id: z.string().uuid().optional().describe('Campaign step UUID'),
|
|
2229
2230
|
draft_id: z.string().uuid().optional().describe('AI draft UUID'),
|
|
2230
2231
|
subject: z.string().optional().describe('Raw subject'),
|
|
2231
2232
|
body_html: z.string().optional().describe('Raw HTML'),
|
|
2232
2233
|
},
|
|
2233
|
-
}, async ({ step_id, draft_id, subject, body_html }) => {
|
|
2234
|
-
const
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
if (!subj && !html) {
|
|
2239
|
-
if (step_id) {
|
|
2240
|
-
const { data: step, error } = await db()
|
|
2241
|
-
.from('campaign_steps')
|
|
2242
|
-
.select('subject, body_html, body_text')
|
|
2243
|
-
.eq('id', step_id)
|
|
2244
|
-
.maybeSingle();
|
|
2245
|
-
if (error || !step)
|
|
2246
|
-
return txt('Error: Step not found');
|
|
2247
|
-
subj = step.subject;
|
|
2248
|
-
html = step.body_html ?? '';
|
|
2249
|
-
text = step.body_text ?? '';
|
|
2250
|
-
}
|
|
2251
|
-
else if (draft_id) {
|
|
2252
|
-
const { data: draft, error } = await db()
|
|
2253
|
-
.from('ai_drafts')
|
|
2254
|
-
.select('subject, body_html, body_text')
|
|
2255
|
-
.eq('id', draft_id)
|
|
2256
|
-
.eq('project_id', projectId)
|
|
2257
|
-
.maybeSingle();
|
|
2258
|
-
if (error || !draft)
|
|
2259
|
-
return txt('Error: Draft not found');
|
|
2260
|
-
subj = draft.subject;
|
|
2261
|
-
html = draft.body_html ?? '';
|
|
2262
|
-
text = draft.body_text ?? '';
|
|
2263
|
-
}
|
|
2264
|
-
else {
|
|
2265
|
-
return txt('Provide step_id, draft_id, or raw subject/body_html.');
|
|
2266
|
-
}
|
|
2267
|
-
}
|
|
2268
|
-
const { data: sample } = await db()
|
|
2269
|
-
.from('subscribers')
|
|
2270
|
-
.select('id, email, first_name, last_name')
|
|
2271
|
-
.eq('project_id', projectId)
|
|
2272
|
-
.eq('global_unsubscribed', false)
|
|
2273
|
-
.order('created_at', { ascending: true })
|
|
2274
|
-
.limit(1)
|
|
2275
|
-
.maybeSingle();
|
|
2276
|
-
const contact = sample ?? { email: 'preview@example.com', first_name: 'Jane' };
|
|
2277
|
-
const resolve = (t) => t
|
|
2278
|
-
.replace(/\{\{first_name\}\}/g, contact.first_name || 'there')
|
|
2279
|
-
.replace(/\{\{email\}\}/g, contact.email)
|
|
2280
|
-
.replace(/\{\{unsubscribe_url\}\}/g, '#unsubscribe-preview');
|
|
2281
|
-
return j({ subject: resolve(subj), body_html: resolve(html), body_text: resolve(text), sample_contact: contact });
|
|
2234
|
+
}, async ({ step_id, draft_id, subject, body_html, site_id }) => {
|
|
2235
|
+
const result = await callSendinelV1('/api/v1/campaigns/preview', {
|
|
2236
|
+
body: { step_id, draft_id, subject, body_html, site_id },
|
|
2237
|
+
});
|
|
2238
|
+
return result.ok ? j(result.data) : j({ error: result.error, status: result.status });
|
|
2282
2239
|
});
|
|
2283
2240
|
server.registerTool('send_test_email', {
|
|
2284
2241
|
title: 'Send Test Email',
|
package/build/tools/connector.js
CHANGED
|
@@ -243,24 +243,30 @@ export function registerConnectorTools(server) {
|
|
|
243
243
|
}),
|
|
244
244
|
metadata_columns: z.array(z.string()).max(100).optional()
|
|
245
245
|
.describe('Extra source columns copied into contact custom_properties.'),
|
|
246
|
+
signal_columns: z.record(z.string(), z.string().min(1).max(160)).optional()
|
|
247
|
+
.describe('Source timestamp columns mapped to signal-only event names. Shared names use the earliest timestamp. Requires a view reinstall.'),
|
|
248
|
+
signal_backfill: z.enum(['write', 'skip']).optional()
|
|
249
|
+
.describe('First sync of a signal column: write historical events (default), or record values without events.'),
|
|
246
250
|
identity_merge: z.enum(['off', 'by_email']).optional()
|
|
247
251
|
.describe('How the contact view treats a person found both in the source table and as a Sendinel-owned contact: off = two rows (default), by_email = one row per email (source wins the name, tags combined, unsubscribe and test flags kept from either side). Omit to leave it unchanged.'),
|
|
248
252
|
...approvalFields,
|
|
249
253
|
},
|
|
250
|
-
}, async ({ table_id, mapping, metadata_columns, identity_merge, confirmed, approval_id }) => {
|
|
251
|
-
const
|
|
254
|
+
}, async ({ table_id, mapping, metadata_columns, signal_columns, signal_backfill, identity_merge, confirmed, approval_id }) => {
|
|
255
|
+
const signalParams = { ...(signal_columns !== undefined ? { signal_columns } : {}), ...(signal_backfill !== undefined ? { signal_backfill } : {}) };
|
|
256
|
+
const approvalParams = { table_id, mapping, metadata_columns, ...signalParams, ...(identity_merge ? { identity_merge } : {}) };
|
|
252
257
|
const gate = await authorizeConnectorMutation('set_connector_mapping', confirmed, approval_id, approvalParams, {
|
|
253
258
|
effect: 'Replace the connector mapping, clear removed custom properties, refresh the live view, and resync contacts.',
|
|
254
259
|
table_id,
|
|
255
260
|
mapping,
|
|
256
261
|
metadata_columns: metadata_columns ?? [],
|
|
262
|
+
...signalParams,
|
|
257
263
|
...(identity_merge ? { identity_merge } : {}),
|
|
258
264
|
});
|
|
259
265
|
if (gate)
|
|
260
266
|
return gate;
|
|
261
267
|
const result = await callConnectorApi('/api/dashboard/connector/mapping', {
|
|
262
268
|
method: 'PATCH',
|
|
263
|
-
body: { table_id, mapping, metadata_columns, ...(identity_merge ? { identity_merge } : {}) },
|
|
269
|
+
body: { table_id, mapping, metadata_columns, ...signalParams, ...(identity_merge ? { identity_merge } : {}) },
|
|
264
270
|
});
|
|
265
271
|
return j(result.ok ? result.data : { error: result.error });
|
|
266
272
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendinel/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.87",
|
|
4
4
|
"description": "AI-controlled email operations control plane for campaigns, contacts, segments, analytics, and multi-provider sending via MCP.",
|
|
5
5
|
"mcpName": "ai.sendinel/mcp-server",
|
|
6
6
|
"type": "module",
|