@loopops/mcp-server 3.7.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.
@@ -42,9 +42,68 @@ export function registerSfdcSyncTools(server, allowed) {
42
42
  "config/account_master/sfdc_deploy.yaml has initial_deployment.mode=review). Promotes the",
43
43
  "account to pending_update_deployment so the next deploy run pushes it to SF.",
44
44
  "",
45
+ "Always include a `reason` — it lands on the lifecycle event payload alongside a snapshot",
46
+ "of the account's score + key fields at approval time. Future operators can reconstruct",
47
+ "'why did we approve this back in May?' from the event row alone.",
48
+ "",
45
49
  "Use this for the first push of every new account until you flip mode=auto in the YAML",
46
50
  "(once you trust the eligibility filter + field map).",
47
- ].join("\n"), accountIdentifierShape, safeTool(async (input) => trpcMutation("mcp.approveInitialDeployment", input)));
51
+ ].join("\n"), {
52
+ ...accountIdentifierShape,
53
+ reason: z
54
+ .string()
55
+ .min(3)
56
+ .max(500)
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
+ }, safeTool(async (input) => trpcMutation("mcp.approveInitialDeployment", input)));
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)));
48
107
  }
49
108
  if (allowed.has("deployment_status")) {
50
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.", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loopops/mcp-server",
3
- "version": "3.7.0",
3
+ "version": "3.9.0",
4
4
  "description": "Loop Operations MCP Server — AI skills for RevOps",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",