Skip to content

Variable: StatementDataSchema

const StatementDataSchema: ZodObject<{ columns: ZodArray<ZodString>; rowCount: ZodNumber; rows: ZodArray<ZodRecord<ZodString, ZodUnknown>>; truncated: ZodBoolean; }, $strip>

Wire-format payload returned by GET ${basePath}/embed/data/:id.

Mirrors the agent-side get_statement tool’s output so the host UI and the LLM see the exact same shape for the same statement; the route is what resolves [data:<statement_id>] markers the agent embeds in prose.

Fields:

  • columns: column names in declaration order.
  • rows: row records keyed by column name. Cell values are either coerced numbers or the original strings (Genie / Statement Execution returns every cell as string | null; numeric-looking cells are coerced server-side so the UI can format with tabular-nums without re-parsing).
  • rowCount: total row count upstream (independent of the limit cap). Compare against rows.length to detect truncation - truncated is the precomputed flag.
  • truncated: true when the server clipped rows to honor the route’s row cap; the UI should surface a “showing N of M rows” affordance in that case.