Interface: PrepareChartOptions
Inputs to prepareChart.
Properties
Section titled “Properties”config
Section titled “config”config:
MastraPluginConfig
Plugin config; resolves the planner agent’s model.
description?
Section titled “description?”
optionaldescription?:string
Optional intent hint forwarded to the planner agent.
requestContext?
Section titled “requestContext?”
optionalrequestContext?:RequestContext<unknown>
Per-request RequestContext. Forwarded to the planner agent so
user-scoped model resolution (OBO) stays in effect.
resolveData
Section titled “resolveData”resolveData: (
signal?) =>Promise<{rows: readonlyRecord<string,unknown>[]; }>
Resolves the rows to chart. Called once, in the background.
Any thrown error lands in the cache as the entry’s error
field (never propagated to the caller of prepareChart).
An empty rows array is rejected as "dataset has no rows; nothing to chart".
Parameters
Section titled “Parameters”signal?
Section titled “signal?”AbortSignal
Returns
Section titled “Returns”Promise<{ rows: readonly Record<string, unknown>[]; }>
signal?
Section titled “signal?”
optionalsignal?:AbortSignal
Cooperative cancellation. Forwarded to resolveData and the
planner agent. Note: the chart task continues running in the
background after the parent request ends, so external abort
signals are best-effort; typical use is to leave this unset
and let the 1h TTL cap stale entries.
title?
Section titled “title?”
optionaltitle?:string
Display title forwarded to the planner agent.
userKey
Section titled “userKey”userKey:
string
Identity that owns the minted chart. Only a fetchChart call carrying the same key resolves it. Use resolveUserKey.