Skip to main content
Glama
NejcDvorsek

SolidWorks MCP

by NejcDvorsek

replace_component

Swap a top-level assembly component with another .sldprt or .sldasm in place, automatically reattaching mates where possible and reporting broken mates with candidate faces for remating.

Instructions

Swap a top-level component for another .sldprt or .sldasm, in the same place.

SolidWorks re-attaches each mate to the new part's matching face where it can. Returns the new component, the mates kept, and the mates that broke or went: each with its type, the other components, and what it held on the old part (the face's type, normal or axis and centre in the component's own frame), plus up to three candidate faces on the new part ('#index', nearest first). Re-mate with delete_mate and add_mate(mates=[...]).

Input Schema

NameRequiredDescriptionDefault
pathYes
componentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.16.3

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does so well: it discloses that SolidWorks re-attaches mates best-effort to matching faces, reports which mates were kept versus broken, and returns up to three ranked candidate faces per broken mate. It stops short of saying what happens to the original component file, whether mate failure aborts the swap, or whether the change is undoable.

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?

A front-loaded action sentence followed by return-value detail, which is necessary because there is no output schema. The second sentence is long and nested (face's type, normal or axis and centre, plus candidates), making it harder to scan than it needs to be, but almost every clause earns its place.

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 annotations and no output schema, the description covers the return payload in enough depth to act on, and it names the recovery workflow. The remaining gap is environmental context: whether a document must be active, and what state the model is left in on partial mate failure.

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 has to compensate, and it only partly does: "path" is inferable as the new .sldprt/.sldasm file from context, and "component" as the existing top-level component. It never specifies the expected format of either argument (component name vs. index vs. handle, absolute vs. relative path).

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 opening sentence gives a specific verb (swap), resource (a top-level component), replacement type (.sldprt/.sldasm) and placement constraint (in the same place). That is enough to separate it from insert_component and delete_component 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 Guidelines4/5

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

The closing line, "Re-mate with delete_mate and add_mate(mates=[...])", explicitly routes the agent to the follow-up tools, which is real when/how guidance. It does not, however, state when to prefer this over delete_component plus insert_component, or note prerequisites such as the document being open and the component being top-level.

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