Skip to main content
Glama
rjwalters

openkonnect

by rjwalters

save_before_external_write

Save an open KiCad board to disk before an external file-based tool modifies it; refuse dirty or unknown documents unless saving is explicitly allowed.

Instructions

Before a file-based tool (kct) touches a board open in KiCad, make the file on disk match the editor. A board proven clean is left alone. A dirty board, or one whose dirty state is unknown (always possible on KiCad 10), is refused unless allow_save=true; then it is saved and the file is checked to have changed. Returns each document's state before, the action (none/saved/refused) and the file SHA-256 plus editor_sha256 to pass to sync_from_disk. The schematic cannot be saved over KiCad 10's API: it is refused unless schematic_unverified_ok=true.

Input Schema

NameRequiredDescriptionDefault
documentsNo
allow_saveNo
schematic_unverified_okNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare readOnly=false and destructive=false. The description goes well beyond them: dirty or unknown-state boards are refused unless allow_save is set, saves are verified by checking the file changed, and KiCad 10 schematics cannot be saved at all without an explicit override. It also describes the return payload (pre-state, action, SHA-256, editor_sha256).

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 purpose, then the clean/dirty/refused decision, then return values, then the schematic caveat. Dense but each sentence adds decision-relevant information; only the schematic sentence feels like an addendum rather than part of the main flow.

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

Completeness4/5

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

With no output schema, the description still documents the returned fields and the follow-up call. For a mutating tool with annotations covering safety, the main remaining hole is the documents argument and whether the SHA-256 values are meant to be passed verbatim to sync_from_disk — mentioning editor_sha256 partially closes that.

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

Parameters3/5

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

Schema coverage is 0%, so the description must carry the parameter meaning. It explains allow_save and schematic_unverified_ok clearly, but the documents parameter (string or array of strings, default null) is never defined — an agent cannot tell whether it takes paths, names, or handles.

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 operation and resource: make the on-disk file match the KiCad editor before a file-based tool (kct) touches an open board. It also names its counterpart, sync_from_disk, so an agent can distinguish the two without opening either 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 scopes when to call it (ahead of kct touching an open board) and states the exclusion that a proven-clean board is left alone. It also gives the escalation path (allow_save=true, schematic_unverified_ok=true) and names sync_from_disk as the follow-up.

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