{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["img","admonition"]},"redocly_category":"AI","product_name":"Headless","type":"markdown"},"seo":{"title":"Connecting Salesforce Agentforce to Treasure AI Studio","description":"Connect Salesforce Agentforce to Treasure AI Studio via a static-token MCP endpoint, then build an Employee Agent that runs Studio Actions and chats.","siteUrl":"https://docs.treasure.ai","image":"/assets/treasure-ai-social-preview.e6fefb35676f6da91c2d1bc783bd39e618e7af2b1ad3aa52a96ae69d72e700fe.b1bff462.png","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"connecting-salesforce-agentforce-to-treasure-ai-studio","__idx":0},"children":["Connecting Salesforce Agentforce to Treasure AI Studio"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can connect Salesforce Agentforce to ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/"},"children":["Treasure AI Studio"]}," by registering a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Static token · shared executor"]}," MCP endpoint in Salesforce Agentforce Registry and attaching its six tools to an Agentforce Employee Agent. Marketing and business users can then query customer data, inspect audiences, and run saved Studio Actions directly from the Salesforce Lightning panel—without leaving Salesforce, installing a Marketing Cloud package, or running a local ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tdx mcp"]}," process."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this guide when your teams work in Salesforce Lightning and need Treasure AI Studio results inside Agentforce. Because this integration uses a static-token MCP endpoint stored in a Salesforce Custom External Credential rather than per-user OAuth, every Salesforce user who can reach the agent runs as the endpoint's single shared executor, using that executor's shared work folder, permissions, and credits."]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-architecture.7067bde648880615db213df160354419813bb53242b80132b077a62977b6d3b2.5866d770.webp","alt":"Architecture diagram showing a marketing user submitting a customer data question in Salesforce Lightning to an Agentforce Employee Agent, which delegates to a CDP subagent that calls a Treasure AI Studio static-token MCP endpoint over Streamable HTTP with an Authorization Bearer header, runs list_work_folders, list_actions, run_action, or start_chat, and summarizes the tool result back in the Lightning chat panel","framed":false,"withLightbox":true,"width":"800px"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-the-connection-is-set-up","__idx":1},"children":["How the Connection Is Set Up"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Salesforce acts as the MCP client, and Treasure AI Studio hosts the remote MCP server over Streamable HTTP. Three roles participate across two platforms."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"28%","data-label":"Role"},"children":["Role "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"32%","data-label":"Where"},"children":["Where "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"40%","data-label":"What They Do"},"children":["What They Do "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Studio shared work folder manager"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Treasure AI Studio, under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings → Agent Channels"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Publishes an approved shared work folder, creates one ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Static token · shared executor"]}," MCP endpoint, and copies its Connection URL and raw Bearer token"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Salesforce administrator"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Salesforce Lightning ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agentforce Builder"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Stores the token in a Custom External Credential, registers the MCP server, allowlists tools, assigns the MCP permission set, builds and activates an Employee Agent, and grants agent access"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Salesforce end users"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Salesforce Lightning (for example, the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sales"]}," app)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Open the Agentforce panel, select the Employee Agent, and send requests that invoke Treasure AI Studio tools"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When Salesforce connects to the registered endpoint, Agentforce Registry discovers the six standard Treasure AI Studio MCP tools. For detailed tool descriptions, arguments, and response behavior, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/mcp-clients#the-tools"},"children":["The Tools"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"28%","data-label":"Tool Group"},"children":["Tool Group "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"72%","data-label":"Tools"},"children":["Tools "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Read-only"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list_work_folders"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list_actions"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_chat_result"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Write / execution"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run_action"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["start_chat"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continue_chat"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["What those tools can access depends on the shared work folder, saved Actions, integrations, executor permissions, and credits configured in Treasure AI Studio."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prerequisites","__idx":2},"children":["Prerequisites"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Salesforce Lightning with Agentforce"]},": An approved Salesforce Lightning org with ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agentforce Registry"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Employee Agent Builder"]}," enabled, plus a Salesforce administrator who can create External Credentials, register external MCP servers, build and activate agents, and manage permission set assignments."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Studio shared work folder"]},": An approved ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/shared-folders/"},"children":["shared work folder"]}," that contains only the Actions and files acceptable for Salesforce users to reach, where you hold the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Manage"]}," work mode."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Static-token MCP endpoint permission"]},": Permission under the Treasure AI Studio account's creation policy (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings → Agent Channels"]},") to create static-token MCP endpoints. If the creation policy is set to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Account admins only"]}," and you are not an account administrator, ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New MCP Endpoint"]}," is disabled."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Do not copy org-specific IDs across environments"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every Salesforce org generates its own Asset Library action IDs, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["target"]}," identifiers, and permission set names, and every Treasure AI Studio endpoint has its own Connection URL, token, and folder IDs. Register the MCP server and attach the six tools from your own org's Asset Library rather than copying generated IDs from the reference script below."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-create-a-static-token-mcp-endpoint-in-studio","__idx":3},"children":["Step 1: Create a Static-Token MCP Endpoint in Studio"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A static-token MCP endpoint publishes one shared work folder and runs every call as the endpoint's executor. If you have not yet created or published a shared work folder, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/shared-folders/sharing-a-work-folder"},"children":["Sharing a Work Folder"]},". For full endpoint management details, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/mcp-endpoints"},"children":["Static-Token MCP Endpoints"]},"."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In Treasure AI Studio on Web or Desktop, open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings → Agent Channels"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MCP Endpoints"]},", select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New MCP Endpoint"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection method"]},", keep ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Static token · shared executor"]}," selected, enter an ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Endpoint name"]}," (for example, ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Salesforce Agentforce MCP"]},"), and optionally add a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Comment"]},". Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose the approved ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Shared work folder"]}," you manage, review the consent details showing you as the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Executor"]},", and select a token ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expiration"]}," (7, 30, or 90 days, a custom date, or no expiration)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create endpoint & issue first token"]},". The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connect your MCP client"]}," completion screen opens with two values:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection URL"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://<your account's Agent Gateway>/v1/mcp/<endpoint ID>"]}," (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://agent-gateway.us01.treasure.ai/v1/mcp/<endpoint ID>"]}," on US01)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication header"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: Bearer tasgwt_<secret>"]},"."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Copy both values into a password manager or secret store immediately. Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["I have stored the values"]},", then select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},". The endpoint overview opens with status ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Active"]},"."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"danger","name":"Store the token before leaving the completion screen"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tasgwt_"]}," token is displayed only once and cannot be recovered. If you lose it, revoke the token and issue a new one from the endpoint's detail page."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-configure-the-custom-external-credential-in-salesforce","__idx":4},"children":["Step 2: Configure the Custom External Credential in Salesforce"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Salesforce stores the Treasure AI Studio static token inside a Custom External Credential and injects the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization: Bearer"]}," header automatically through a custom header formula."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In Salesforce Lightning, select the gear icon in the upper-right corner and choose ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}," (not ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Cloud Setup"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In the left ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Quick Find"]}," box, enter ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Agentforce"]},". Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Einstein → Agentforce Registry"]},", select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Registered MCP Servers"]}," (not ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Registered APIs"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agentforce Registry"]}," page, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New → Register MCP Server"]},". Do not select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add Salesforce Server"]},", because Treasure AI hosts this server."]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-register-menu.6e3cca8bf8b93b9c9413a17abbae31e22352b822b0326ea53e5611feef890a91.5866d770.webp","alt":"Salesforce Setup showing Einstein, Agentforce Registry, Registered MCP Servers selected in the sidebar, and the New menu open with Register MCP Server highlighted","framed":false,"withLightbox":true,"width":"640px"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Connection"]},", change ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication Method"]}," to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use External Credential"]},", then select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New External Credential"]},". If Salesforce opens the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Named Credentials"]}," tab, switch to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["External Credentials"]}," tab and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]}," (you do not need to fill out a separate Named Credential form for this workflow)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create the External Credential with these values, then select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},":",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Label"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Treasure AI MCP"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Name"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Treasure_AI_MCP"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication Protocol"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Custom"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the saved ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI MCP"]}," External Credential record by selecting its label. If the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Related Named Credentials"]}," section is empty, continue to the next step."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Principals"]},", select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]},", configure the named principal as follows, and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},":",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Parameter Name"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureMCPPrincipal"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sequence Number"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Identity Type"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Named Principal"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication Parameters"]},": Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add"]},", set ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Name"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BearerToken"]},", and for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Value"]}," paste only the raw token starting with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tasgwt_"]}," from Step 1. Do not include ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization:"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Bearer"]},", quotes, or surrounding spaces—the custom header formula in the next step adds the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Bearer "]}," prefix."]}]}]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-edit-principal.3f0a3ea3bd3715771a08e6cc75f3f7c400ea155c84f8986c6f0badbc2aa02bc3.5866d770.webp","alt":"Edit Principal dialog in Salesforce showing Parameter Name TreasureMCPPrincipal, Sequence Number 1, Identity Type Named Principal, and Authentication Parameter BearerToken with a masked Value","framed":false,"withLightbox":true,"width":"480px"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":8},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Custom Headers"]},", select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New"]},", enter these values, and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},":",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Name"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Value"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{!'Bearer ' & $Credential.Treasure_AI_MCP.BearerToken}"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sequence Number"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}]}]}]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-edit-header.c8775a8e7cfb0267a994043f439dc3b6e083a9e47bdb456a4a186f447a70d226.5866d770.webp","alt":"Edit Custom Header dialog in Salesforce with Name set to Authorization, Value set to {!'Bearer ' & $Credential.Treasure_AI_MCP.BearerToken}, and Sequence Number set to 1","framed":false,"withLightbox":true,"width":"480px"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":9},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Confirm on the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI MCP"]}," detail page that one named principal (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureMCPPrincipal"]},") and one custom header (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorization"]},") are listed before returning to the registry. A masked parameter value is expected."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-register-the-mcp-server-and-allowlist-tools","__idx":5},"children":["Step 3: Register the MCP Server and Allowlist Tools"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["With the External Credential saved, register the Treasure AI Studio MCP endpoint in Agentforce Registry and select which tools Salesforce agents can call."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Return to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Connection"]}," dialog under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agentforce Registry → Registered MCP Servers"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Enter ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MCP Server Name"]}," as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP"]}," (letters and numbers only) and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Description"]}," as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Treasure AI MCP"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Server URL"]},", paste the full ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection URL"]}," from Step 1 (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://<your account's Agent Gateway>/v1/mcp/<endpoint ID>"]},"). Do not append the token or paste the Authentication header here."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Keep ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Authentication Method"]}," set to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Use External Credential"]},", select the refresh icon next to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New External Credential"]},", and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI MCP"]}," (type ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Custom"]},")."]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-create-connection.db7a51cf0327c0cbdd93216f7fea26d744bdf1f02070c4e6a8e09589f2dc2c04.5866d770.webp","alt":"Create Connection dialog in Salesforce with MCP Server Name TreasureAIMCP, Description Treasure AI MCP, a partially masked US01 Agent Gateway Server URL, Authentication Method set to Use External Credential, and Treasure AI MCP selected with Create and Continue enabled","framed":false,"withLightbox":true,"width":"560px"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create and Continue"]},". Salesforce validates the connection and discovers the six Treasure AI Studio tools."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MCP Server Allowlist"]},", select the tools your agents can use, then select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Allow and Continue"]},".",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For the full Employee Agent in Step 5, select all six tools: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list_work_folders"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list_actions"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["get_chat_result"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run_action"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["start_chat"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continue_chat"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For a discovery-only pilot, allowlist only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list_work_folders"]}," and add the remaining tools when you are ready to build the full agent."]}]}]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-allowlist-tools.6b2e6b7cf6292610f90a54d2ab38740ba1845fe2ad616a30c4ed99d0cfc8c799.5866d770.webp","alt":"MCP Server Allowlist screen in Salesforce showing Risk Assessment Low and all six TreasureAIMCP tools selected: run_action, list_actions, get_chat_result, start_chat, list_work_folders, and continue_chat","framed":false,"withLightbox":true,"width":"600px"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"What the registration Risk Assessment means"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The registration scan reports ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Risk Assessment: Low"]},". That score describes the registration scan, not a guarantee that every allowlisted tool is read-only—",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run_action"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["start_chat"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["continue_chat"]}," execute tasks in Treasure AI Studio."]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":7},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Grant Access to Users"]},", review the generated permission set (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP_Perm_Set"]},"), assign it only to users who need access, and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Apply Policies"]},", apply any policies required by your org, then select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Registered MCP Servers"]}," and verify that the saved ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP"]}," row shows ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type: Manual"]},", ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["6"]}," tools, ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection Status: Active"]},", and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection Health: Connected"]},"."]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-registry-connected.822c0a9f52721eb4289c9a0712539c590a4271294af9749c0349ba7d42afd8d7.5866d770.webp","alt":"Salesforce Agentforce Registry Registrations table showing TreasureAIMCP with Type Manual, 6 tools, Connection Status Active, Connection Health Connected, and Risk Score Low","framed":false,"withLightbox":true,"width":"720px"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-4-assign-the-mcp-permission-set","__idx":6},"children":["Step 4: Assign the MCP Permission Set"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Salesforce separates ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MCP tool access"]}," (permission to call Treasure AI Studio through the named credential) from ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["agent access"]}," (visibility of the Employee Agent in Salesforce Lightning, configured in Step 7). Every intended end user needs both. Do not assign the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["System Administrator"]}," profile just to grant agent or tool access."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup → Agentforce Registry → Registered MCP Servers → TreasureAIMCP → Details"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Permissions"]},", select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Named Credential Permission Set"]}," link generated for your server (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP_Perm_Set"]},"). Use the link from your registered server rather than a similarly named agent permission set."]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-server-details-permissions.979023fea93d49fa5f2933a6a5c4754ba0a2f72331d1ddc0ff72ee4dfe51f6b0.5866d770.webp","alt":"TreasureAIMCP server Details page in Salesforce showing Connection Status Active, Connection Health Connected, Authentication Method External Credential, an orange Permissions notice, and the Named Credential Permission Set link TreasureAIMCP_Perm_Set","framed":false,"withLightbox":true,"width":"680px"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["On the permission set overview page, confirm the API name and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Manage Assignments"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Current Assignments"]},". If the intended user is already listed, no duplicate assignment is needed; otherwise, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add Assignment"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search for each intended user's Salesforce username, select only those rows, and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Next"]},". Do not select the entire user list or unrelated integration accounts."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Choose an expiration option appropriate for your rollout (use a time-limited assignment for pilots), review the selected users, and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Assign"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Confirm ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Status: Success"]}," on ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Assignment Summary"]},", select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Done"]},", and verify that the user appears under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Current Assignments"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-5-build-the-employee-agent-in-agentforce-builder","__idx":7},"children":["Step 5: Build the Employee Agent in Agentforce Builder"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create an ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Employee Agent"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AgentforceEmployeeAgent"]},") so internal Salesforce users can open it from the Lightning header panel. A Service Agent can reach the MCP server in Preview, but it does not appear in the Lightning Sales panel."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Verify AgentforceEmployeeAgent before first publication"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check that the draft specifies ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["agent_type: \"AgentforceEmployeeAgent\""]}," before you publish it for the first time. Salesforce can reject changing the agent type on an already published agent. If you publish a Service Agent by mistake, create a new Employee Agent and reuse your registered MCP tools—you do not need to replace the Treasure AI Studio endpoint or token."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"describe-the-agent-and-review-the-optimizer-proposal","__idx":8},"children":["Describe the Agent and Review the Optimizer Proposal"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the Agentforce Builder using one of these entry points (not both):",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup → Agentforce Agents → New Agent"]}," (if an introductory dialog appears, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Create Agent"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["App Launcher → Agentforce Studio → Agents → New Agent"]},"."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Paste this description into the Builder prompt box and submit it:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Create an internal employee agent for marketing users that answers questions about Treasure Data CDP, our customer data platform. That data is not in Salesforce, so never answer these questions from Salesforce Knowledge or general knowledge. Don't add or configure any actions; I'll add the TreasureAIMCP actions from the Asset Library myself.\n\nCreate one subagent called \"Treasure AI Studio\" that follows this:\n1. Call list_work_folders to get the work folder ID. Never ask the user for it.\n2. Call list_actions for that folder and find the saved Action that best matches the request. If one matches, run it with run_action.\n3. If no Action fits, use start_chat with a clear, self-contained task describing exactly what the user asked for. Use continue_chat for follow-ups on the same result, and get_chat_result if a result is still running.\n4. Summarize the result in plain language with the key numbers, and say which Action or chat produced it. If a tool returns an error or no result, say so. Never guess.\n\nConfirmation: before any request that sends emails or notifications, activates or exports an audience, runs or resumes a workflow or journey, or creates, changes, or deletes anything in Treasure AI, first tell the user exactly what will happen and ask them to confirm. Only proceed after they say yes. Reading, listing, querying, and reporting need no confirmation.\n\nIf a request isn't about Treasure AI, explain what this agent can help with.\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Name your agent"]},", enter ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Agent"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Treasure_AI_Agent"]},"), follow the user assignment options for your org, and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Let's Go"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Review Agent Optimizer's proposed structure before approving it. Verify that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["developer_name"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Treasure_AI_Agent"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["agent_label"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Treasure AI Agent"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["agent_type"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AgentforceEmployeeAgent"]},", and no messaging-only variables (such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EndUserId"]},") were added. If Optimizer renamed the agent or added messaging variables, reply with a correction before proceeding:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"Proceed, with two changes: keep developer_name Treasure_AI_Agent and agent_label Treasure AI Agent, and remove the EndUserId variable because this isn't a messaging agent.\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":5},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When Optimizer finishes generating changes (removing default subagents and adding the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Studio"]}," subagent), review the changes, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Accept All"]},", and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"attach-the-registered-mcp-actions-and-verify-inputs","__idx":9},"children":["Attach the Registered MCP Actions and Verify Inputs"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Explorer"]},", hover over the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Studio"]}," subagent and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["+ → Add from Asset Library"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP"]},", select all six registered actions (or any not yet attached), and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Add to Agent"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Actions Available For Reasoning"]},", select the matching local action for each operation. Do not create duplicate actions. Verify in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Explorer"]}," that all six ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP"]}," actions appear under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Studio"]},"."]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-builder-linked-tools.f067db6a677342ce56b4617faf1977fc81daf39f7dcfa8415e1715875a030b03.5866d770.webp","alt":"Agentforce Builder Explorer showing the Treasure AI Studio subagent with all six TreasureAIMCP actions attached: list_work_folders, list_actions, run_action, start_chat, continue_chat, and get_chat_result","framed":false,"withLightbox":true,"width":"440px"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Script view"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["</>"]},") and compare your subagent bindings against the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#reference-agent-script"},"children":["Reference Agent Script"]},". Confirm that reasoning-action input lines use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["..."]}," so the agent supplies ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["work_folder_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["action_name"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["chat_id"]}," dynamically from tool results and conversation context, and that the instructions reference your org's local Asset Library action IDs."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]}," and confirm ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Problems"]}," shows ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["0 errors"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-6-test-the-agent-in-preview","__idx":10},"children":["Step 6: Test the Agent in Preview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify live MCP tool execution in Agentforce Builder Preview before activating the agent."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Preview"]},", select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["↻"]}," to start a fresh test session."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ask a read-only discovery question, such as ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["\"List the saved actions in my work folder.\""]}," Confirm in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agent Preview Details"]}," trace that Salesforce executed ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list_work_folders"]}," followed by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["list_actions"]}," with the returned ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["work_folder_id"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ask a question that requires querying customer data, such as ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["\"List the first 3 parent segments.\""]}," If your shared work folder has a matching saved Action, expect ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["run_action"]},"; if no saved Action fits, expect ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["start_chat"]}," rather than an unrelated saved Action."]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-preview-trace.52d09555b2a50ab07f94509efc321183bf6e1ce8f4f522c57de753d32f91e656.5866d770.webp","alt":"Agentforce Builder Preview showing a live test conversation listing saved actions and parent segments alongside the Agent Preview Details trace with successful MCP RPC initialize, tools/list, and tools/call steps","framed":false,"withLightbox":true,"width":"760px"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A plausible answer or a green ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tools/list"]}," call alone does not verify execution. Inspect the trace for actual ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MCP RPC tools/call"]}," steps and confirm the results match your own Treasure AI Studio work folder."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-7-activate-the-employee-agent-and-enable-user-access","__idx":11},"children":["Step 7: Activate the Employee Agent and Enable User Access"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Committing freezes an agent version for testing; activating makes it available to connected Salesforce Lightning channels."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["After confirming ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["agent_type: \"AgentforceEmployeeAgent\""]}," and verifying Preview, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Commit Version → Commit"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Activate → Activate"]}," to publish the committed version to connected channels."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup → Agentforce Agents"]}," and confirm that ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Agent"]}," shows ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Type: AgentforceEmployeeAgent"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Active"]}," checkmarks for both the agent and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Version 1"]},"."]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-active-agent.3a2996efbc7773f93346a2986ee806eb4dece22119a93bf177c10edb99c9a6b9.5866d770.webp","alt":"Salesforce Setup Agentforce Agents table showing Treasure AI Agent with Type AgentforceEmployeeAgent and Active checkmarks on both the agent and Version 1, with the Created By name hidden","framed":false,"withLightbox":true,"width":"760px"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":4},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Grant agent visibility to the intended Salesforce users. For production rollouts, grant ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled Agent Access"]}," through a dedicated permission set scoped to the intended users (do not grant ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["System Administrator"]}," to employees solely to expose the agent). To grant access on a permission set or profile:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the permission set or profile in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup → Users"]},", select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled Agent Access"]},", and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Edit"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Move ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Agent"]}," from ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Available Agents"]}," to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled Agents"]},", then select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Save"]},"."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Confirm that every intended user has both ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled Agent Access"]}," for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Agent"]}," and the MCP permission set (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP_Perm_Set"]},") from Step 4."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-8-use-the-agent-from-salesforce-lightning","__idx":12},"children":["Step 8: Use the Agent from Salesforce Lightning"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify the activated agent outside Agentforce Builder using the Salesforce Lightning interface."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["App Launcher"]}," (nine dots), search for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sales"]},", and select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Sales"]}," app (not ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In the top header, select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agentforce"]}," icon to open the right-hand panel. If prompted about ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Agentforce Memory"]}," on first use, choose your preference and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Got It"]},"; saving memories is not required for MCP."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["In the Agentforce panel, select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Agent"]}," from the agent dropdown if it is not already selected."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Send a read-only discovery prompt, such as ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["\"List the Treasure AI Studio work folder name and its saved actions,\""]}," followed by a query such as ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["\"Show me 10 parent segments.\""]}," Confirm that the panel returns data from your Treasure AI Studio shared work folder and identifies whether a saved Action or free-text chat produced the result."]}]},{"$$mdtype":"Tag","name":"Image","attributes":{"src":"/assets/salesforce-agentforce-live-result.8852427242238ede8ddcbb5eb3c2f31c13a1f86412095834a3614e616bafe2f5.5866d770.webp","alt":"Salesforce Lightning Agentforce panel showing Treasure AI Agent listing a Treasure AI Studio folder and its saved action, then returning ten parent segments with member counts from a free-text CDP query","framed":false,"withLightbox":true,"width":"440px"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For non-admin rollouts, repeat this verification while signed in as an intended non-admin user to confirm both agent visibility and MCP permission set access."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-runs-in-studio-and-security-controls","__idx":13},"children":["What Runs in Studio and Security Controls"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every request from Salesforce Agentforce runs in Treasure AI Studio as the static-token endpoint's single shared executor, using that executor's permissions and credits. Studio reads the published shared work folder read-only and writes only to a temporary work area that is discarded when each chat ends—see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/channel-chats"},"children":["What an Agent Channel Chat Can Reach"]}," for what channel chats can and cannot affect."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Apply these security controls before rolling the agent out beyond a pilot:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Scope the shared work folder and executor"]},": Include only the saved Actions, files, and connectors acceptable for Salesforce users to invoke. Every Salesforce user who can access the agent inherits the executor's Treasure AI permissions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treat instruction-level confirmation as defense in depth"]},": The prompt and reference script instruct the agent to ask for user confirmation before sending notifications, activating or exporting audiences, running workflows or journeys, or modifying data. Because the registered MCP action definitions set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["require_user_confirmation: False"]},", enforce real boundaries through the executor's permissions, the shared work folder's contents, and the allowlisted tools."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Protect and rotate the static token"]},": Keep the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tasgwt_"]}," token only in the Salesforce External Credential principal. Never paste it into the Server URL, agent prompt, Agent Script, or screenshots. Rotate the token when access changes, when a pilot ends, or if exposure is suspected—see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/tokens#rotating-a-gateway-token"},"children":["Rotating a Gateway Token"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Restrict Salesforce assignments"]},": Grant ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP_Perm_Set"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled Agent Access"]}," only to approved users, with time-limited assignments for pilots."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"stop-the-connection","__idx":14},"children":["Stop the Connection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can stop access immediately on either the Treasure AI Studio side or the Salesforce side."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Stop all Salesforce requests immediately (Studio)"]},": Open the endpoint under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings → Agent Channels"]}," and turn off the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled"]}," switch. Requests fail immediately without revoking tokens. To invalidate the credential permanently, revoke the token or delete the endpoint."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Stop one Salesforce user (Salesforce)"]},": Remove the user from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP_Perm_Set"]}," (blocks MCP tool calls) and/or remove their ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled Agent Access"]}," for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Agent"]}," (hides the agent in Lightning)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Stop the agent for all Salesforce users (Salesforce)"]},": Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Treasure AI Agent"]}," in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup → Agentforce Agents"]}," and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Deactivate"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"reference-agent-script","__idx":15},"children":["Reference Agent Script"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this verified Employee Agent script as a structural reference in Agentforce Builder ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Script view"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["</>"]},"). Do not copy it verbatim into another org: replace the org-generated action IDs (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["a4c7ec..."]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["a95d21..."]},", etc.), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["source"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["target"]}," identifiers, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["model_config"]}," values with the ones generated when you attach the six ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP"]}," actions from your own Asset Library."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"system:\n    instructions: \"You are a Treasure AI CDP assistant for marketing users. All answers must come directly from Treasure AI tools — never use Salesforce Knowledge or general knowledge to answer questions.\"\n    messages:\n        welcome: |\n            Hi, I'm your Treasure AI assistant. I can help you explore audiences, run analyses, and work with your customer data in Treasure AI CDP. What would you like to know?\n        error: \"Sorry, something went wrong. Please try again.\"\n\nconfig:\n    developer_name: \"Treasure_AI_Agent\"\n    agent_label: \"Treasure AI Agent\"\n    description: \"Internal marketing agent that answers questions and runs analyses using Treasure AI CDP. Never uses Salesforce Knowledge or general knowledge.\"\n    agent_type: \"AgentforceEmployeeAgent\"\n\nmodel_config:\n    model: \"model://sfdc_ai__DefaultGPT56Luna\"\n\nlanguage:\n    default_locale: \"en_US\"\n    all_additional_locales: False\n\nvariables:\n    work_folder_id: mutable string = \"\"\n        description: \"Cached work folder ID retrieved from Treasure AI Studio; avoids re-fetching on every turn\"\n    chat_id: mutable string = \"\"\n        description: \"ID of the active Treasure AI chat session, used for continue_chat and get_chat_result\"\n\nknowledge:\n    rag_feature_config_id: \"\"\n    citations_url: \"\"\n    citations_enabled: False\n\nstart_agent agent_router:\n    label: \"Agent Router\"\n    description: \"Welcome the user and route all requests to the Treasure AI Studio subagent\"\n    model_config:\n        model: \"model://sfdc_ai__DefaultEinsteinHyperClassifier\"\n    reasoning:\n        instructions: ->\n            | Select the best tool to call based on conversation history and user's intent.\n        actions:\n            go_to_treasure_ai_studio: @utils.transition to @subagent.treasure_ai_studio\n\n\nsubagent treasure_ai_studio:\n    label: \"Treasure AI Studio\"\n    description: \"Handles all Treasure AI CDP questions by discovering work folders and saved Actions, running the best match, falling back to free-text chat, and summarizing results in plain language.\"\n    reasoning:\n        instructions: ->\n            |You are connected to Treasure AI CDP. All answers must come directly from Treasure AI tools — never use Salesforce Knowledge or general knowledge.\n\n             If the request is not about Treasure AI CDP, politely explain that this agent can help with Treasure AI CDP questions, analyses, audience management, and data workflows, and do not attempt to answer it.\n\n             Confirmation gate: Before taking any of the following actions, tell the user exactly what will happen and ask them to confirm. Only proceed after they say yes.\n             - Sending emails or notifications\n             - Activating or exporting an audience\n             - Running or resuming a workflow or journey\n             - Creating, changing, or deleting anything in Treasure AI\n             Reading, listing, querying, and reporting need no confirmation.\n\n             Workflow:\n             Step 1 — Get the work folder: Call {!@actions.a4c7ec23334353fc7a73dd098254ca6eb} to get the work folder ID, and reuse it for the rest of the conversation. Never ask the user for it.\n             Step 2 — List available Actions: Call {!@actions.a95d21b38c6273c2c8d8c2f508296fe9f} for the work folder and inspect action names and descriptions to find the one that best matches the user's request.\n             Step 3 — Run a saved Action: If a matching saved Action is found, call {!@actions.a957880df5db732a393e6b85fde2af16b} with the exact action name and the work folder ID.\n             Step 4 — Fall back to free-text chat: If no saved Action fits, call {!@actions.a87dd54c253ef3974bd5e07eafeff72eb} with the work folder ID and a clear, self-contained description of exactly what the user asked for. Keep the chat_id it returns. For follow-ups on the same result, call {!@actions.aed3e4d64a89532f4b0943e4a226247fe} with that chat_id. If the status is \"running\", call {!@actions.a1466fa95345b3dce8621350804423a33} with that chat_id to get the final result.\n             Step 5 — Summarize: Present the result in plain language, highlighting key numbers. Say which Action or chat produced it. If a tool returns an error or no result, say so clearly. Never guess or fabricate results.\n        actions:\n            a95d21b38c6273c2c8d8c2f508296fe9f: @actions.a95d21b38c6273c2c8d8c2f508296fe9f\n                with work_folder_id = ...\n            a957880df5db732a393e6b85fde2af16b: @actions.a957880df5db732a393e6b85fde2af16b\n                with work_folder_id = ...\n                with action_name = ...\n            a87dd54c253ef3974bd5e07eafeff72eb: @actions.a87dd54c253ef3974bd5e07eafeff72eb\n                with work_folder_id = ...\n                with message = ...\n            aed3e4d64a89532f4b0943e4a226247fe: @actions.aed3e4d64a89532f4b0943e4a226247fe\n                with chat_id = ...\n                with message = ...\n            a1466fa95345b3dce8621350804423a33: @actions.a1466fa95345b3dce8621350804423a33\n                with chat_id = ...\n            a4c7ec23334353fc7a73dd098254ca6eb: @actions.a4c7ec23334353fc7a73dd098254ca6eb\n    actions:\n        a1466fa95345b3dce8621350804423a33:\n            description: |\n                Retrieves the result of the latest instruction in a chat, including follow-ups sent with continue_chat. Does not submit a new instruction. If execution is still in progress, waits for the result and may return status \"running\" again.\n            label: \"get_chat_result - TreasureAIMCP\"\n            require_user_confirmation: False\n            include_in_progress_indicator: False\n            source: \"a1466fa95345b3dce8621350804423a33\"\n            target: \"mcpTool://TreasureAIMCP/mcptoolx5fx5fgetx5fchatx5fresult\"\n\n            inputs:\n                \"chat_id\": string\n                    description: |\n                      The chat_id returned by run_action or start_chat through this connection.\n                    label: \"string\"\n                    is_required: True\n                    is_user_input: False\n        a4c7ec23334353fc7a73dd098254ca6eb:\n            description: |\n                Lists the work folders available in Treasure AI Studio. Start here to find configured actions for the user's task. Tasks may involve Treasure Data or other connected services. Inspect available capabilities before giving generic advice or asking about unfamiliar project or business names. A work folder is a persistent server-side workspace with files and reusable actions; its purpose depends on its configuration. Use folder names and any author-provided descriptions to select candidates, then call list_actions with each candidate's id to inspect the available tasks.\n            label: \"list_work_folders - TreasureAIMCP\"\n            require_user_confirmation: False\n            include_in_progress_indicator: False\n            source: \"a4c7ec23334353fc7a73dd098254ca6eb\"\n            target: \"mcpTool://TreasureAIMCP/mcptoolx5fx5flistx5fworkx5ffolders\"\n        a87dd54c253ef3974bd5e07eafeff72eb:\n            description: |\n                Delegates the free-text task in message to a server-side agent in a new chat. Check list_actions in relevant work folders first. Use start_chat only when no available action can perform the task. The agent can read work folder files and use configured connectors. Waits for the result and returns status \"running\" if execution is still in progress.\n            label: \"start_chat - TreasureAIMCP\"\n            require_user_confirmation: False\n            include_in_progress_indicator: False\n            source: \"a87dd54c253ef3974bd5e07eafeff72eb\"\n            target: \"mcpTool://TreasureAIMCP/mcptoolx5fx5fstartx5fchat\"\n\n            inputs:\n                \"work_folder_id\": string\n                    description: |\n                      The folder id returned by list_work_folders.\n                    label: \"string\"\n                    is_required: True\n                    is_user_input: False\n                \"message\": object\n                    description: |\n                      The task to delegate, including necessary context and the expected result. The agent does not see your conversation.\n                    label: \"string\"\n                    is_required: True\n                    is_user_input: False\n                    complex_data_type_name: \"lightning__richTextType\"\n        a957880df5db732a393e6b85fde2af16b:\n            description: |\n                Delegates an action selected from list_actions to a server-side agent in a new chat. The agent follows the action's configured instructions and can read work folder files and use configured connectors. Each call starts a separate execution. This tool accepts no action arguments or additional instructions, and the agent does not see your conversation. Waits for the result and returns status \"running\" if execution is still in progress.\n            label: \"run_action - TreasureAIMCP\"\n            require_user_confirmation: False\n            include_in_progress_indicator: False\n            source: \"a957880df5db732a393e6b85fde2af16b\"\n            target: \"mcpTool://TreasureAIMCP/mcptoolx5fx5frunx5faction\"\n\n            inputs:\n                \"work_folder_id\": string\n                    description: |\n                      The folder id returned by list_work_folders.\n                    label: \"string\"\n                    is_required: True\n                    is_user_input: False\n                \"action_name\": string\n                    description: |\n                      The exact name returned by list_actions for this folder.\n                    label: \"string\"\n                    is_required: True\n                    is_user_input: False\n        a95d21b38c6273c2c8d8c2f508296fe9f:\n            description: |\n                Lists executable actions in one work folder returned by list_work_folders. An action delegates a predefined task to a server-side agent. Inspect action names and descriptions to find a task matching the user's request, including unfamiliar project or business names. When an action fits, pass its exact name and this work_folder_id to run_action.\n            label: \"list_actions - TreasureAIMCP\"\n            require_user_confirmation: False\n            include_in_progress_indicator: False\n            source: \"a95d21b38c6273c2c8d8c2f508296fe9f\"\n            target: \"mcpTool://TreasureAIMCP/mcptoolx5fx5flistx5factions\"\n\n            inputs:\n                \"work_folder_id\": string\n                    description: |\n                      The folder id returned by list_work_folders.\n                    label: \"string\"\n                    is_required: True\n                    is_user_input: False\n        aed3e4d64a89532f4b0943e4a226247fe:\n            description: |\n                Sends a new instruction to an existing chat to request additional work or revise a result. To wait for an existing result without sending a message, use get_chat_result. Waits for the reply and returns status \"running\" if execution is still in progress.\n            label: \"continue_chat - TreasureAIMCP\"\n            require_user_confirmation: False\n            include_in_progress_indicator: False\n            source: \"aed3e4d64a89532f4b0943e4a226247fe\"\n            target: \"mcpTool://TreasureAIMCP/mcptoolx5fx5fcontinuex5fchat\"\n\n            inputs:\n                \"chat_id\": string\n                    description: |\n                      The chat_id returned by run_action or start_chat through this connection.\n                    label: \"string\"\n                    is_required: True\n                    is_user_input: False\n                \"message\": object\n                    description: |\n                      The follow-up task for this chat, including any new context and the expected result.\n                    label: \"string\"\n                    is_required: True\n                    is_user_input: False\n                    complex_data_type_name: \"lightning__richTextType\"\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshooting","__idx":16},"children":["Troubleshooting"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"34%","data-label":"Symptom"},"children":["Symptom "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"30%","data-label":"Cause"},"children":["Cause "]},{"$$mdtype":"Tag","name":"th","attributes":{"width":"36%","data-label":"Fix"},"children":["Fix "]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Registry validation fails or the server does not connect"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Server URL"]},", endpoint type, or External Credential token do not match the same static-token endpoint, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Bearer "]}," was included in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BearerToken"]}," value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Copy the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Connection URL"]}," and token again from the same ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Static token · shared executor"]}," endpoint. Paste only the URL in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Server URL"]},", paste only the raw ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tasgwt_"]}," token in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BearerToken"]},", and confirm the Custom Header formula is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{!'Bearer ' & $Credential.Treasure_AI_MCP.BearerToken}"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Salesforce reports missing credential or permission access"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The generated Named Credential Permission Set is not assigned to the user"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Open ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup → Agentforce Registry → Registered MCP Servers → TreasureAIMCP → Details"]},", select the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Named Credential Permission Set"]}," link, and assign it to the intended user"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The agent is visible in Lightning but cannot call Treasure AI tools"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Agent visibility and MCP tool access are separate; the user has ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled Agent Access"]}," without the MCP permission set"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Assign both ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enabled Agent Access"]}," for the Employee Agent and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP_Perm_Set"]}," (or your org's generated permission set)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The agent answers from general knowledge or Salesforce data instead of Treasure AI"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The six ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP"]}," actions are not attached to the subagent, or the subagent instructions do not require Treasure AI tools"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Add all six registered ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureAIMCP"]}," actions from the Asset Library, verify the bindings in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Script view"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["</>"]},"), save with ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["0 errors"]},", and confirm ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MCP RPC tools/call"]}," steps appear in Preview trace"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A published agent has the wrong Salesforce agent type and does not appear in the Lightning Sales panel"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A Service Agent was published instead of an Employee Agent (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AgentforceEmployeeAgent"]},")"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create a new Employee Agent (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AgentforceEmployeeAgent"]},") and reuse your registered MCP tools; Salesforce can reject changing the type after publication"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Requests fail with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["401"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["403"]}," from Treasure AI Studio"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The static token is expired or revoked, the endpoint is disabled, or the executor stepped down or lost folder access"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Check the endpoint status and token table under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings → Agent Channels"]},", and see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/mcp-endpoints#troubleshooting"},"children":["Static-Token MCP Endpoints troubleshooting"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":17},"children":["Next Steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/mcp-endpoints"},"children":["Static-Token MCP Endpoints"]},": manage endpoint status, executor handover, and token lifecycle."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/mcp-clients"},"children":["Connecting an MCP Client"]},": details of the six MCP tools, results, and limits."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/ai-studio/agent-channels/channel-chats"},"children":["What an Agent Channel Chat Can Reach"]},": workspace isolation, credits, and audit trails for channel chats."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://help.salesforce.com/s/articleView?language=en_US&id=ai.agent_mcp_connect_register.htm&type=5"},"children":["Salesforce Help: Register a Third-Party MCP Server"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://help.salesforce.com/s/articleView?language=en_US&id=ai.agent_mcp_tool_action_add.htm&type=5"},"children":["Add MCP Tool Actions to an Agent"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/headless"},"children":["Headless"]},": overview of connecting external AI tools to Treasure AI."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Other Headless guides: ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/headless/chatgpt"},"children":["ChatGPT"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/headless/claude-web"},"children":["Claude"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/headless/gemini"},"children":["Gemini"]},", ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/headless/databricks-genie-one"},"children":["Databricks Genie One"]},"."]}]}]},"headings":[{"value":"Connecting Salesforce Agentforce to Treasure AI Studio","id":"connecting-salesforce-agentforce-to-treasure-ai-studio","depth":1},{"value":"How the Connection Is Set Up","id":"how-the-connection-is-set-up","depth":2},{"value":"Prerequisites","id":"prerequisites","depth":2},{"value":"Step 1: Create a Static-Token MCP Endpoint in Studio","id":"step-1-create-a-static-token-mcp-endpoint-in-studio","depth":2},{"value":"Step 2: Configure the Custom External Credential in Salesforce","id":"step-2-configure-the-custom-external-credential-in-salesforce","depth":2},{"value":"Step 3: Register the MCP Server and Allowlist Tools","id":"step-3-register-the-mcp-server-and-allowlist-tools","depth":2},{"value":"Step 4: Assign the MCP Permission Set","id":"step-4-assign-the-mcp-permission-set","depth":2},{"value":"Step 5: Build the Employee Agent in Agentforce Builder","id":"step-5-build-the-employee-agent-in-agentforce-builder","depth":2},{"value":"Describe the Agent and Review the Optimizer Proposal","id":"describe-the-agent-and-review-the-optimizer-proposal","depth":3},{"value":"Attach the Registered MCP Actions and Verify Inputs","id":"attach-the-registered-mcp-actions-and-verify-inputs","depth":3},{"value":"Step 6: Test the Agent in Preview","id":"step-6-test-the-agent-in-preview","depth":2},{"value":"Step 7: Activate the Employee Agent and Enable User Access","id":"step-7-activate-the-employee-agent-and-enable-user-access","depth":2},{"value":"Step 8: Use the Agent from Salesforce Lightning","id":"step-8-use-the-agent-from-salesforce-lightning","depth":2},{"value":"What Runs in Studio and Security Controls","id":"what-runs-in-studio-and-security-controls","depth":2},{"value":"Stop the Connection","id":"stop-the-connection","depth":3},{"value":"Reference Agent Script","id":"reference-agent-script","depth":2},{"value":"Troubleshooting","id":"troubleshooting","depth":2},{"value":"Next Steps","id":"next-steps","depth":2}],"frontmatter":{"seo":{"title":"Connecting Salesforce Agentforce to Treasure AI Studio","description":"Connect Salesforce Agentforce to Treasure AI Studio via a static-token MCP endpoint, then build an Employee Agent that runs Studio Actions and chats."}},"lastModified":"2026-11-20T01:00:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/headless/salesforce-agentforce","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}