Skip to main content

render_ui

Emits a json-render.dev component spec in the chat. The agent calls this when it wants to display rich visual UI — dashboards, scorecards, data tables, action panels — without needing an external API call. For an overview of all three Generative UI surfaces (this tool, custom tool responses, and inline artifacts), see Generative UI.

Parameters

Spec structure

  • root — the id of the top-level element to render.
  • elements — a flat map of element id → definition. Each element has type, props, and children (array of element ids).
  • state — initial values for any input elements that use { "$bindState": "/field" }. Required when interactive: true and inputs are present.
See Generative UI → Component reference for all available components and props.

Returns

Static render:
Interactive render — returns an interaction_id. The user’s submitted values arrive on the next turn:
On spec validation failure: { "error": "...", "details": { "hint": "..." } }.

Examples

Static metrics card


Interactive action panel

Set interactive: true so the submit button works. The user’s selection returns to the agent on the next turn.

Status table


Alert with badges


Call from your own custom tool

Notes

  • Always registered when render_ui is enabled for the agent.
  • For interactive renders where the submit action is destructive, pair with confirm_action + commit_actionrender_ui does not provide an anti-hallucination gate on its own.
  • To include a file download card alongside a visual layout, call surface_file first and embed the returned downloadUrl in a key_value element.