Most Model Context Protocol (MCP) tool calls end when a tool running on an MCP server returns a JSON result and the large language model (LLM) in the AI assistant, such as Claude or Slackbot, summarizes it. This approach leaves it up to the model to decide what to emphasize and which details make it into the rendered output.
The Salesforce Headless Experience Layer (HXL) lets you decide how the output is presented to your end users by defining an interface once as a structured widget and rendering it natively in the AI assistants that support it. HXL currently supports Agentforce employee agents in Lightning Experience, ChatGPT, Claude, and Slackbot as beta channels, and it’s offered under the Beta Services Terms.
HXL is the part of the Headless Toolkit that brings interactive experiences to AI assistants. The Headless Toolkit is the set of MCP servers, skills, APIs, and developer tools that power AIforce, the strategy for bringing all your Salesforce context to the interface where you work.
When you can decide how the output is presented, you can choose what to emphasize and how to render it for each use case, even when the data comes from the same MCP server.
There are three ways to present the result of a Salesforce action to your users: let the AI assistant render it, ship an HXL widget, or build a Lightning web component for users who don’t work in an assistant. Ship an HXL widget when each value must appear in the same place every time the result is shown, and let the assistant render the result when the user only needs the answer. Build on a Lightning page when your users don’t work in an AI assistant.
Rule out HXL when your users don’t work in an AI assistant
If your users do their work on a Lightning record page or in a console app such as Service Console and do not ask an AI assistant for results, you don’t need HXL. Start with the standard page components, and build a Lightning web component only when they can’t show what the user needs. The same goes for an Experience Cloud site that doesn’t have an agent on it yet. If your users ask for results in Claude, ChatGPT, Slackbot, or an Agentforce employee agent in Lightning Experience, you have two options: let the assistant render a tool result or ship an HXL widget.
Choose HXL when every assistant must show the same result
Bringing the result to an AI assistant doesn’t mean you need a widget. Claude, ChatGPT, and the other assistants already render MCP tool results as text, lists, and tables. For exploratory questions, such as what’s going on with an account, that’s enough. The user wants an answer, and a summary that varies from run to run does no harm, so a widget would only add build and maintenance overhead.
Ship an HXL widget when the presentation itself matters: which fields appear and in what order, how they’re grouped and labeled, and which buttons the user gets. Left to itself, the assistant decides all of that, and it can decide differently on every run. A tighter output structure from the action only shapes the data the assistant gets back, so the assistant still chooses how to lay it out. A widget is rendered from its own definition instead, which is why only a widget fixes the component order, the grouping, and the buttons. A widget defines that structure once, so you can test it.
Approval requests are a good example. A sales manager approves discounts in Slackbot several times a day. If the assistant renders each request, the discount might lead one reply and sit halfway down the next, and the policy limit may not appear at all. A widget puts the requested discount next to the policy limit in the same place every time it renders, with Approve and Reject buttons that send the manager’s decision back to the assistant, which then calls the approval action, so the manager can decide without reading the whole reply.
Build widgets in the HXL Playground
Define your interface once as a widget. Preview how it renders in Agentforce, Slackbot, ChatGPT, and Claude.
Design once and ship to every assistant
The sales manager from the approval example is likely to use a common pairing: Agentforce in Lightning Experience and Slackbot. If, for example, they work in Salesforce in the morning and in Slack the rest of the day, the discount request should look the same in both. Without HXL, that’s two builds of the same card: a Lightning web component to render the Agentforce action output, and a Block Kit message for Slack. With HXL, one widget that both surfaces can render replaces both builds. You still wire it to external MCP channels via metadata, but the card itself is only built once.
The widget itself costs the same to build whether one assistant renders it or four, so the more assistants your users work in, the more it pays off.
Know what an HXL widget can and can’t show
HXL widgets are metadata-defined, not arbitrary React applications. A widget lives in your org and describes what the user sees: which HXL components appear, in what order, and which fields of an action’s output fill them. Each supported assistant renders those components natively.
You compose a widget in JSON from HXL’s 22 components, such as rows, tables, badges, links, callouts, and buttons, and the same definition deploys to Agentforce, Slackbot, ChatGPT, and Claude without changes. Each assistant renders it in its own native style, and a few component properties behave differently per surface. You can build and preview one with mock data in the HXL Playground, or have Agentforce Vibes generate it. Custom Lightning types connect the widget to your data by mapping the fields of an action’s structured output to the widget’s attributes: one Apex-based type for Agentforce, and two object-based types for MCP channels, one as the result wrapper and one as the payload.
To show the widget in an AI assistant, you attach it to the action that returns the data. In Agentforce, you select the custom Lightning type as the action’s output rendering. For Slackbot, ChatGPT, and Claude, you add the action as a tool on a custom MCP server in your org, attach the widget to that tool, and connect each assistant to the server, which you set up once for all three. That route currently works only for invocable actions, so build the approval request as an Apex invocable action from the start.
This will not be the right path for every approval use case. If the manager wants to compare the request against a chart of past discounts on the account, a widget can’t draw one, because none of the 22 components in the beta reference is a chart. Let the assistant render that result instead, since Claude and ChatGPT can draw a chart from a tool result when the user asks for one. If the manager only works in Agentforce in Lightning Experience, a Lightning web component on the same custom Lightning type can draw it.
If the manager wants to drag the discount and watch the margin recalculate before approving, that’s modeling work, and it belongs on the Opportunity record page in Lightning Experience rather than in a conversation with an AI assistant.
Choose by where your users work and what they need to see
If your users work on a Lightning record page or an Experience Cloud site without an agent, build with Lightning web components and leave HXL out. If they work in an AI assistant, let the assistant render the result when they only need the answer, including when they ask for a chart. Ship an HXL widget when it matters where each value appears and what it sits next to, because the model can put it somewhere else on the next run. You build it once, and every supported assistant renders it.
Where to go from here
- Read Headless Doesn’t Mean Ungoverned: How Trust Works When Agents Call Salesforce for the full trust model when agents call Salesforce from outside.
- Read Salesforce Headless 360: What the Agent Consumer Means for Your Integration Architecture for how agents as API and MCP consumers change your integration architecture.
- Read Building Interactive UI with Headless Experience Layer on the Salesforce Developers blog for a worked build, from the Apex action to the MCP server.
- Read the Headless Experience Layer Developer Guide to build, connect, and deploy your first widget.












