Back to guide/General Productivity

Structured Output (JSON/Schema)

Gemini handles structured output and JSON mode exceptionally well. The explicit schema with confidence scores and metadata produces machine-parseable results suitable for downstream processing.

gemini-promptsinput_typeinput_dataentity_type
Edit View
Prompt
Parse the following {{input_type}} and return a structured JSON response.

Input:
{{input_data}}

Output schema:
{
  "entities": [
    {
      "name": "string",
      "type": "{{entity_type}}",
      "attributes": { },
      "relationships": [{ "target": "string", "relation": "string" }],
      "confidence": "high | medium | low"
    }
  ],
  "summary": "string",
  "metadata": {
    "input_quality": "clean | noisy | ambiguous",
    "entities_found": "number",
    "processing_notes": "string"
  }
}

Rules:
- Return ONLY valid JSON, no markdown code fences, no explanation text
- If a field cannot be determined, use null (not empty string)
- Set confidence to "low" for any entity extracted from ambiguous context
- Deduplicate entities that appear multiple times with different names

Variables to customize

{{input_type}}{{input_data}}{{entity_type}}

Why this prompt works

Gemini handles structured output and JSON mode exceptionally well. The explicit schema with confidence scores and metadata produces machine-parseable results suitable for downstream processing.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.