salesforce-metadata-mcp 2.5.6 → 2.6.6
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/AGENTFORCE.md +159 -125
- package/APEX_LWC.md +214 -214
- package/CHANGELOG.md +965 -645
- package/LICENSE +21 -21
- package/README.md +210 -207
- package/SECURITY.md +106 -106
- package/SETUP.md +217 -217
- package/TOOLS.md +249 -209
- package/dist/index.js +4 -4
- package/dist/schemas/index.d.ts +281 -95
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +97 -75
- package/dist/schemas/index.js.map +1 -1
- package/dist/services/deployment.d.ts +6 -3
- package/dist/services/deployment.d.ts.map +1 -1
- package/dist/services/deployment.js +83 -49
- package/dist/services/deployment.js.map +1 -1
- package/dist/services/mcpgen.js +96 -96
- package/dist/services/salesforce.d.ts +19 -4
- package/dist/services/salesforce.d.ts.map +1 -1
- package/dist/services/salesforce.js +2321 -1824
- package/dist/services/salesforce.js.map +1 -1
- package/dist/tools/admin.js +41 -41
- package/dist/tools/agentforce.d.ts.map +1 -1
- package/dist/tools/agentforce.js +171 -44
- package/dist/tools/agentforce.js.map +1 -1
- package/dist/tools/apex.js +4 -4
- package/dist/tools/apex.js.map +1 -1
- package/dist/tools/audit.js +44 -44
- package/dist/tools/automation.d.ts.map +1 -1
- package/dist/tools/automation.js +57 -57
- package/dist/tools/automation.js.map +1 -1
- package/dist/tools/comms.js +12 -12
- package/dist/tools/cpq.js +24 -24
- package/dist/tools/data.js +52 -52
- package/dist/tools/deployment.d.ts.map +1 -1
- package/dist/tools/deployment.js +3 -2
- package/dist/tools/deployment.js.map +1 -1
- package/dist/tools/devops.js +57 -57
- package/dist/tools/einstein.js +38 -38
- package/dist/tools/flows.d.ts.map +1 -1
- package/dist/tools/flows.js +32 -2
- package/dist/tools/flows.js.map +1 -1
- package/dist/tools/lwc.js +18 -18
- package/dist/tools/metadata.d.ts.map +1 -1
- package/dist/tools/metadata.js +50 -51
- package/dist/tools/metadata.js.map +1 -1
- package/dist/tools/monitoring.js +26 -26
- package/dist/tools/omnichannel.js +105 -105
- package/dist/tools/omnistudio.js +96 -96
- package/dist/tools/security.js +22 -22
- package/dist/tools/ui.js +21 -21
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +118 -109
package/AGENTFORCE.md
CHANGED
|
@@ -1,125 +1,159 @@
|
|
|
1
|
-
# Agentforce Guide
|
|
2
|
-
|
|
3
|
-
Complete guide for creating Agentforce agents with `salesforce-metadata-mcp`.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Overview
|
|
8
|
-
|
|
9
|
-
Agentforce (Einstein Copilot) agents consist of
|
|
10
|
-
|
|
11
|
-
1. **Agent** — The
|
|
12
|
-
2. **
|
|
13
|
-
3. **
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Step 2: Create
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
-
|
|
1
|
+
# Agentforce Guide
|
|
2
|
+
|
|
3
|
+
Complete guide for creating Agentforce agents with `salesforce-metadata-mcp`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
Agentforce (Einstein Copilot) agents consist of four components deployed in this order:
|
|
10
|
+
|
|
11
|
+
1. **Agent** (`Bot`) — The AI assistant shell with persona and tone
|
|
12
|
+
2. **Actions** (`GenAiFunction`) — Concrete steps powered by Flows, Apex, or Prompt Templates
|
|
13
|
+
3. **Topics** (`GenAiPlugin`) — Areas of expertise; each topic lists which actions it can invoke
|
|
14
|
+
4. **Planner** (`GenAiPlanner`) — **The critical wiring step** that connects the agent to its topics
|
|
15
|
+
|
|
16
|
+
> **Why the planner matters:** Without step 4, the agent exists in Salesforce but has zero routing capability. It cannot reach any topic or action. `sf_create_agent_planner` is what makes the agent functional.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Step 1: Create the Agent
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
Create an Agentforce agent called SalesAssistant:
|
|
24
|
+
- Label: Sales Assistant
|
|
25
|
+
- Persona: A knowledgeable sales expert who helps reps close more deals
|
|
26
|
+
- Tone: Professional
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
This calls `sf_create_agent` with:
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"agentName": "SalesAssistant",
|
|
33
|
+
"label": "Sales Assistant",
|
|
34
|
+
"persona": "A knowledgeable sales expert who helps reps close more deals",
|
|
35
|
+
"tone": "Neutral"
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Step 2: Create a Flow for Each Action
|
|
42
|
+
|
|
43
|
+
Create the Flow that the agent will invoke:
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Create an AutoLaunchedFlow called Get_Account_Orders that:
|
|
47
|
+
- Takes an input variable accountId (String, isInput: true)
|
|
48
|
+
- Queries related Order__c records using GetRecords
|
|
49
|
+
- Returns them in an output variable orders (SObject collection, isOutput: true)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Step 3: Create Actions
|
|
55
|
+
|
|
56
|
+
Create a `GenAiFunction` linked to each Flow. **Note the action name — you'll need it in Step 4.**
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
Create an agent action called GetOrders for the SalesAssistant agent's OrderManagement topic:
|
|
60
|
+
- Type: Flow
|
|
61
|
+
- Reference: Get_Account_Orders
|
|
62
|
+
- Description: Retrieves all orders for a given account
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This calls `sf_create_agent_action`. The action is deployed as a standalone `GenAiFunction` — it gets linked to the topic in the next step.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Step 4: Create Topics (with actions listed)
|
|
70
|
+
|
|
71
|
+
Topics are created with their actions already listed. This is what links actions to topics.
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
Add a topic called OrderManagement to the SalesAssistant agent:
|
|
75
|
+
- Label: Order Management
|
|
76
|
+
- Description: Handles all questions about customer orders, quotes, and order status
|
|
77
|
+
- Scope: User questions about creating orders, checking order status, updating order quantities
|
|
78
|
+
- Instructions: 1. Identify the order or account. 2. Check current status. 3. Take appropriate action.
|
|
79
|
+
- Actions: ["GetOrders"]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
This calls `sf_create_agent_topic` with `actions: ["GetOrders"]` — this embeds `<genAiFunctions>` in the topic XML.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Step 5: Wire the Agent to its Topics (the Planner)
|
|
87
|
+
|
|
88
|
+
This is the step that was previously missing. Call `sf_create_agent_planner` after all topics are created:
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
Wire the SalesAssistant agent to its topics: OrderManagement
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
This calls `sf_create_agent_planner` with:
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"agentName": "SalesAssistant",
|
|
98
|
+
"label": "Sales Assistant",
|
|
99
|
+
"topicNames": ["OrderManagement"]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
This deploys a `GenAiPlanner` record that routes user requests from the agent to the correct topic.
|
|
104
|
+
|
|
105
|
+
> If you add more topics later, call `sf_create_agent_planner` again with the **full updated list** of topic names — it will overwrite the planner with the new configuration.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## End-to-End Example
|
|
110
|
+
|
|
111
|
+
Full conversation to create a support agent:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
1. Create an Agentforce agent called SupportAgent with:
|
|
115
|
+
- Persona: "A friendly and efficient customer support representative"
|
|
116
|
+
- Tone: Formal
|
|
117
|
+
- Company: Acme Corp
|
|
118
|
+
|
|
119
|
+
2. Create an AutoLaunchedFlow called Create_Support_Case with:
|
|
120
|
+
- Input variables: subject (String), description (String), contactId (String)
|
|
121
|
+
- A CreateRecords element creating a Case with inputAssignments for those fields
|
|
122
|
+
- Output variable: caseId (String)
|
|
123
|
+
|
|
124
|
+
3. Create an agent action CreateCase for SupportAgent.CaseManagement:
|
|
125
|
+
- Type: Flow
|
|
126
|
+
- Reference: Create_Support_Case
|
|
127
|
+
- Description: Creates a new support case for the customer
|
|
128
|
+
|
|
129
|
+
4. Add a topic CaseManagement to SupportAgent:
|
|
130
|
+
- Description: Handles customer support cases, status inquiries, and escalations
|
|
131
|
+
- Scope: Questions about case status, creating new cases, escalating urgent issues
|
|
132
|
+
- Actions: ["CreateCase"]
|
|
133
|
+
|
|
134
|
+
5. Wire SupportAgent to its topics:
|
|
135
|
+
- topicNames: ["CaseManagement"]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Testing Your Agent
|
|
141
|
+
|
|
142
|
+
After completing all steps:
|
|
143
|
+
|
|
144
|
+
1. **Activate the agent** in Setup → Agents → Your Agent → Activate
|
|
145
|
+
2. **Open Copilot** in any Salesforce page (the lightning bolt icon)
|
|
146
|
+
3. **Test a prompt:** "I need to create a support case for a billing issue"
|
|
147
|
+
|
|
148
|
+
The agent should route to the CaseManagement topic and invoke the CreateCase action.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Tips
|
|
153
|
+
|
|
154
|
+
- **Create actions before topics** — topics need to list their action names upfront
|
|
155
|
+
- **Always run sf_create_agent_planner last** — it's the step that activates routing
|
|
156
|
+
- **Adding a new topic?** Re-run `sf_create_agent_planner` with all topic names (existing + new)
|
|
157
|
+
- **Be specific in topic descriptions** — the AI uses them to route requests
|
|
158
|
+
- **Use clear action descriptions** — help the agent know when to invoke each action
|
|
159
|
+
- **Start with Flows** — they're easiest to create and debug
|