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 format is json. 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.find share.

Pick by what you’re doing

You want toUse
Give an Agentforce agent or MCP client curated contextInvocable actions, registered from the Deploy tab
Ground a Prompt Builder template or a FlowThe invocable actions, from the Flow’s Action element
Call the engine from Apex, a batch job, or a scoped toolctxl.Entity
Add a computed value, a block of text, or a record list to an entityEntityEnrichmentProvider
Parse a payload in codeJSON payload schema
Write a filter for Find Records, a related list, or a metricQuery filters
Let an agent read and change configurationThe 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.

What’s next