document_load_from_file
Load EasyEDA document source from a local file into the active document to replace contents for fast bulk edits, with automatic backup.
Instructions
Load document source from a local file and push it into the currently active document. Reads the file from disk and calls setDocumentSource to replace the document contents. The file must contain valid EasyEDA document source (same format as document_get_source / document_save_to_file). WARNING: This replaces the entire document. A backup of the prior state is taken automatically (after validation passes) and committed to a local git-tracked repo — the returned backup.sha references the pre-edit state. Validation runs for schematic and PCB documents (documentType 1 and 3); other types skip with a status.
FAST-BATCH WORKFLOW: for making many changes at once, it is much faster to export the document or project (document_save_to_file / project_export_file), edit the raw source on disk, then re-upload (document_load_from_file / project_import_file) than to issue many small per-primitive MCP calls. Formats differ: on EasyEDA Pro 3, document_save_to_file returns {header}||{body} lines, while the .epro from project_export_file holds newline-delimited JSON arrays, which is what the src/lib editing library reads. Every destructive upload is auto-backed-up to a local git repo first — the response includes a backup SHA you can use to find the prior state if the edit goes wrong. Upload tools accept validate='off'|'warn'|'strict' (default 'strict') which runs the Zod schema on the new source — see document_validate for standalone validation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document | Yes | Target document UUID — auto-switches to this document before executing. Get UUIDs from list_instances or editor_get_open_tabs. | |
| filePath | Yes | Absolute path to read the document source from | |
| validate | No | Schema validation mode for schematic uploads: 'off' skips entirely, 'warn' aborts only on malformed known tags or JSON parse errors, 'strict' (default) also aborts on any unknown-tag line. | |
| instance_id | No | Target EasyEDA instance ID (8-char hex). Required when multiple instances are connected. Omit when only one instance is connected (auto-selected). Use list_instances to see connected instances. |