Connect an agent
The shortest path to an agent answering from curated context. Pick the surface you already have — the full setup detail for each lives in Deploying.
Every surface reaches ContextWorks through the same actions — Get Catalog, Find Records, Get Records, and (where an admin deploys it) Update Records. Agents call Get Catalog first, so they discover your real object and field names instead of guessing. See the actions.
Path A — Agentforce
- Enable Agentforce. Setup → Agentforce Agents. Requires Einstein generative AI.
- Install the extension package. Click Install Extension Package on Deploy → Agentforce. It registers all four agent actions and a ready-made ContextWorks topic — nothing to name by hand.
- Add the topic to your agent in Agent Builder — or generate a complete agent from your live configuration. See Agentforce.
- Assign ContextWorks User to whoever the actions run as — every conversing user for an employee agent, the agent’s own user for a service agent.
- Ask it something. “What should I know about the Global Media account?” The agent should call Get Catalog, then Get Records, and answer from your curated fields and instructions.
Path B — MCP (Claude, or any MCP client)
Deploy → MCP walks you through it: an OAuth external client app, an MCP server, and the three tools registered under it. Point your client at the server’s endpoint and log in.
Tools run as the authenticated user, so context stays permission-correct per caller — a shared service account would throw that away. Assign ContextWorks User to each connecting user. Full steps: MCP.
Path C — Apex (Developer)
No agent surface needed. Call the engine directly from Flow, a Prompt Builder template, a scheduled job, or your own invocable. You can even run it straight from the Execute Anonymous window in the Developer Console:
// Paste into Developer Console → Debug → Open Execute Anonymous Window
Id accountId = [SELECT Id FROM Account LIMIT 1].Id;
String context = ctxl.Entity.load(accountId);
System.debug(context);
Set toolName on anything you build so Usage can tell your caller apart from the packaged actions. Full API: Apex API.
Verify it end to end
- Ask the agent something that needs a curated field — ideally one carrying an instruction.
- Check the answer reflects your curation, not generic Salesforce knowledge.
- Open Observe → Usage. A load should be recorded with its surface, level, format, and token count.
- Open Observe → Issues. It should be empty; entries name whatever degraded.
If Usage shows nothing, the agent answered from something other than ContextWorks — usually the action wasn’t reached, not that it failed.