document_validate
Check EasyEDA schematic or PCB source against the Zod schema to flag unknown tags and shape errors. Returns a report with counts and samples of invalid or unrecognized elements.
Instructions
Validate a document's source against the Zod-backed EasyEDA schema. Runs on the currently active document by default, or on a local file if filePath is provided. Schematic (.esch, documentType=1) and PCB (.epcb, documentType=3) documents are validated; other types return a "skipped" report with a reason. Unknown tags (shapes the schema doesn't cover yet) are appended to the discovery log at ~/.easyeda-schema-discovery.jsonl (override via EDA_DISCOVERY_LOG).
Returns a JSON-serializable report: { docType, lineCount, knownCount, unknownTagCount, invalidCount, samples: { unknownTags, invalid } }. Known issues are samples of known tags whose shape failed validation (typically writer bugs); unknowns are tags not yet in the schema vocabulary.
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 | No | Absolute path to a local file to validate. If omitted, validates the currently active document. | |
| 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. |