Skip to main content
Glama
SolidWorks MCP Python

SolidWorks MCP Python

by locense

Replace Component

replace_component
DestructiveIdempotent

Swap an assembly component with a different part or assembly file, preserving mates where they fit and optionally replacing every instance of the same file.

Instructions

Swap an assembly component for another part or assembly file.

Use it to try another version of a part (a longer pin, a different motor) without re-inserting and re-mating it. all_instances replaces every instance of the same file, patterned copies included. Mates are kept where they still fit. Needs: an open assembly and the new file. Changes: the component's file. Returns: replace with the replaced instances and their files read back, and the components before and after. A file that doesn't exist fails as invalid_input.

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": {
      "input_data": "<input_data>"
    },
    "name": "replace_component"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYes`component` and `file_path` are required; `all_instances` is off.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes well past the annotations by disclosing what actually changes ("Changes: the component's file"), how mates survive ("Mates are kept where they still fit"), the blast radius of all_instances ("every instance of the same file, patterned copies included"), and the failure mode for a missing file ("fails as `invalid_input`"). This is exactly the mutation context the destructive hint alone does not convey.

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?

Front-loads the core action, then uses compact "Needs / Changes / Returns" blocks so the agent can scan prerequisites, side effects, and output without wading through prose. No redundant sentences.

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 destructive, nested-parameter mutation tool, the definition covers prerequisites, side effects on mates, instance-scope semantics, error behavior, and a summary of the returned payload. With an output schema present, nothing essential is left to inference.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: it clarifies all_instances covers patterned copies and that file_path must resolve to an existing file or the call errors. It does not restate formats for component naming beyond the schema's example.

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 ("Swap an assembly component for another part or assembly file") and implicitly separates itself from insert_component by noting the swap happens "without re-inserting and re-mating it." An agent can distinguish this from the sibling insert tool 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 Guidelines4/5

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

Provides a concrete use case ("try another version of a part (a longer pin, a different motor)") and states prerequisites ("Needs: an open assembly and the new file"). It does not explicitly name a when-not condition or a named alternative tool, so it falls just short of a 5.

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