Skip to main content
Glama

sch_clear_source_library

Clear stale source-library links from placed schematic components and sync Design Item ID to LibReference so parts re-match current available libraries.

Instructions

Unpin placed schematic components from a stale source library.

Schematic mirror of pcb_clear_source_footprint_library. When a library is renamed, moved, or consolidated, placed components keep pointing at it through two component PROPERTIES:

  • SourceLibraryName: which library file the part came from.

  • DesignItemId: which library ITEM it re-matches against ("Design Item ID" in the Properties panel). A re-link that updates only LibReference leaves this naming the OLD item, which is exactly the <Not Found> state in the panel.

Per matching component this clears SourceLibraryName (when set) and syncs DesignItemId to LibReference (when they differ), so Altium re-matches from whatever is currently in Available Libraries. Both actions are independently switchable.

DesignItemId is a component property, NOT a parameter: writing it through the parameter-stamping API only creates a stray user parameter of that name. Use this tool (bulk) or obj_modify with property DesignItemId (single component).

Args: sheet_path: absolute .SchDoc path; empty = the focused sheet. For a whole project, call once per sheet (see proj_list_documents). designators: restrict to these designators (whole-string, case-sensitive); None/empty = every component on the sheet. clear_source_library: clear SourceLibraryName. sync_design_item_id: set DesignItemId = LibReference where they differ.

Returns: {"total": inspected, "cleared_source_library": n, "synced_design_item_id": n}.

Input Schema

NameRequiredDescriptionDefault
sheet_pathNo
designatorsNo
sync_design_item_idNo
clear_source_libraryNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.7/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden and mostly succeeds: it discloses exactly which two properties are mutated, the independence of the two switches, the re-match side effect, and a real pitfall (writing DesignItemId via the parameter API creates a stray user parameter). It stops short of stating whether the change is undoable or what happens to components with no source library set, so not a 5.

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 one-line purpose, then problem context, then per-parameter docs and a Returns block. Every section earns its place, though the SourceLibraryName/DesignItemId exposition is dense enough that a reader may need two passes; slightly more narrative than strictly required for a 4-param tool.

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?

For a mutation tool with no annotations, the description covers what changes, on which objects, with what switches, and even spells out the return keys despite an output schema existing. Nothing an agent needs to invoke it correctly is missing.

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?

Schema coverage is 0%, so the description must compensate and does: sheet_path ('absolute .SchDoc path; empty = the focused sheet'), designators ('whole-string, case-sensitive; None/empty = every component'), and both booleans are given meaning beyond their names, including that they are independently switchable.

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+resource+scope: 'Unpin placed schematic components from a stale source library.' It also positions itself against the sibling family by naming the PCB mirror (pcb_clear_source_footprint_library) and distinguishing itself from lib_clear_source_library by 'placed components' on a sheet. An agent can identify it without opening the 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?

Gives the triggering condition explicitly ('when a library is renamed, moved, or consolidated') and names the alternative for the single-object case ('obj_modify with property DesignItemId'), plus the per-sheet workflow note pointing at proj_list_documents. That is when-to-use, when-to-use-something-else, and scope guidance together.

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