Agentforce
Expose an Agentforce agent as an MCP tool
Connect an external assistant to an Agentforce agent through a custom MCP server. Check builder support, tool scope, authentication and failure behavior.
An external assistant may need a Salesforce workflow you have already built in Agentforce. Exposing that agent as an MCP tool can preserve the workflow instead of recreating its logic in another assistant.
Start with one bounded task and a clear return value. An external client, the MCP server and the Salesforce agent introduce separate places where identity, permissions or result handling can fail.
Check the supported agent before configuring the server
Salesforce’s Agentforce MCP tool documentation says agents exposed this way must use the new Agent Script Builder. Legacy agents need an upgrade first. In the custom server setup, select the agent backing type, choose the agent, set the tool name and description, and publish the server.
The same documentation distinguishes an agent-backed tool from a prompt-template-backed tool. Use an agent when the required task depends on its configured workflow and actions. A prompt template can be a narrower choice when the job is a bounded generation step.
Check availability and access in your org before promising a client that an existing agent can be exposed unchanged. Record the builder version and agent configuration you test.
Give the external assistant a precise tool contract
A name such as sales_agent says little about when the tool should run. A name such as prepare_account_brief identifies a task, but the description still needs to say what it reads and whether it writes anything.
For an initial read-only pilot, the contract might say: prepare an account brief from records the caller may access; return source references and missing information; do not update records or contact the customer. This is a suggested scope, not a claim about a standard Salesforce tool.
Keep the input small enough to validate. Reject unsupported object types or operations explicitly. If the tool accepts free text, treat that text as an untrusted task request rather than authority to change permissions or expand the workflow.
The external assistant also needs to distinguish a completed result from a refusal or an incomplete result. Include the relevant state in the tool output and test how the client presents it. Instructions help describe that contract, but permission and write controls belong in the underlying system.
Test the connection before testing model choices
Salesforce’s client connection guide describes direct tool testing with Postman. A direct call lets you inspect authentication and raw output separately from a model’s decision to select the tool.
Then test the intended assistant with the same operation. Confirm that it chooses the expected tool, sends the required inputs, and preserves refusals or incomplete results in its response. Test with a less-privileged identity as well as the integration owner’s account.
Avoid granting broad access simply to make the first demonstration work. A successful call under an administrator identity does not establish that the workflow is ready for its eventual users.
Expand only after the task boundary holds
Before adding a write action, define its approval step, retry behavior and operation reference. The action failure guide explains why a timeout may need reconciliation before another attempt.
Record these checks in the pilot worksheet: permitted request, denied request, missing input, unavailable dependency, repeated call and an attempted instruction override. Add observed results from your own environment; no executed integration benchmark is claimed here.
A useful first release has one named workflow, an identified caller and an output the receiving assistant can interpret. Add more tools after those boundaries are visible in the test evidence.