All guides
StructuredAdvanced·Intermediate7 min

Output Format Mastery: JSON, Tables & Parseable Results

The structured use case pins output to one of six shapes — json, table, code, list, markdown, or prose — by injecting a shape-specific skeleton into the optimized prompt. VantagePrompt resolves the shape from your wording rather than a dropdown, so naming the format and the fields explicitly in your raw input is what makes the result deterministic.

A model that gives the right answer in the wrong shape is still a broken step in your pipeline. Here is how the structured use case pins output to json, tables, code, or lists — so the result is parseable, reusable, and ready for the next tool.

By Andrei Bădulescu, Founder at VantagePrompt·Updated

Most prompt failures are not about the model being wrong. They are about the shape being wrong. You ask for "a comparison" and get three paragraphs of prose you cannot parse. You ask for "some options" and get a wall of text where a numbered list belonged. If the next step in your workflow is code that reads the output, loose prose is a bug.

The structured use case in VantagePrompt exists to fix that. It pins the output to a predictable shape — json, markdown, prose, code, table, or list — so the result is reliable, reusable, and machine-parseable. This guide covers when to reach for structured, how shapes map to real downstream needs, and how to get output you can pipe into the next tool without cleanup.

When should I use the structured use case?

Reach for structured whenever something other than a human reads the output, or whenever a human needs to scan it fast. Concretely: you are feeding the result into a script, a spreadsheet, an API call, a config file, or a UI that expects a fixed schema. The structured use case optimizes the prompt around the output schema itself — field definitions, validation rules, and the exact response shape — instead of around tone or narrative.

  • You need JSON your code can JSON.parse without a try/catch and a prayer.
  • You need a table you can paste into a sheet with columns that line up.
  • You need a ranked list a teammate can skim in five seconds.
  • You need a code skeleton with a fixed signature, not an essay about the code.

If you are unsure which use case fits your prompt at all, start with the use-case overview guide — structured is one of six textual use cases, and it is the one whose whole job is the output contract.

What are the six output shapes?

VantagePrompt resolves your prompt to one of six output shapes and injects a shape-specific directive that pins how the refined prompt's output format section is filled in. Each shape produces a different skeleton in the optimized prompt:

ShapeSkeleton injected into the promptUse it forWording that triggers it
jsonFenced JSON schema with field names, types, and example values.Machine-parseable, schema-like, or comparative data."compare", "versus", "criteria", "fields", "schema"
tableMarkdown table skeleton with column headers and an example row.Side-by-side comparisons and grids."table", "matrix"
codeFenced code block with a function or class signature skeleton.Deliverables that are runnable code."write code", a function name, a language name
listNumbered or bulleted skeleton with a few items.Procedural sequences, steps, checklists, options."steps", "checklist", "options"
markdownMixed sections with headings, bullets, at most one short table.Human-readable rankings and scannable lists."top 5", "best", "give me a list of"
proseNamed paragraph sections.The fallback when no structural signal is present.no structural signal
The six output shapes, what each pins in the optimized prompt, and the wording that resolves to it.

json vs markdown for lists is a real distinction. A schema-like or comparative request ("compare X and Y on these criteria") resolves to json. A human-facing ranking ("give me the top 5 tools for X") resolves to markdown — a scannable list beats a JSON blob a person has to mentally parse. Pick the shape by who consumes the output, not by which feels more technical.

How wording resolves to an output shapeVantagePrompt reads the wording of your raw input and resolves it to one of six output shapes — json, table, code, list, markdown, or prose — then injects that shape's skeleton into the optimized prompt so the downstream model honours it.Your wordingShape resolverjson"compare", "schema"table"table", "matrix"codelanguage or fn namelist"steps", "checklist"markdown"top 5", "best"proseno signal — fallbackThe resolved shape's skeleton is injected into the optimized prompt.
You do not pick the shape from a dropdown — your wording resolves it.

How does VantagePrompt choose the output shape?

You do not hand-pick the shape with a dropdown. VantagePrompt reads your wording. Comparison and schema language ("compare", "versus", "criteria", "fields", "schema") leans json. Words like "table" or "matrix" force a table. "Write code", a function name, or a language name forces code. "Steps", "checklist", or "options" forces a list. "Top 5", "best", or "give me a list of" leans markdown. Anything with no signal falls back to prose.

The practical takeaway: say the shape out loud in your raw input. The clearer your wording, the more deterministic the shape. "Return a JSON object with one entry per library" is unambiguous; "tell me about some libraries" is not.

This page is about which shape you get. Getting a good result inside a shape is a separate craft with separate failure modes — a JSON response that parses every time, a table whose rows agree about their columns, markdown that lands cleanly in the page it is pasted into, code that runs — and each of the four has its own guide below.

What does a structured prompt look like end to end?

Suppose you want machine-readable data comparing three HTTP clients. A vague prompt invites prose. Here is the rough input you would paste into the structured use case:

Compare axios, ky, and native fetch as a JSON object. For each library
include: name, bundle_size_kb (number), supports_interceptors (boolean),
and a one-line note. I need to parse this in a script.

Structured wording ("compare", "JSON object", explicit fields with types) resolves the shape to json. The optimized prompt VantagePrompt produces will carry an output format section that pins a concrete schema for the downstream model to follow — names, types, and an example — so the answer comes back parseable:

{
  "libraries": [
    {
      "name": "axios",
      "bundle_size_kb": 13,
      "supports_interceptors": true,
      "note": "Batteries-included, larger footprint."
    }
  ]
}

The optimized prompt is XML-structured (that is how all six textual use cases are built), but the answer the downstream model returns conforms to the JSON schema pinned in the output format section. Note the distinction: VantagePrompt produces the prompt, not the final answer. The shape directive flows downstream so that whichever model you paste the prompt into honors the schema.

Do I still need to validate the output myself?

When the resolved shape is json, code, or table, VantagePrompt also folds a shape-aware self-check into the optimized prompt — for example, that JSON validates and parses, that code is runnable as written, or that every table row has a consistent column count. That self-check raises the odds the downstream output is clean on the first pass. Still, treat any machine-bound output as untrusted at the boundary: parse it, validate the fields, and handle the failure case in your own code. A schema in the prompt reduces drift; it does not replace validation in your pipeline.

If the shape comes back wrong, the fix is almost always in your wording. Add the shape and the fields explicitly: name the format, list the field names with their types, and state who or what consumes the output. Re-run and the resolved shape will follow your lead.

One scope note: getting parseable structure is about format, not factual freshness. If your structured prompt also needs current, verifiable facts inside those fields, grounding with web search is a separate lever — see the grounding guide for when that helps.

Frequently asked questions

When should I use the structured use case?
Whenever something other than a human reads the output, or a human needs to scan it fast: feeding a script, a spreadsheet, an API call, a config file, or a UI that expects a fixed schema. Structured optimizes the prompt around the output contract — field definitions, validation rules, response shape — instead of around tone or narrative.
How do I control which output shape VantagePrompt picks?
Say the shape out loud in your raw input. Comparison and schema language leans json; "table" or "matrix" forces a table; a function or language name forces code; "steps" or "checklist" forces a list; "top 5" or "best" leans markdown. No signal falls back to prose.
Should a list of options be json or markdown?
Pick by who consumes it. A schema-like or comparative request resolves to json. A human-facing ranking resolves to markdown, because a scannable list beats a JSON blob a person has to mentally parse. The distinction is about the consumer, not about which feels more technical.
Does the schema in the prompt mean I can skip validation in my code?
No. When the shape is json, code, or table, VantagePrompt folds a shape-aware self-check into the optimized prompt, which raises the odds of clean output on the first pass. Still treat machine-bound output as untrusted at the boundary: parse it, validate the fields, and handle the failure case. A schema reduces drift; it does not replace validation.
Does VantagePrompt return the JSON answer itself?
No — it produces the prompt, not the final answer. The optimized prompt is XML-structured and carries the shape directive downstream, so whichever model you paste it into honors the schema.

Sources

structured prompts to try

Browse all structured prompts

Published by the community and free to copy — worked examples of what this guide describes.

Put it into practice.

Run this technique in the optimizer.

Open the optimizer

Keep reading