Payloads

A payload is what an agent receives: one assembly, rendered as markdown or JSON. The format you choose changes how it reads, never what it includes.

Markdown — the default

Markdown is for reading. An LLM grounds on it directly, and you can eyeball whether the curation is right.

# Account: Global Media
- **Record ID:** 001Rt000026m64hIAA

- **Account Name:** Global Media
- **Account Type:** Prospect
- **Industry:** Media
- **Employees:** 14,668
- **No value:** Phone, Parent Account

**Summary Metrics:**
- **Open Pipeline:** $40,000
- **Open Cases:** 1 — _Open service cases: a signal of active support load._

**Contacts (3):**
| Contact ID | Full Name | Title | Email |
| --- | --- | --- | --- |
| 003Rt00001Bp8WCIAZ | Geoff Minor | President | info@example.com |
| 003Rt00001Bp8WDIAZ | Carole White | VP Sales | carole@example.com |

A frame comes first, above the record: the briefs the domain injects, the Info lines it carries, then the standing context line — today’s date, the fiscal quarter, the data as-of time. A set carries the frame once, not once per record.

  • Curated fields follow flat, in the order you arranged them.
  • Values carry field labels, not API names, formatted by type: currency with its symbol, numbers with separators.
  • Instructions render in italics after the value, so a number arrives with its meaning.
  • Related lists are tables of the child entity’s list columns, headed with the row count.

Fields with no value collapse into one No value: line, so an agent knows the field is empty rather than unfetched. The list level omits that line. A field missing altogether is either not curated at this level or not visible to the caller.

JSON — for chaining

JSON is for programmatic consumers: an agent chaining tools, MCP structured content, your own code. Values travel with their labels, types, and instructions.

{
  "schemaVersion": "0.1-beta",
  "entity": "account",
  "object": "Account",
  "recordId": "001Rt000026m64hIAA",
  "level": "detailed",
  "instruction": "Lead with renewal exposure before pipeline.",
  "fields": [
    { "path": "Name", "label": "Account Name", "type": "string", "value": "Global Media" },
    { "path": "Industry", "label": "Industry", "type": "picklist", "value": "Media" }
  ],
  "metrics": [
    { "label": "Open Pipeline", "value": 40000 },
    { "label": "Open Cases", "value": 1,
      "instruction": "Open service cases: a signal of active support load." }
  ],
  "relatedLists": [
    { "label": "Contacts",
      "columns": ["Id", "Name", "Title", "Email"],
      "truncated": false,
      "records": [
        { "Id": "003Rt00001Bp8WCIAZ", "Name": "Geoff Minor", "Title": "President", "Email": "info@example.com" }
      ] }
  ]
}

Key-by-key detail: JSON payload schema.

NOTE

The schema carries a version, currently 0.1-beta. Once stable, later versions only add keys. Until then, read schemaVersion if you parse a payload in production.

Choose a format

UseFormat
Grounding an agent’s answerMarkdown
Anything a human reads while debuggingMarkdown
Feeding another tool or a code stepJSON
Extracting one specific value reliablyJSON

Default to markdown: agents expect it, it costs fewer tokens, and you can check it by eye. JSON repeats every key on every row. Use JSON when something downstream parses rather than reads.

Same data, different format

ContextWorks assembles the payload once and renders it twice. JSON adds structure: every field arrives as a typed object with its path, label, and type, so your code reads a value without parsing prose.

Both formats say so when a value is empty. Markdown collapses empty curated fields into the No value: line and renders an empty reference as None linked. JSON carries value: null on fields and missing: true on references. Either way, the consumer can tell an empty value from one nobody fetched.

Where you set the format

WhereHow
An agent actionThe Format input on Get Records or Find Records
A custom toolPin it in the generated class, or let the caller pass it
Apexrequest.format = 'json'
The Studio previewThe Format toggle in the preview modal

Usage metrics report format too, so you can see the token spend per format.

What’s next