document_get_source
Retrieves the raw EasyEDA source for the active schematic, PCB, or panel as newline-delimited JSON arrays, so you can inspect or edit it and write changes back.
Instructions
Get the raw source code of the currently active document (schematic page, PCB, or panel). Returns the document as a string in EasyEDA's internal format (newline-delimited JSON arrays). Use editor_open_document to switch to the desired document first, then call this tool. The source can be modified and written back with document_set_source.
For schematic documents, the source is also run through the schema validator as a side effect — any unknown tags get logged to ~/.easyeda-schema-discovery.jsonl so we can grow the schema. The response itself is unchanged. Use document_validate for a structured validation report.
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. The document source is newline-delimited JSON arrays; .epro files are ZIP archives of the same. 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. | |
| 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. |