Skip to content

Interface: PrepareChartOptions

Inputs to prepareChart.

config: MastraPluginConfig

Plugin config; resolves the planner agent’s model.


optional description?: string

Optional intent hint forwarded to the planner agent.


optional requestContext?: RequestContext<unknown>

Per-request RequestContext. Forwarded to the planner agent so user-scoped model resolution (OBO) stays in effect.


resolveData: (signal?) => Promise<{ rows: readonly Record<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".

AbortSignal

Promise<{ rows: readonly Record<string, unknown>[]; }>


optional signal?: 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.


optional title?: string

Display title forwarded to the planner agent.


userKey: string

Identity that owns the minted chart. Only a fetchChart call carrying the same key resolves it. Use resolveUserKey.