---
name: amt-document-intake
description: Extract, validate, and export useful data from PDFs, scans, invoices, receipts, forms, and other documents with Agent Media Tools. Use when an agent must turn one or more documents into reviewed text, structured fields, JSON, CSV, XLSX, DOCX, or a durable deliverable.
---

# Document intake

Turn documents into checked, useful data. Never claim extraction accuracy without validating the result against the source.

## Establish the job

1. Ask which fields and output format matter when they are not obvious.
2. Confirm whether documents contain sensitive data before creating a public Artifact.
3. For batches, preserve each source filename as a record identifier.

## Run the workflow

Check `GET /api/usage` or `GET /api/agent/usage` before a multi-document run. If capacity is insufficient, reduce the batch or ask the user to authenticate; never abandon partially processed records without reporting them.

1. Extract text:
   - Browser: https://agentmediatools.com/tool/ocr-extract
   - MCP: `ocr_extract` with a public `url`
   - REST upload: `POST /api/ocr` multipart field `file`
   - Prefer `pdf_to_markdown` when document structure matters.
2. Extract candidate fields:
   - REST: `POST /api/extract-structured` with `file`, or with a file plus `text` after OCR.
   - Treat its emails, phones, amounts, dates, invoice numbers, and totals as candidates, not verified facts.
3. Normalize requested fields into stable keys. Preserve raw values beside normalized values when changing dates, currency, or identifiers.
4. Validate:
   - Compare totals and identifiers with source text.
   - Flag missing, ambiguous, duplicated, or conflicting fields.
   - Do not invent an unreadable value.
5. Export only after validation:
   - MCP `generate_xlsx` or REST `POST /api/generate-xlsx` for rows.
   - MCP `generate_docx` or REST `POST /api/generate-docx` for a review report.
   - MCP `create_artifact` for an approved durable file. Artifacts use public URLs unless protected; avoid them for sensitive material without explicit user approval.

## Return

Provide a concise summary, the structured records, a `needs_review` list with source evidence, and the output link or file. Report the extraction engine and any failed pages. Never silently discard a document.

## Boundaries

- Temporary hosted files auto-delete; download results promptly.
- An API key may be required for agent operations. Use `Authorization: Bearer ...` only where documented.
- Do not expose secrets or personal data in logs, pastes, or public URLs.
- Do not make legal, medical, accounting, or payment decisions from heuristic extraction alone.

Workflow guide: https://agentmediatools.com/workflows/document-intake-ocr
API reference: https://agentmediatools.com/reference
