Skip to main content
Glama
sheares

easyeda-mcp-fix

by sheares

document_set_source

Destructive

Replace the entire source code of the active document, auto-backing up the prior state to git and validating schematic uploads.

Instructions

Replace the source code of the currently active document. Accepts the full document source as a string (same format returned by document_get_source). Returns { success, backup: { sha, path }, validation: {...} } on success, or throws if validation aborts the upload or the pre-edit backup could not be written. WARNING: This replaces the entire document. Always get the current source first, modify it, then set it back. A backup of the prior state is taken automatically before the replacement (after validation passes) and committed to a local git-tracked repo — the returned backup.sha references the pre-edit state. Validation runs only for schematic documents (documentType=1); 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. 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

TableJSON Schema
NameRequiredDescriptionDefault
sourceYesThe complete document source code to set
documentYesTarget document UUID — auto-switches to this document before executing. Get UUIDs from list_instances or editor_get_open_tabs.
validateNoSchema 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_idNoTarget 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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.6.5

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the destructiveHint=true annotation: it discloses that a git-backed backup is taken automatically before replacement, that the returned backup.sha references the pre-edit state, that validation only runs for schematic documents (documentType=1), and that the call throws when validation aborts or backup fails. These are exactly the failure modes and side effects an agent needs for a destructive write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core action and return shape, then layered with warning and workflow guidance. It is somewhat dense and the backup guarantee is stated twice, but every sentence carries operational weight, so the redundancy is minor.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Even without an output schema, the description specifies the success return shape ({ success, backup: { sha, path }, validation }) and the error conditions, plus validation scoping per document type. For a destructive 4-param tool, nothing essential to correct invocation is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds value: it explains the validate modes and their strictness semantics, the auto-switch behavior of the document UUID, and the on-disk format ('newline-delimited JSON arrays; .epro files are ZIP archives') that governs the source string. That format context is not in the schema and meaningfully informs the source parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Replace the source code of the currently active document') and immediately disambiguates against document_get_source by noting the same format is returned there. The agent can distinguish this as the write counterpart to the get/load/validate siblings without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states the correct workflow ('Always get the current source first, modify it, then set it back') and names concrete alternatives for the batch case (document_save_to_file / project_export_file, then document_load_from_file / project_import_file), including the condition (making many changes at once). This is unambiguous when-to-use and when-to-use-something-else guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools