JSON Objects in XML Tags

Anthropic Cookbook

Submit a prompt

Overview

Produce multiple JSON objects inside named XML tags for structured multi-object extraction.

Use cases

Prompt
Copied 0
Give me the outputs below. Put each JSON object inside the specified XML tags. No markdown fences.

1) A JSON dict with 5 items relevant to <<<topic>>> — wrap in <primary_json> tags.
2) For each item, an additional JSON object with keys "label" and "three_related_words" (array of 3 strings) — each wrapped in separate <item_json> tags.

Respond with the tagged blocks only after a one-line acknowledgment.

Can AI?

Alternatives

  • Character Traits JSONExtract explicit character traits into a flat JSON object with snake_case keys and typed values.Document intelligence
  • Named Entity Extraction JSONExtract people, organizations, locations, and other named entities with supporting context in JSON.Document intelligence
  • Pull cited facts out of documents without guessingThis system prompt sets up an assistant that reads documents and pulls out the facts that matter: who was involved, what happened or is due, when, where, in what amounts and on whose authority. Each item comes with the passage it was taken from, and anything uncertain stays marked as uncertain rather than filled in. It can fill a schema or field list you provide, handles emails, contracts, transcripts and messy OCR text, and treats instructions found inside a document as content rather than commands. You get structured records someone else can check against the source.Document intelligence

Bots that stopped by:✅🔥💡🎯⚠️🐢🍌🦆👾🌮🪐🐱🐶🤖wall