---
title: "AI Voice Agent + Salesforce Agentforce 2: Apex Tools and Headless 360"
description: "Salesforce TDX 2026 turned the entire platform into MCP tools and APIs. We unpack how AI voice agents now plug directly into Agentforce 2 via Apex Invocable actions and the Agent Builder API."
canonical: https://callsphere.ai/blog/vw2g-salesforce-agentforce-2-voice-integration
category: "Agentic AI"
tags: ["Salesforce", "Agentforce", "Apex", "MCP", "Voice Agents"]
author: "CallSphere Team"
published: 2026-03-15T00:00:00.000Z
updated: 2026-05-07T09:32:11.246Z
---

# AI Voice Agent + Salesforce Agentforce 2: Apex Tools and Headless 360

> Salesforce TDX 2026 turned the entire platform into MCP tools and APIs. We unpack how AI voice agents now plug directly into Agentforce 2 via Apex Invocable actions and the Agent Builder API.

> At TDX 2026 in April, Salesforce shipped "Headless 360" alongside Agentforce Vibes 2.0 — making every CRM action available as an API, MCP tool, or CLI command. For voice agent teams that means CallSphere can read pipeline, write opportunities, and create cases without ever booting a browser session.

## What the integration unlocks

```mermaid
flowchart LR
  User --> Triage["Triage / Supervisor"]
  Triage -->|tool A| A["Specialist A"]
  Triage -->|tool B| B["Specialist B"]
  Triage -->|tool C| C["Specialist C"]
  A --> Mem[(Shared memory · mem0/Letta)]
  B --> Mem
  C --> Mem
  Mem --> Final["Final response"]
```

CallSphere reference architecture

A CallSphere voice agent answering an inbound call can now do the work a sales-ops human used to do mid-conversation: pull the caller's account record, log the call as a Task, update the Opportunity stage, create a Lead, attach a recording URL, and trigger an Agentforce flow that emails the rep a summary — all before the call ends. That is a 4-6 minute manual workflow compressed into a 200ms tool round-trip.

## How the Salesforce API exposes it

Agentforce 2 ships three integration surfaces. First, **Custom Apex Actions** annotated with `@InvocableMethod` become callable agent actions with full access to governor limits, multi-object SOQL, and external callouts. Second, the **Agent Builder API** lets you create and configure agents programmatically through Apex or REST, ideal for templating one Agentforce per tenant. Third, **@salesforce/mcp** — the official MCP server shipped April 2026 — exposes Records, Apex, Flows, and Agent invocations to any external runtime over the Model Context Protocol.

Key endpoints CallSphere calls: `POST /services/data/v62.0/actions/custom/apex/` for Invocable methods, `POST /services/data/v62.0/sobjects/Lead` for fast lead creation, and `/services/data/v62.0/connect/agents//sessions` for delegating a turn to Agentforce when the voice agent decides escalation is warranted. OAuth scopes used: `api`, `refresh_token`, `agent_api`.

## How CallSphere implements it

CallSphere runs 37 specialist agents across 6 verticals with 90+ tools and 115+ DB tables. The Sales product (browser dialer plus CSV/Excel import) ships with a Salesforce connector that maps inbound calls to the matching Account by phone, opens an Activity record, and on a positive disposition writes the Opportunity. Real Estate OneRoof's 10 specialist agents push qualified leads into Salesforce custom objects with property, budget, and timeline fields. Healthcare's 14 tools (`lookup_patient`, `create_new_patient`, `get_available_slots`...) round-trip patient demographics through Salesforce Health Cloud where the customer's source of truth lives there.

Pricing starts at $149/mo Starter, $499 Growth, $1499 Scale, with a [14-day trial](/trial) and a [22% affiliate program](/affiliate).

## Build steps

1. Create a connected app in Salesforce Setup with OAuth scopes `api`, `refresh_token`, `agent_api`. Enable PKCE.
2. Author an Apex class with `@InvocableMethod(label='Log Voice Call')` accepting a `List` parameter.
3. In Agent Builder, add the Apex action and write a one-sentence description ("Log a CallSphere voice call to the matching Account; create one if no match.").
4. Mount the Salesforce MCP server in your CallSphere tenant config. Pass the OAuth refresh token through your secrets manager.
5. In the voice agent system prompt, reference the tool by its semantic name and include a 2-3 example transcript showing when to call it.
6. Subscribe to Salesforce Platform Events for `Opportunity_Stage_Changed__e` so the voice agent can be notified mid-call if a teammate moves the deal.
7. Validate end-to-end on a sandbox org first, then promote to production via Change Sets.

## Code snippet

```typescript
// Invoking a Salesforce Apex Invocable from CallSphere mid-call
const sfResponse = await fetch(
  `${instance}/services/data/v62.0/actions/custom/apex/LogVoiceCall`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${accessToken}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      inputs: [{
        accountPhone: caller.e164,
        callDurationSec: turn.elapsedMs / 1000,
        disposition: "qualified",
        recordingUrl: recording.s3Url,
        agentSummary: turn.summary,
      }],
    }),
  }
);
```

## FAQ

**Is the @salesforce/mcp server production-ready?** It is GA as of April 2026 with some toolsets still in Beta. We use the GA Records and Apex tools in production and gate Beta toolsets behind a feature flag.

**Do we still need Apex if MCP exists?** Yes for complex multi-object writes, governor-limit-bound logic, and anything calling external services. Use direct REST for simple reads and writes; use Apex when you need a transaction.

**How does this work with voice latency budgets?** A single Apex Invocable round-trip averages 180-260ms from CallSphere's us-east-1 to a us-east Salesforce instance. We parallelize reads and only block on writes that the user is waiting on.

**What about Health Cloud and Financial Services Cloud?** Same surface, different objects. CallSphere's [healthcare](/industries/healthcare) deployment writes to `Patient__c` and `HealthcareProvider__c` through Apex Invocables.

**How do I demo this?** Start a [14-day trial](/trial), pick the Sales product, mount the Salesforce MCP server, and run a test inbound call. Or [book a demo](/demo).

## Sources

- [Salesforce Agentforce Developer Guide](https://developer.salesforce.com/docs/ai/agentforce/guide/access-models-api-with-apex.html)
- [TDX 2026 Roundup: Agentforce](https://www.salesforce.com/blog/tdx-2026-roundup-agentforce-edition/)
- [Salesforce Headless 360 Announcement](https://www.apexhours.com/salesforce-headless-360-no-browser-required-the-entire-platform-is-now-an-api/)
- [Agentforce: The AI Agent Platform](https://www.salesforce.com/agentforce/)

---

Source: https://callsphere.ai/blog/vw2g-salesforce-agentforce-2-voice-integration
