@loopops/mcp-server 3.8.0 → 3.9.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/dist/tools/sfdc-sync.js +48 -0
- package/package.json +1 -1
package/dist/tools/sfdc-sync.js
CHANGED
|
@@ -57,6 +57,54 @@ export function registerSfdcSyncTools(server, allowed) {
|
|
|
57
57
|
.describe("Why this account is being approved (e.g. 'Tier-1 strategic prospect', 'Existing customer expansion target', 'Q3 ABM list'). Stored in the lifecycle event payload for audit."),
|
|
58
58
|
}, safeTool(async (input) => trpcMutation("mcp.approveInitialDeployment", input)));
|
|
59
59
|
}
|
|
60
|
+
if (allowed.has("export_pending_approvals")) {
|
|
61
|
+
server.tool("export_pending_approvals", [
|
|
62
|
+
"Export the pending_initial_deployment_review queue as CSV text. Each row carries the",
|
|
63
|
+
"account_id (required for round-trip), key context fields (name, domain, country, segment,",
|
|
64
|
+
"score, band, queued_since), and two empty operator-input columns: `approve` and `reason`.",
|
|
65
|
+
"",
|
|
66
|
+
"Workflow:",
|
|
67
|
+
" 1. Run this tool — copy the CSV text from the response",
|
|
68
|
+
" 2. Paste into Excel / Google Sheets / Numbers, edit the approve + reason columns",
|
|
69
|
+
" 3. Set approve=yes (or y/true) on rows you want to push to SF; leave others blank or =no",
|
|
70
|
+
" 4. Add a reason on each approve=yes row (audit log; required, ≥3 chars)",
|
|
71
|
+
" 5. Run `process_approvals_csv` with the edited CSV content",
|
|
72
|
+
"",
|
|
73
|
+
"See docs/csv-templates/pending-approvals.csv for the canonical shape.",
|
|
74
|
+
].join("\n"), {
|
|
75
|
+
limit: z
|
|
76
|
+
.number()
|
|
77
|
+
.int()
|
|
78
|
+
.positive()
|
|
79
|
+
.max(1000)
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("Max accounts in the export (1-1000). Default: 200."),
|
|
82
|
+
}, safeTool(async (input) => trpcQuery("mcp.exportPendingApprovals", input)));
|
|
83
|
+
}
|
|
84
|
+
if (allowed.has("process_approvals_csv")) {
|
|
85
|
+
server.tool("process_approvals_csv", [
|
|
86
|
+
"Bulk-approve accounts from a CSV exported via `export_pending_approvals`. For each row",
|
|
87
|
+
"where `approve = yes/y/true`, calls approveInitialDeployment with the row's reason —",
|
|
88
|
+
"writes the same lifecycle event (with reason + snapshot payload) as a single-account",
|
|
89
|
+
"approval would.",
|
|
90
|
+
"",
|
|
91
|
+
"Validation:",
|
|
92
|
+
" - account_id must currently be in pending_initial_deployment_review (else row fails)",
|
|
93
|
+
" - reason must be ≥3 chars on approve=yes rows (else row fails)",
|
|
94
|
+
" - approve != yes → row is skipped (account stays in the queue)",
|
|
95
|
+
"",
|
|
96
|
+
"Failures don't abort the batch — they're collected and surfaced in the response. Re-run",
|
|
97
|
+
"the corrected CSV any time; already-approved accounts return 'not_in_review' and are",
|
|
98
|
+
"reported as failures (idempotent — no double-approval).",
|
|
99
|
+
"",
|
|
100
|
+
"See docs/csv-templates/pending-approvals.csv for the canonical shape.",
|
|
101
|
+
].join("\n"), {
|
|
102
|
+
csv: z
|
|
103
|
+
.string()
|
|
104
|
+
.min(1)
|
|
105
|
+
.describe("CSV content (header row + data rows). Required headers: account_id, approve, reason. Other columns from export_pending_approvals are tolerated."),
|
|
106
|
+
}, safeTool(async (input) => trpcMutation("mcp.processApprovalsCsv", input)));
|
|
107
|
+
}
|
|
60
108
|
if (allowed.has("deployment_status")) {
|
|
61
109
|
server.tool("deployment_status", "Top-line counts of accounts in each deployment lifecycle state (pending review, pending update, deployed, deployment_failed, sync_drift). Includes a sample of the initial-review queue so ops can spot-check what's waiting for approval.", {
|
|
62
110
|
sampleSize: z
|