Skip to main content
Content generation without structure produces a blob of text that someone has to manually split into headline, body, and a call to action (CTA). If the model writes a 200-character headline, your page layout breaks. If it forgets the call to action, your marketing page has no conversion path. If the tone drifts from professional to casual mid-paragraph, the brand voice is inconsistent. Wrapping content generation in a schema solves all of this. Each section becomes a separate field with its own length bounds. Tone becomes an enum, not a suggestion. The CTA is a required object with a label and URL. The model fills in the creative content while the schema enforces the structural and editorial constraints.

Goal

Generate a product launch blurb with a headline, subheadline, key points, call to action (CTA), and tone, all bounded and validated for direct web publishing.

Schema contract

Example input

Example output

Implementation tips

  • Tone enum controls voice. "professional", "friendly", "technical": the model adopts the specified style without you embedding tone instructions in the prompt. Add or remove values as your brand guidelines evolve.
  • Length bounds match your layout. The headline is capped at 80 characters (fits a single line on desktop), the subheadline at 140 (fits two lines), and key points at 140 each. These bounds should come from your actual CSS/layout constraints.
  • Key points array is bounded. minItems: 3 ensures enough substance for a marketing page. maxItems: 5 prevents the model from listing fifteen points that nobody reads.
  • CTA is required and structured. The cta object guarantees every generated blurb has a clear action. The pattern: "^https://" on url prevents relative paths, mailto: links, or other formats your publishing system doesn’t support.
  • Human review is still needed. The schema handles structure and bounds, but brand voice, factual accuracy, and legal compliance still need human eyes. Schema-constrained output makes this review faster because the structure is predictable.