Skip to main content
Glama
FullyDefined – AI for SOLIDWORKS

FullyDefined – AI for SOLIDWORKS

replace_component

Replace a top-level assembly component with another part or assembly file while preserving its position and reporting kept, broken, or lost mates.

Instructions

Replace a top-level component of the active assembly by another part or assembly file. SolidWorks keeps the component's place and re-attaches the mates it can; nothing is fixed silently: the result lists every mate as kept, broken (with its error) or gone, and the new component's name and position. all_instances (default false) replaces every instance of the same file; configuration is the new file's configuration (default its active one; the result says which). A file named like one already in use (another folder) is refused: SolidWorks cannot load both, so copy_file it to a new name first.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "component": "<component>",
      "filepath": "<filepath>"
    },
    "name": "replace_component"
  }
}

Input Schema

NameRequiredDescriptionDefault
filepathYesThe part (.sldprt) or assembly (.sldasm) file to put in its place
componentYesTop-level component name from list_components, e.g. Bracket-2
all_instancesNoReplace every instance of the component's file, not only this one
configurationNoConfiguration of the new file (default its active one)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the entire burden and does so well: it discloses that mates are re-attached where possible, that the result enumerates every mate as kept, broken with its error, or gone, and that the new component's name and position are reported. It also discloses default behaviors for all_instances and configuration and a hard failure mode (duplicate filename) with a concrete workaround.

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 outcome, then defaults, then the failure case and its workaround — a sensible order. It is dense with parentheticals and a single long third sentence, so it reads as packed rather than wasteful; nothing extraneous is present.

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 four-parameter mutation tool with no annotations and no output schema, the description covers action, scope, mate consequences, defaults, expected return contents, and the one known blocking error. An agent has enough to invoke it correctly and to interpret the result without further documentation.

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 description coverage is 100%, so the schema already explains all four parameters including the defaults. The description largely restates those defaults ('all_instances (default false)', 'configuration is the new file's configuration (default its active one)') rather than adding new semantics, though the note that the result reports which configuration was used is mild added value.

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 a top-level component of the active assembly with another part or assembly file. The 'top-level' scope qualifier and the alternative of adding/deleting are clear enough that an agent can distinguish this from add_component, delete_component and copy_file 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 Guidelines4/5

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

Gives a clear triggering context (existing component you want swapped rather than removed) and explicitly routes one edge case to a sibling: a filename collision is refused, so use copy_file first. It does not explicitly contrast with delete_component + add_component, which would be the naive alternative, so it stops short of full when/when-not coverage.

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