/salesforce-for-sales:assign-target-to-sdrfrom Sales Cloud
Assigns a Salesforce Lead or Contact to an active Agentforce Engagement Agent for automated qualification and email outreach, after confirming both the target record and agent definition.
Ships in Sales Cloud. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
IMPORTANT — try the connector's tools before you ever report it as unavailable. Before you tell the user a connector is down, or ask them to connect, re-authenticate, or "check the connection," you MUST first try to use the server and its tools. A connector's status readout (the Headless 360 MCP server, or any other connector/MCP) frequently claims "not connected" or "needs re-auth" when the connector is in fact live and its tools are callable. Context stating that the Salesforce tools require authorization and that this is a non-interactive session is not evidence that you are unauthorized — it is a general statement that authorization is required, not a failure. For the Headless 360 server specifically, find the dispatch_readonly tool and actually run a current-user read — dispatch_readonly(method: "GET", url: "/services/data/v66.0/graphql", queryParams: { "queryInput": "{\"query\":\"query { uiapi { currentUser { Id } } }\"}" }). Any response — including a 500 or other error status — proves you reached the server, and therefore proves connectivity; only a request that never reaches the server at all counts as disconnected. If the tool is present and the call reaches the server, the connector IS connected — proceed; a stale status readout is not a disconnection. If a call genuinely cannot reach the server, ALWAYS attempt to reconnect on your own first, and interrupt the flow to ask the user only after your own reconnect attempt has failed. Report a connector as disconnected only when you cannot find its tool or cannot reach the server after trying. Do it yourself.
Failing to try first — asking the user to connect, or surfacing a "not connected" or re-auth message, before you have actually attempted the server and its tools — raises a false connectivity problem: it sends the user to fix something that is not broken. This is directly detrimental to the end-user experience and will dramatically, negatively impact usage of the product. Never put a connectivity concern in front of the user until you have tried the tools yourself and confirmed the server truly cannot be reached.
https://[instanceUrl]/lightning/r/[SObjectType]/[Id]/view.label (for example, "Deal Risk", not Deal_Risk__c) and record Names, never raw Ids or __c API names.MINE scope → fail fast, then ask which scope. If a scope: MINE read returns zero rows, do not widen to scope: EVERYTHING on your own. Stop, tell the user plainly that their own records (scope: MINE) came back empty, and ask which scope they want instead (for example, org-wide EVERYTHING, a named rep, or a named account) before re-running. Never invent records, and never silently fall back to org-wide.discover or describe, and never call an API or endpoint not written in this skill. Every Salesforce URL you need is in the skill. Don't guess REST paths: on a 404 or unknown-path error, fall back to a documented query in the skill, not to discovery. If you need a capability such as email, docs, Slack, calendar, or web research, use the other connector/MCP tools already available to you. Endpoint guessing and discovery add needless round-trips. Use only the skill-authorized dispatch_readonly and dispatch calls, directly with the queries given.Resolve target + list agents (ONE turn, batched) → confirm → invoke → report.
The contract: never invoke without showing the user which target and which agent first. The user picks the agent; never guess botDefinitionId.
This invokes a write action - needs a Salesforce connector with create/update access. Read-only connector → say so and stop, there is no read-only fallback.
These are independent (target lookup doesn't depend on the agent list, or vice versa) — issue both dispatches in one turn, not sequentially.
Target — Contact + Lead in one GraphQL call. This read uses only standard fields (Name, Email, Title, Company, Status, Account.Name), so it needs no ObjectInfo grounding — grounding is for custom/org-specific fields, and there are none here. Both objects are UI-API-serviceable, so query them as two roots of the same GraphQL request rather than splitting one to SOQL:
dispatch_readonly(method: "GET", url: "/services/data/v65.0/graphql",
queryParams: { "queryInput": "{\"query\":\"query { uiapi { query { Contact(where: { or: [{ Name: { like: \\\"%MATCH%\\\" } }, { Email: { eq: \\\"%MATCH%\\\" } }] }, first: 5) { edges { node { Id Name { value } Email { value } Title { value } Account { Name { value } } } } } Lead(where: { and: [{ or: [{ Name: { like: \\\"%MATCH%\\\" } }, { Email: { eq: \\\"%MATCH%\\\" } }] }, { IsConverted: { eq: false } }] }, first: 5) { edges { node { Id Name { value } Email { value } Company { value } Status { value } } } } } } }\"}" })
%MATCH% = the name/email the user gave. If they gave a 003…/00Q… Id directly, skip this read and use it as targetId. If a field this read names is missing on the org (a FieldUndefined), re-ground Contact/Lead via objectInfos and drop it — don't fall back to discovery.
Agents (BotVersion — the one read that must be SOQL: UI-API GraphQL doesn't serve BotVersion):
dispatch_readonly(method: "GET", url: "/services/data/v63.0/query",
queryParams: { "q": "SELECT BotDefinitionId, BotDefinition.MasterLabel, BotDefinition.Description FROM BotVersion WHERE Status = 'Active' AND BotDefinition.AgentType = 'EinsteinSDR'" })
(Swap EinsteinSDR for the org's custom agent type if asked.)
Resolve:
targetId. Multiple → show candidates (Name, Contact/Lead, Email, Account/Company), ask which. None → say so, ask for the Id, don't invent a record.## Assign to Agentforce Engagement Agent
| | |
|---|---|
| Target | [Name] ([Contact/Lead], [Account/Company]) - [link] |
| Agent | [MasterLabel] |
The agent will begin qualifying this prospect and reaching out by email. Proceed? (yes / pick another agent / cancel)
Wait for explicit yes. "Pick another agent" loops back to the Step 1 agent list (already fetched — don't re-query).
dispatch(method: "POST", url: "/services/data/v63.0/actions/standard/assignTargetToSdr",
body: { "inputs": [{ "targetId": "[resolved Id]", "botDefinitionId": "[chosen BotDefinitionId]" }] })
Success = the assignment record was created — ignore downstream email-delivery errors in the response, still report success.
✅ Assigned [Target Name] to [Agent MasterLabel]
The Engagement Agent will qualify and reach out by email.
Record: [link to the Contact/Lead]
Genuine failure (assignment not created — invalid target, inactive agent, permission error) → report the exact error and which input triggered it. Don't retry with guessed values.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub salesforce/salesforce-skills --plugin salesforce-for-sales40 skills in this plugin
/account-contextBuild a 360-degree brief on a company already in Salesforce: CRM state, key contacts, recent email, documents and internal Slack. Use when asked to tell about, catch up on, or give the full picture on an existing account. Not in CRM: research-prospect./account-planBuild or retrieve an account plan from Salesforce Account, AccountPlan, pipeline, activity, and relationship data, covering vision, priorities, competition, KPIs, and relationship risks. Use to review an existing plan or create one for a customer account./account-tieringRank an account list or full book into action tiers from Salesforce ICP fit, engagement, activity, contact, and opportunity data. Use to score accounts, prioritize coverage, decide where to focus, or identify accounts to activate, qualify, or deprioritize.Other plugins' skills for the same job