pdf_forms
List, fill, flatten, export, and auto-fill interactive PDF form fields, including LLM-guided data entry.
Instructions
Handle interactive form fields.
List, fill, flatten, export, and auto-fill (LLM-guided) PDF form fields.
Return Format
A dict with keys:
success: bool
message: str - human-readable summary
operation-specific keys:
list_fields: {fields: [{name, type, value, page, rect}]}
fill/flatten: {path}
export_data: {data: {field_name: value}}
auto_fill: {path, filled, missing} On failure: {success: False, error, error_type}.
Examples
await pdf_forms(operation="list_fields", path="form.pdf") {"success": true, "fields": [{"name": "name", "type": "text", "value": "", "page": 0, "rect": [...]}], "message": "Found 1 form fields in form.pdf."}
await pdf_forms(operation="fill", path="form.pdf", fields={"name": "Ada"}) {"success": true, "path": ".../form_fill_....pdf", "message": "Filled 1 form fields in form.pdf, saved to form_fill_....pdf."}
await pdf_forms(operation="auto_fill", path="form.pdf", source="source.pdf") {"success": true, "path": ".../form_autofill_....pdf", "filled": 3, "missing": [], "message": "Auto-filled 3 fields in form.pdf from source.pdf."}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the PDF file. | |
| text | No | Source text driving auto_fill (alternative to source). | |
| fields | No | Dict of field_name: value for fill operation. | |
| source | No | Source PDF path whose text drives auto_fill. | |
| operation | Yes | ||
| output_path | No | Output path. Auto-generated if omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | Human-readable summary | |
| success | No | Whether the operation succeeded |