Skip to main content
Glama

Update a component in place

update_component
Destructive

Replace an existing component in an Altium .PcbLib or .SchLib with a new footprint or symbol while keeping its library position. Supports dry-run preview and safe backup before saving.

Instructions

Replace one existing component of an Altium library (.PcbLib or .SchLib) with the object given, keeping its position in the library. component_name must name a component the library holds, in any case; a name it does not hold is an error listing the available ones. Provide footprint for a .PcbLib or symbol for a .SchLib, in the shape write_pcblib or write_schlib takes: the object replaces the stored component wholesale, so a primitive left out is removed — start from get_component's output when editing. A name in the object that differs from component_name renames the component as well; a name another component already holds is refused, and an object without a name keeps the stored one. dry_run true changes nothing and reports would_rename and a changes list (description, primitive counts per kind); a real run backs the file up, saves, and returns renamed, old_description, component_count and a post-write validation. Alternatives: write_pcblib or write_schlib to rewrite a whole library, batch_update for one change across every component (track widths, a layer, a parameter), update_pad or update_primitive to change one primitive in place, rename_component for a rename alone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
symbolNoFor SchLib: the symbol to store, in the shape write_schlib takes per symbols entry
dry_runNoIf true, show what would be updated without actually modifying the file
filepathYesPath to the .PcbLib or .SchLib file
footprintNoFor PcbLib: the footprint to store, in the shape write_pcblib takes per footprints entry
component_nameYesName of the component to update (must exist in library)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.1.0
    • changedInput schema / properties / footprint / properties / component_bodies / items / properties / identifier / description
      Previous value: -"The body's IDENTIFIER, a user-visible name (any Unicode; stored as code points on disk). Default: empty"New value: +"The body's IDENTIFIER, a user-visible name (any Unicode; stored as UTF-16 code units on disk). Default: empty"
    • addedInput schema / properties / footprint / properties / pads / items / properties / polygon_connect
      Added value: +{
      +  "description": "The pad's own polygon-connect style (Altium: Pad Stack > Thermal Relief), overriding the design rules for how a polygon pour joins the pad. Omit to follow the rules (the default); a key left out takes Altium's default.",
      +  "properties": {
      +    "air_gap": {
      +      "description": "Gap between the pad and the pour in mm. Default: 0.254 (10 mil)",
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "auto_conductors": {
      +      "description": "Let Altium choose the conductor count. Default: false",
      +      "type": "boolean"
      +    },
      +    "conductor_width": {
      +      "description": "Width of each relief conductor in mm. Default: 0.254 (10 mil)",
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "conductors": {
      +      "description": "Number of relief conductors. Default: 4",
      +      "enum": [
      +        2,
      +        4
      +      ],
      +      "maximum": 4,
      +      "minimum": 2,
      +      "type": "integer"
      +    },
      +    "min_distance": {
      +      "description": "Minimum distance used with auto_conductors when min_distance_enabled is set, in mm. Default: 0.381 (15 mil)",
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "min_distance_enabled": {
      +      "description": "Apply min_distance (Altium's Min Distance checkbox). Default: false",
      +      "type": "boolean"
      +    },
      +    "rotation": {
      +      "description": "Conductor angle in degrees. Default: 90",
      +      "enum": [
      +        45,
      +        90
      +      ],
      +      "maximum": 90,
      +      "minimum": 45,
      +      "type": "integer"
      +    },
      +    "style": {
      +      "description": "How the pour joins the pad. Default: relief",
      +      "enum": [
      +        "relief",
      +        "direct",
      +        "no_connect"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / footprint / properties / regions / items / properties / raw_contours
      Added value: +{
      +  "description": "Base64 of the region's contour bytes exactly as read_pcblib emitted them (outline and hole vertices). Altium stores a vertex as a double in internal units and a poured polygon's copper sits on fractional ones, so the bytes are replayed while they still describe the vertices above; an edited outline drops them. Pass back unchanged; omit when authoring.",
      +  "type": "string"
      +}
    • addedInput schema / properties / footprint / properties / vias / items / properties / polygon_connect
      Added value: +{
      +  "description": "The via's own polygon-connect style (Altium: Pad Stack > Thermal Relief), overriding the design rules for how a polygon pour joins the via. Omit to follow the rules (the default); a key left out takes Altium's default.",
      +  "properties": {
      +    "air_gap": {
      +      "description": "Gap between the via and the pour in mm. Default: 0.254 (10 mil)",
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "auto_conductors": {
      +      "description": "Let Altium choose the conductor count. Default: false",
      +      "type": "boolean"
      +    },
      +    "conductor_width": {
      +      "description": "Width of each relief conductor in mm. Default: 0.254 (10 mil)",
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "conductors": {
      +      "description": "Number of relief conductors. Default: 4",
      +      "enum": [
      +        2,
      +        4
      +      ],
      +      "maximum": 4,
      +      "minimum": 2,
      +      "type": "integer"
      +    },
      +    "min_distance": {
      +      "description": "Minimum distance used with auto_conductors when min_distance_enabled is set, in mm. Default: 0.381 (15 mil)",
      +      "minimum": 0,
      +      "type": "number"
      +    },
      +    "min_distance_enabled": {
      +      "description": "Apply min_distance (Altium's Min Distance checkbox). Default: false",
      +      "type": "boolean"
      +    },
      +    "rotation": {
      +      "description": "Conductor angle in degrees. Default: 90",
      +      "enum": [
      +        45,
      +        90
      +      ],
      +      "maximum": 90,
      +      "minimum": 45,
      +      "type": "integer"
      +    },
      +    "style": {
      +      "description": "How the pour joins the via. Default: relief",
      +      "enum": [
      +        "relief",
      +        "direct",
      +        "no_connect"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed3 schema fields changedv1.0.5
    • addedInput schema / properties / footprint / properties / additional_parameters
      Added value: +{
      +  "description": "The footprint's Parameters keys other than HEIGHT, captured verbatim on read whenever the block is not the plain five-key block this tool writes from scratch: the PATTERN and DESCRIPTION bytes, the UNICODE twins that carry a name or description outside ASCII, the item and revision GUIDs of a managed footprint, a UI-authored AREA, and any key a newer Altium version writes. Each entry is a [key, value] string pair. Pass back unchanged on a read-modify-write so nothing is dropped (a PATTERN, DESCRIPTION or twin that no longer matches the name or description is rebuilt from it); omit when authoring, or to have the block rebuilt in Altium's current shape.",
      +  "items": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "maxItems": 2,
      +    "minItems": 2,
      +    "type": "array"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / footprint / properties / height
      Added value: +{
      +  "description": "Overall component height in mm — Altium's HEIGHT parameter, written as its mil string. Default: 0",
      +  "minimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / footprint / properties / param_key_order
      Added value: +{
      +  "description": "The footprint's Parameters keys in stored order, as read_pcblib emitted them; the writer replays this order so the block stays byte-faithful. Pass back unchanged; omit when authoring (canonical order).",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / footprint / properties / storage_name
      Added value: +{
      +  "description": "The CFB storage the component was read from, as read_pcblib/read_schlib emit it. Pass it back unchanged on a read-modify-write so the component stays where Altium looks for it (Altium re-derives a short name's storage and maps a long one through SectionKeys, so a moved storage is a component it cannot load); omit when authoring or renaming, and the storage name is derived as Altium would: / \\ : ! * become _, then a cut at 31 characters.",
      +  "type": "string"
      +}
    • addedInput schema / properties / symbol / properties / storage_name
      Added value: +{
      +  "description": "The CFB storage the component was read from, as read_pcblib/read_schlib emit it. Pass it back unchanged on a read-modify-write so the component stays where Altium looks for it (Altium re-derives a short name's storage and maps a long one through SectionKeys, so a moved storage is a component it cannot load); omit when authoring or renaming, and the storage name is derived as Altium would: / \\ : ! * become _, then a cut at 31 characters.",
      +  "type": "string"
      +}
  4. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

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

The description adds rich behavioral context beyond annotations: the object replaces the stored component wholesale (so omitted primitives are removed), name mismatches cause rename or refusal, dry_run reports changes without modifying, and a real run backs up the file, saves, and returns validation results. This fully discloses destructive behavior, aligning with destructiveHint=true without contradicting it.

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?

The description is dense and well-structured, front-loading the core purpose and then covering requirements, behavior, and alternatives in a logical order. It is long, but every sentence adds necessary information (error handling, renaming, dry_run, backup, validation). No redundancy; slightly verbose but justified for a complex 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 complex tool with nested objects and no output schema, the description covers all essential aspects: what it does, prerequisites, error conditions, rename semantics, dry_run behavior, backup/save behavior, and returned fields. It also references the correct starting point (get_component) and clearly explains the differences from siblings. 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 100%, but the description significantly enhances parameter meaning: it explains that footprint/symbol must follow write_pcblib/write_schlib shapes, that component_name is case-insensitive and an error lists available names, and that an object without a name keeps the stored one. It also directs users to use get_component output as a starting point, which is practical guidance beyond the schema.

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 ('Replace one existing component') and resource (Altium library component), with the critical detail that it keeps position in the library. Clearly distinguishes from siblings by naming write_pcblib/write_schlib, batch_update, update_pad/update_primitive, and rename_component as alternatives. The scope is unambiguous.

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 lists alternatives and when each applies: whole-library rewrite via write_pcblib/write_schlib, batch change via batch_update, single primitive via update_pad/update_primitive, rename alone via rename_component. It also tells the user to start from get_component's output when editing, and explains when to use dry_run. Nothing is left to inference.

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