Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / Document automation

Extract validated fields from unstructured documents

Convert documents into fixed-field JSON records while keeping validation in the application.

Goal

Extract document metadata in batches for later retrieval or review.

Steps

  1. Define Pydantic/JSON Schema fields and enums, then prepare synthetic documents and edge cases. [extract]
  2. Follow the notebook’s tool-use extraction pattern with the input text and field definitions; test summary, entity, or sentiment outputs separately. [extract]
  3. Validate required fields, types, enums, and source evidence; mark unverifiable values missing instead of guessing. [extract]

How to verify

Valid examples match the schema; typos, missing fields, and out-of-range cases are rejected or flagged by the application.

Troubleshooting

If the tool call lacks a complete object, inspect required schema fields and input boundaries; do not treat prose as field data.

Permissions

Prerequisites

Permissions

Limitations

Structured results are extraction candidates; business truth and document provenance need independent checks. Do not automate eligibility/payment decisions.

Pinned upstream source

https://github.com/anthropics/anthropic-cookbook/blob/9c1e493ddd2b82df399d2a61b9c806c539e18be6/tool_use/extracting_structured_json.ipynb

Repository
anthropics/anthropic-cookbook
File path
tool_use/extracting_structured_json.ipynb
Pinned commit
9c1e493ddd2b82df399d2a61b9c806c539e18be6
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

Turn ecommerce campaign materials into a reviewable weekly brief

Related resources