Overview
Developer
The developer-facing parts of ContextWorks: what you can call, what you can implement, and what comes back.
The five surfaces
- Invocable actions are the packaged actions agents call. Register them in Agentforce, serve them over MCP, or add them to a Flow. All return the same response shape.
- The Apex API,
ctxl.Entity, is the engine behind those actions. Call it when you write your own invocable, a scheduled job, or a scoped tool. - The provider SPI adds computed context. Implement one interface, and an admin can add your output to any entity.
- The JSON payload schema describes what comes back when
formatisjson. Read it when your code parses the result instead of handing it to a model. - Query filters is the filter syntax that Find Records, related lists, metrics and
Entity.findshare.
Pick by what you’re doing
| You want to | Use |
|---|---|
| Give an Agentforce agent or MCP client curated context | Invocable actions, registered from the Deploy tab |
| Ground a Prompt Builder template or a Flow | The invocable actions, from the Flow’s Action element |
| Call the engine from Apex, a batch job, or a scoped tool | ctxl.Entity |
| Add a computed value, a block of text, or a record list to an entity | EntityEnrichmentProvider |
| Parse a payload in code | JSON payload schema |
| Write a filter for Find Records, a related list, or a metric | Query filters |
| Let an agent read and change configuration | The admin tools |
Namespace
The package namespace is ctxl. Reference package classes from your own code as ctxl.ClassName:
String context = ctxl.Entity.load(recordId);
Examples in this section include the prefix. Inside the package, drop it.
What’s public
The global classes and the invocable actions documented here are the public API. Anything not documented here is internal and may change without notice.