@loopops/mcp-server 3.45.0 → 3.46.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/cpq.js +30 -0
- package/package.json +1 -1
package/dist/tools/cpq.js
CHANGED
|
@@ -51,6 +51,36 @@ export function registerCpqTools(server, allowed) {
|
|
|
51
51
|
opportunityName,
|
|
52
52
|
})));
|
|
53
53
|
}
|
|
54
|
+
if (allowed.has("create_opportunity")) {
|
|
55
|
+
server.tool("create_opportunity", "Create a new Salesforce Opportunity on an existing Account. Use only after the rep confirms stage / amount / closeDate — the agent should NEVER silently create with assumed defaults. Refuses if (a) the Account doesn't exist, (b) any open Opportunity already exists on the Account (anti-duplicate guard — use the existing opp instead). Typical chain: find_opportunity returns 0 matches → agent proposes opp shape → rep confirms → create_opportunity → draft_quote_from_intent.", {
|
|
56
|
+
accountName: z
|
|
57
|
+
.string()
|
|
58
|
+
.min(2)
|
|
59
|
+
.max(200)
|
|
60
|
+
.describe("Customer Account name (case-insensitive substring match). Must resolve to exactly one existing Account."),
|
|
61
|
+
opportunityName: z
|
|
62
|
+
.string()
|
|
63
|
+
.min(3)
|
|
64
|
+
.max(120)
|
|
65
|
+
.describe("Name for the new Opportunity (e.g., 'Vercel — Loop CPQ')."),
|
|
66
|
+
stage: z
|
|
67
|
+
.string()
|
|
68
|
+
.min(1)
|
|
69
|
+
.describe("Salesforce StageName (e.g., 'Prospecting', 'Qualification', 'Value Proposition'). Must match the org's Opportunity stage picklist."),
|
|
70
|
+
amount: z
|
|
71
|
+
.number()
|
|
72
|
+
.positive()
|
|
73
|
+
.describe("Opportunity Amount in USD. The rep's commit number is a sensible default."),
|
|
74
|
+
closeDate: z
|
|
75
|
+
.string()
|
|
76
|
+
.regex(/^\d{4}-\d{2}-\d{2}$/, "YYYY-MM-DD")
|
|
77
|
+
.describe("Expected close date (YYYY-MM-DD). Ask the rep — don't invent."),
|
|
78
|
+
type: z
|
|
79
|
+
.string()
|
|
80
|
+
.optional()
|
|
81
|
+
.describe("Opportunity Type (e.g., 'New Customer'). Optional."),
|
|
82
|
+
}, safeTool(async (args) => trpcMutation("mcp.createOpportunity", args)));
|
|
83
|
+
}
|
|
54
84
|
if (allowed.has("draft_quote_from_intent")) {
|
|
55
85
|
server.tool("draft_quote_from_intent", "Generate a Salesforce Quote from a free-form sizing intent. Claude Sonnet 4.6 parses the intent into a structured sizing payload, then the Apex Invocable CpqQuoteBuilder creates the Quote + line items with the negotiated discount applied. Pass EITHER opportunityId OR accountName (you typically know the account name; the tool resolves internally to the single open opp. If multiple opps match the name, the tool returns a disambiguation prompt). If the model's parse confidence is below 0.6 (a critical sizing field is ambiguous), the tool returns a clarifying question instead of writing. Quote ships in Status = Draft; the rep approves separately.", {
|
|
56
86
|
opportunityId: z
|