Skip to main content
Glama

apply_candidate

Destructive

Apply a previewed route candidate to a KiCad PCB board, replacing the file on disk. Creates an undoable pre-apply copy before making changes.

Instructions

Apply a previewed route candidate to a board, replacing the file on disk.

**This is the only tool that changes a board.** It is disabled unless the operator set
`COPPER_MCP_ALLOW_APPLY=1`, and it additionally requires an `apply_token` issued by
`preview_route` for this exact candidate, board revision and path. A model cannot enable
the flag or mint a token.

`request` takes `board`, `candidate` (the manifest from the preview), `apply_token`,
`expect_board_revision` (the board digest the caller previewed), and `constraints`.

The board must not be open in KiCad: a lockfile beside it is a hard refusal, because
pcbnew has no external-change watcher and would silently overwrite the applied board on
its next save. Before anything is written, a timestamped pre-apply copy is created beside
the board and its path is returned - **that copy is the undo**, restored by copying it
back. This is not a KiCad undo step.

Only additive route patches are applied. Nothing here applies a placement, and the applied
board carries no DRC evidence: the reported verification covers byte preservation, a
fail-closed reparse, and Board IR equality, and says `not_run` for anything involving
KiCad.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusYes
requestYes
board_pathYes
diagnosticYes
backup_pathYes
bytes_addedYes
candidate_idYes
verificationYes
apply_versionYes
base_revisionYes
segments_addedYes
board_revision_afterYes
board_revision_beforeYes
snapshot_digest_beforeYes
conversion_diagnostic_countsYes
Behavior5/5

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

Annotations declare readOnlyHint:false and destructiveHint:true, and the description goes far beyond: it explains the disable flag, token requirements, lockfile refusal, pre-apply backup copy as undo, additive-only nature, and exactly what verification does and does not cover. This gives the agent full operational transparency for a destructive mutation.

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

Conciseness5/5

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

Well-structured: lead sentence states purpose, then paragraphs cover safety, mechanism, and scope. Every sentence carries unique information; no fluff or repetition of schema. Length is appropriate for the tool's destructive complexity.

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?

Given this is the only mutating tool with complex safety and undo semantics, the description covers prerequisites, failure modes, the backup/undo path, scope limitations, and verification behavior. It is complete for an agent to decide and execute correctly.

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

Parameters5/5

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

The schema has only a single opaque 'request' object with additionalProperties:true and 0% field coverage. The description compensates fully by enumerating the fields: board, candidate (manifest from preview), apply_token, expect_board_revision (board digest), and constraints. It also adds meaning to the token and revision fields.

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?

The description opens with a specific verb+resource+effect: 'Apply a previewed route candidate to a board, replacing the file on disk.' It clearly states this is the only tool that changes a board, distinguishing it from all sibling tools like preview_route, inspect_board, and validate_candidate.

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?

The description states when to use (after preview_route with a valid apply_token), when NOT to use (board open in KiCad, placement-only operations), and prerequisites (COPPER_MCP_ALLOW_APPLY=1, token issued by preview_route for exact candidate/revision/path). It also explains the undo mechanism and verification scope, providing complete context for invocation.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/seunghyukchoe/copper-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server