Skip to content

solidworks_mcp.tools.equations

solidworks_mcp.tools.equations

Equations and global variables: what makes a part parametric.

list_equations, set_equation and delete_equation read and change the active part's or assembly's equations, so one value ("Width" = 60mm) can drive several dimensions ("D1@Sketch1" = "Width" / 2) and the model stays consistent when it changes.

Attributes

_NAME_FORBIDDEN module-attribute

_NAME_FORBIDDEN = ('"', '=', '\n', '\r')

Classes

CompatInput

Bases: BaseModel

Base schema allowing legacy/extra fields used by existing tests.

Attributes:

Name Type Description
model_config Any

The model config value.

EquationNameInput

Bases: CompatInput

Input schema naming one equation.

Attributes:

Name Type Description
name str

The equation's name (its left-hand side).

Methods:
model_post_init
model_post_init(__context: Any) -> None

Refuse a blank name.

Parameters:

Name Type Description Default
__context Any

The context value.

required

Raises:

Type Description
ValueError

The name is blank.

Source code in src/solidworks_mcp/tools/equations.py
def model_post_init(self, __context: Any) -> None:
    """Refuse a blank name.

    Args:
        __context (Any): The context value.

    Raises:
        ValueError: The name is blank.
    """
    if not self.name.strip():
        raise ValueError("name is required")
    self.name = self.name.strip()

SetEquationInput

Bases: CompatInput

Input schema for adding or changing an equation.

Attributes:

Name Type Description
name str

A global variable, or a dimension such as D1@Sketch1.

expression str

The right-hand side.

configurations str | list[str]

Where it applies.

Methods:
model_post_init
model_post_init(__context: Any) -> None

Check the name and expression before anything is written.

Parameters:

Name Type Description Default
__context Any

The context value.

required

Raises:

Type Description
ValueError

A blank name or expression, a name with a quote, = or line break, an expression with a line break, or an empty list of configurations.

Source code in src/solidworks_mcp/tools/equations.py
def model_post_init(self, __context: Any) -> None:
    """Check the name and expression before anything is written.

    Args:
        __context (Any): The context value.

    Raises:
        ValueError: A blank name or expression, a name with a quote, ``=``
            or line break, an expression with a line break, or an empty
            list of configurations.
    """
    if not self.name.strip():
        raise ValueError("name is required")
    if any(c in self.name for c in _NAME_FORBIDDEN):
        raise ValueError(
            f"name {self.name!r} can't hold a double quote, '=' or a line "
            "break; give it without quotes, e.g. Width or D1@Sketch1"
        )
    if not self.expression.strip():
        raise ValueError("expression is required, e.g. 60mm")
    if "\n" in self.expression or "\r" in self.expression:
        raise ValueError("expression must be one line")
    self.name = self.name.strip()
    _check_configurations(self.configurations)

SolidWorksAdapter

SolidWorksAdapter(config: object | None = None)

Bases: ABC

Base adapter interface for SolidWorks integration.

Parameters:

Name Type Description Default
config object | None

Configuration values for the operation. Defaults to None.

None

Attributes:

Name Type Description
_metrics Any

The metrics value.

config Any

The config value.

config_dict Any

The config dict value.

Initialize adapter with configuration.

Parameters:

Name Type Description Default
config object | None

Configuration values for the operation. Defaults to None.

None
Source code in src/solidworks_mcp/adapters/base.py
def __init__(self, config: object | None = None):
    """Initialize adapter with configuration.

    Args:
        config (object | None): Configuration values for the operation. Defaults to None.
    """
    if config is None:
        normalized_config: dict[str, Any] = {}
    elif isinstance(config, Mapping):
        normalized_config = dict(config)
    elif hasattr(config, "model_dump"):
        normalized_config = dict(config.model_dump())
    else:
        normalized_config = {}

    # Preserve original config object for compatibility with tests and
    # call sites that compare object identity/equality.
    self.config = config
    # Keep a normalized mapping for adapter internals.
    self.config_dict = normalized_config
    self._metrics = {
        "operations_count": 0,
        "errors_count": 0,
        "average_response_time": 0.0,
    }
    # SolidWorks-as-Code session logging. Set soc_session_id to enable
    # automatic ToolCallRecord writes for every adapter operation.
    self.soc_session_id: str | None = None
    self.soc_db_path: Path | None = None
Methods:
activate_configuration async
activate_configuration(name: str) -> AdapterResult[dict[str, Any]]

Make a configuration active.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def activate_configuration(
    self,
    name: str,
) -> AdapterResult[dict[str, Any]]:
    """Make a configuration active.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="activate_configuration is not implemented by this adapter",
    )
activate_document async
activate_document(title_or_path: str) -> AdapterResult[dict[str, Any]]

Make an already-open document the active one.

Parameters:

Name Type Description Default
title_or_path str

Title, full path, or file name of an open document.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: What was activated, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def activate_document(
    self, title_or_path: str
) -> AdapterResult[dict[str, Any]]:
    """Make an already-open document the active one.

    Args:
        title_or_path (str): Title, full path, or file name of an open
            document.

    Returns:
        AdapterResult[dict[str, Any]]: What was activated, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="activate_document is not implemented by this adapter",
    )
active_configuration async
active_configuration() -> AdapterResult[str]

Read the active configuration's name.

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def active_configuration(
    self,
) -> AdapterResult[str]:
    """Read the active configuration's name.

    Returns:
        AdapterResult[str]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="active_configuration is not implemented by this adapter",
    )
add_arc async
add_arc(center_x: float, center_y: float, start_x: float, start_y: float, end_x: float, end_y: float, kind: str = 'center', through: tuple[float, float] | None = None) -> AdapterResult[str]

Add an arc to the current sketch.

Parameters:

Name Type Description Default
center_x float

The center x value.

required
center_y float

The center y value.

required
start_x float

The start x value.

required
start_y float

The start y value.

required
end_x float

The end x value.

required
end_y float

The end y value.

required
kind str

center, three_point or tangent.

'center'
through tuple[float, float] | None

A point on a three-point arc.

None

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_arc(
    self,
    center_x: float,
    center_y: float,
    start_x: float,
    start_y: float,
    end_x: float,
    end_y: float,
    kind: str = "center",
    through: tuple[float, float] | None = None,
) -> AdapterResult[str]:
    """Add an arc to the current sketch.

    Args:
        center_x (float): The center x value.
        center_y (float): The center y value.
        start_x (float): The start x value.
        start_y (float): The start y value.
        end_x (float): The end x value.
        end_y (float): The end y value.
        kind (str): ``center``, ``three_point`` or ``tangent``.
        through (tuple[float, float] | None): A point on a three-point arc.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_arc is not implemented by this adapter",
    )
add_balloons async
add_balloons(view_name: str, layout: str = 'square') -> AdapterResult[dict[str, Any]]

Number a drawing view's parts with balloons, one per part.

Parameters:

Name Type Description Default
view_name str

The drawing view.

required
layout str

square, circle, top, bottom, left or right.

'square'

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_balloons(
    self, view_name: str, layout: str = "square"
) -> AdapterResult[dict[str, Any]]:
    """Number a drawing view's parts with balloons, one per part.

    Args:
        view_name (str): The drawing view.
        layout (str): ``square``, ``circle``, ``top``, ``bottom``, ``left`` or ``right``.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_balloons is not implemented by this adapter",
    )
add_centerline async
add_centerline(x1: float, y1: float, x2: float, y2: float) -> AdapterResult[str]

Add a centerline to the current sketch.

Parameters:

Name Type Description Default
x1 float

The x1 value.

required
y1 float

The y1 value.

required
x2 float

The x2 value.

required
y2 float

The y2 value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_centerline(
    self, x1: float, y1: float, x2: float, y2: float
) -> AdapterResult[str]:
    """Add a centerline to the current sketch.

    Args:
        x1 (float): The x1 value.
        y1 (float): The y1 value.
        x2 (float): The x2 value.
        y2 (float): The y2 value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_centerline is not implemented by this adapter",
    )
add_chamfer async
add_chamfer(distance: float, edge_names: list[str], angle: float = 45.0, flip: bool = False) -> AdapterResult[Any]

Add an angle-distance chamfer to the named or selected edges.

At the default 45 degrees both legs equal distance.

Parameters:

Name Type Description Default
distance float

Chamfer distance in millimeters, along one face.

required
edge_names list[str]

List of edge names to chamfer.

required
angle float

Chamfer angle in degrees. Defaults to 45.

45.0
flip bool

Measure distance along the other face.

False

Returns:

Name Type Description
AdapterResult AdapterResult[Any]

Feature result or error.

Source code in src/solidworks_mcp/adapters/base.py
async def add_chamfer(
    self,
    distance: float,
    edge_names: list[str],
    angle: float = 45.0,
    flip: bool = False,
) -> AdapterResult[Any]:
    """Add an angle-distance chamfer to the named or selected edges.

    At the default 45 degrees both legs equal ``distance``.

    Args:
        distance (float): Chamfer distance in millimeters, along one face.
        edge_names (list[str]): List of edge names to chamfer.
        angle (float): Chamfer angle in degrees. Defaults to 45.
        flip (bool): Measure ``distance`` along the other face.

    Returns:
        AdapterResult: Feature result or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_chamfer is not implemented by this adapter",
    )
add_circle abstractmethod async
add_circle(center_x: float, center_y: float, radius: float) -> AdapterResult[str]

Add a circle to the current sketch.

Parameters:

Name Type Description Default
center_x float

The center x value.

required
center_y float

The center y value.

required
radius float

The radius value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def add_circle(
    self, center_x: float, center_y: float, radius: float
) -> AdapterResult[str]:
    """Add a circle to the current sketch.

    Args:
        center_x (float): The center x value.
        center_y (float): The center y value.
        radius (float): The radius value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    pass
add_cosmetic_thread async
add_cosmetic_thread(edge_point: list[float], size: str, diameter: float, end_type: str = 'blind', depth: float | None = None, standard: str = 'iso') -> AdapterResult[dict[str, Any]]

Add a cosmetic thread on a circular edge.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def add_cosmetic_thread(
    self,
    edge_point: list[float],
    size: str,
    diameter: float,
    end_type: str = "blind",
    depth: float | None = None,
    standard: str = "iso",
) -> AdapterResult[dict[str, Any]]:
    """Add a cosmetic thread on a circular edge.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_cosmetic_thread is not implemented by this adapter",
    )
add_datum_tag async
add_datum_tag(label: str, attach_at_mm: tuple[float, float], x_mm: float, y_mm: float) -> AdapterResult[dict[str, Any]]

Add a datum feature symbol on a drawing edge.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def add_datum_tag(
    self,
    label: str,
    attach_at_mm: tuple[float, float],
    x_mm: float,
    y_mm: float,
) -> AdapterResult[dict[str, Any]]:
    """Add a datum feature symbol on a drawing edge.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_datum_tag is not implemented by this adapter",
    )
add_dimension async
add_dimension(dimension_type: str, entity1_point: list[float], position: list[float], entity2_point: list[float] | None = None) -> AdapterResult[dict[str, Any]]

Add one dimension between drawing entities picked at sheet points.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def add_dimension(
    self,
    dimension_type: str,
    entity1_point: list[float],
    position: list[float],
    entity2_point: list[float] | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Add one dimension between drawing entities picked at sheet points.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_dimension is not implemented by this adapter",
    )
add_draft async
add_draft(angle: float, faces: list[list[float]], neutral_face: list[float], reverse: bool = False) -> AdapterResult[dict[str, Any]]

Draft faces against a neutral face.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def add_draft(
    self,
    angle: float,
    faces: list[list[float]],
    neutral_face: list[float],
    reverse: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Draft faces against a neutral face.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_draft is not implemented by this adapter",
    )
add_drawing_view async
add_drawing_view(payload: Any = None) -> AdapterResult[dict[str, Any]]

Add a view of a model to the active drawing sheet.

Parameters:

Name Type Description Default
payload Any

Tool payload carrying the model path, orientation, position in millimetres and optional view scale.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The new view's details, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def add_drawing_view(
    self, payload: Any = None
) -> AdapterResult[dict[str, Any]]:
    """Add a view of a model to the active drawing sheet.

    Args:
        payload (Any): Tool payload carrying the model path, orientation,
            position in millimetres and optional view scale.

    Returns:
        AdapterResult[dict[str, Any]]: The new view's details, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_drawing_view is not implemented by this adapter",
    )
add_edge_flange async
add_edge_flange(edge_point: list[float], length: float, angle: float = 90.0, bend_radius: float | None = None, flip: bool = False) -> AdapterResult[dict[str, Any]]

A flange off the sheet edge nearest a point.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def add_edge_flange(
    self,
    edge_point: list[float],
    length: float,
    angle: float = 90.0,
    bend_radius: float | None = None,
    flip: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """A flange off the sheet edge nearest a point.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_edge_flange is not implemented by this adapter",
    )
add_ellipse async
add_ellipse(center_x: float, center_y: float, major_axis: float, minor_axis: float, angle: float = 0.0) -> AdapterResult[str]

Add an ellipse to the current sketch.

Parameters:

Name Type Description Default
center_x float

The center x value.

required
center_y float

The center y value.

required
major_axis float

The major axis value.

required
minor_axis float

The minor axis value.

required
angle float

The major axis's turn from +x, in degrees.

0.0

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_ellipse(
    self,
    center_x: float,
    center_y: float,
    major_axis: float,
    minor_axis: float,
    angle: float = 0.0,
) -> AdapterResult[str]:
    """Add an ellipse to the current sketch.

    Args:
        center_x (float): The center x value.
        center_y (float): The center y value.
        major_axis (float): The major axis value.
        minor_axis (float): The minor axis value.
        angle (float): The major axis's turn from +x, in degrees.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_ellipse is not implemented by this adapter",
    )
add_fillet async
add_fillet(radius: float, edge_names: list[str]) -> AdapterResult[Any]

Add a fillet feature to selected edges.

Rounds the selected edges of the current solid body with the given radius.

Parameters:

Name Type Description Default
radius float

Fillet radius in millimeters.

required
edge_names list[str]

List of edge names to fillet.

required

Returns:

Name Type Description
AdapterResult AdapterResult[Any]

Feature result or error.

Source code in src/solidworks_mcp/adapters/base.py
async def add_fillet(
    self, radius: float, edge_names: list[str]
) -> AdapterResult[Any]:
    """Add a fillet feature to selected edges.

    Rounds the selected edges of the current solid body with the given radius.

    Args:
        radius (float): Fillet radius in millimeters.
        edge_names (list[str]): List of edge names to fillet.

    Returns:
        AdapterResult: Feature result or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_fillet is not implemented by this adapter",
    )
add_gtol async
add_gtol(characteristic: str, tolerance: float, x_mm: float, y_mm: float, diameter_zone: bool = False, material_condition: str = 'none', datums: list[str] | None = None, attach_at_mm: tuple[float, float] | None = None, dimension: tuple[str, str] | None = None) -> AdapterResult[dict[str, Any]]

Add a GD&T feature control frame to the active drawing.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def add_gtol(
    self,
    characteristic: str,
    tolerance: float,
    x_mm: float,
    y_mm: float,
    diameter_zone: bool = False,
    material_condition: str = "none",
    datums: list[str] | None = None,
    attach_at_mm: tuple[float, float] | None = None,
    dimension: tuple[str, str] | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Add a GD&T feature control frame to the active drawing.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_gtol is not implemented by this adapter",
    )
add_line abstractmethod async
add_line(x1: float, y1: float, x2: float, y2: float) -> AdapterResult[str]

Add a line to the current sketch.

Parameters:

Name Type Description Default
x1 float

The x1 value.

required
y1 float

The y1 value.

required
x2 float

The x2 value.

required
y2 float

The y2 value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def add_line(
    self, x1: float, y1: float, x2: float, y2: float
) -> AdapterResult[str]:
    """Add a line to the current sketch.

    Args:
        x1 (float): The x1 value.
        y1 (float): The y1 value.
        x2 (float): The x2 value.
        y2 (float): The y2 value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    pass
add_mate async
add_mate(component_a: str, component_b: str, entity_a: str = 'Front Plane', entity_b: str = 'Front Plane', mate_type: str = 'coincident', alignment: str = 'aligned', distance: float = 0.0, angle: float = 0.0, face_a: list[float] | None = None, face_b: list[float] | None = None) -> AdapterResult[dict[str, Any]]

Mate two components together in the active assembly.

Parameters:

Name Type Description Default
component_a str

First component instance name.

required
component_b str

Second component instance name.

required
entity_a str

Named feature on the first component. Defaults to "Front Plane".

'Front Plane'
entity_b str

Named feature on the second component. Defaults to "Front Plane".

'Front Plane'
mate_type str

Mate type, e.g. coincident. Defaults to "coincident".

'coincident'
alignment str

aligned, anti_aligned or closest. Defaults to "aligned".

'aligned'
distance float

Distance in millimetres, for a distance mate. Defaults to 0.0.

0.0
angle float

Angle in degrees, for an angle mate. Defaults to 0.0.

0.0
face_a list[float] | None

A point on a face of the first component, in its part coordinates (mm), used instead of entity_a.

None
face_b list[float] | None

The same for the second component.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Mate details, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def add_mate(
    self,
    component_a: str,
    component_b: str,
    entity_a: str = "Front Plane",
    entity_b: str = "Front Plane",
    mate_type: str = "coincident",
    alignment: str = "aligned",
    distance: float = 0.0,
    angle: float = 0.0,
    face_a: list[float] | None = None,
    face_b: list[float] | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Mate two components together in the active assembly.

    Args:
        component_a (str): First component instance name.
        component_b (str): Second component instance name.
        entity_a (str): Named feature on the first component. Defaults to
            "Front Plane".
        entity_b (str): Named feature on the second component. Defaults to
            "Front Plane".
        mate_type (str): Mate type, e.g. ``coincident``. Defaults to
            "coincident".
        alignment (str): ``aligned``, ``anti_aligned`` or ``closest``.
            Defaults to "aligned".
        distance (float): Distance in millimetres, for a distance mate.
            Defaults to 0.0.
        angle (float): Angle in degrees, for an angle mate. Defaults to 0.0.
        face_a (list[float] | None): A point on a face of the first
            component, in its part coordinates (mm), used instead of
            ``entity_a``.
        face_b (list[float] | None): The same for the second component.

    Returns:
        AdapterResult[dict[str, Any]]: Mate details, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_mate is not implemented by this adapter",
    )
add_note async
add_note(payload: Any = None) -> AdapterResult[dict[str, Any]]

Place a text note on the active drawing sheet.

Parameters:

Name Type Description Default
payload Any

Tool payload carrying the note text, its position in millimetres and an optional font size in points.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The note's details, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def add_note(self, payload: Any = None) -> AdapterResult[dict[str, Any]]:
    """Place a text note on the active drawing sheet.

    Args:
        payload (Any): Tool payload carrying the note text, its position in
            millimetres and an optional font size in points.

    Returns:
        AdapterResult[dict[str, Any]]: The note's details, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_note is not implemented by this adapter",
    )
add_polygon async
add_polygon(center_x: float, center_y: float, radius: float, sides: int, angle: float = 0.0) -> AdapterResult[str]

Add a regular polygon to the current sketch.

Parameters:

Name Type Description Default
center_x float

The center x value.

required
center_y float

The center y value.

required
radius float

The radius value.

required
sides int

The sides value.

required
angle float

Degrees the first vertex is turned from +x.

0.0

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_polygon(
    self,
    center_x: float,
    center_y: float,
    radius: float,
    sides: int,
    angle: float = 0.0,
) -> AdapterResult[str]:
    """Add a regular polygon to the current sketch.

    Args:
        center_x (float): The center x value.
        center_y (float): The center y value.
        radius (float): The radius value.
        sides (int): The sides value.
        angle (float): Degrees the first vertex is turned from +x.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_polygon is not implemented by this adapter",
    )
add_rectangle abstractmethod async
add_rectangle(x1: float, y1: float, x2: float, y2: float, from_center: bool = False) -> AdapterResult[str]

Add a rectangle to the current sketch.

Parameters:

Name Type Description Default
x1 float

The x1 value (the centre's, with from_center).

required
y1 float

The y1 value (the centre's, with from_center).

required
x2 float

The x2 value.

required
y2 float

The y2 value.

required
from_center bool

x1/y1 is the centre, x2/y2 a corner.

False

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def add_rectangle(
    self, x1: float, y1: float, x2: float, y2: float, from_center: bool = False
) -> AdapterResult[str]:
    """Add a rectangle to the current sketch.

    Args:
        x1 (float): The x1 value (the centre's, with ``from_center``).
        y1 (float): The y1 value (the centre's, with ``from_center``).
        x2 (float): The x2 value.
        y2 (float): The y2 value.
        from_center (bool): ``x1``/``y1`` is the centre, ``x2``/``y2`` a corner.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    pass
add_sketch_chamfer async
add_sketch_chamfer(corners: list[list[float]], distance: float, distance2: float | None = None, angle: float | None = None) -> AdapterResult[dict[str, Any]]

Bevel sketch corners picked by point.

Parameters:

Name Type Description Default
corners list[list[float]]

[x, y] sketch mm, one per corner.

required
distance float

Distance along the first side, mm.

required
distance2 float | None

Distance along the second side, mm.

None
angle float | None

Angle from the first side, degrees.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: ids (one per corner) and corners.

Source code in src/solidworks_mcp/adapters/base.py
async def add_sketch_chamfer(
    self,
    corners: list[list[float]],
    distance: float,
    distance2: float | None = None,
    angle: float | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Bevel sketch corners picked by point.

    Args:
        corners (list[list[float]]): ``[x, y]`` sketch mm, one per corner.
        distance (float): Distance along the first side, mm.
        distance2 (float | None): Distance along the second side, mm.
        angle (float | None): Angle from the first side, degrees.

    Returns:
        AdapterResult[dict[str, Any]]: ``ids`` (one per corner) and ``corners``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_sketch_chamfer is not implemented by this adapter",
    )
add_sketch_circle async
add_sketch_circle(center_x: float, center_y: float, radius: float, construction: bool = False) -> AdapterResult[str]

Alias for add_circle used by some tool flows.

Parameters:

Name Type Description Default
center_x float

The center x value.

required
center_y float

The center y value.

required
radius float

The radius value.

required
construction bool

The construction value. Defaults to False.

False

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_sketch_circle(
    self,
    center_x: float,
    center_y: float,
    radius: float,
    construction: bool = False,
) -> AdapterResult[str]:
    """Alias for add_circle used by some tool flows.

    Args:
        center_x (float): The center x value.
        center_y (float): The center y value.
        radius (float): The radius value.
        construction (bool): The construction value. Defaults to False.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return await self.add_circle(center_x, center_y, radius)
add_sketch_constraint async
add_sketch_constraint(entity1: str, entity2: str | None, relation_type: str, entity3: str | None = None) -> AdapterResult[str]

Apply a geometric constraint between sketch entities.

Parameters:

Name Type Description Default
entity1 str

The entity1 value.

required
entity2 str | None

The entity2 value.

required
relation_type str

The relation type value.

required
entity3 str | None

Third entity ID — only used by the symmetric relation (the centerline of symmetry). All other relation types reject a non-null entity3.

None

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_sketch_constraint(
    self,
    entity1: str,
    entity2: str | None,
    relation_type: str,
    entity3: str | None = None,
) -> AdapterResult[str]:
    """Apply a geometric constraint between sketch entities.

    Args:
        entity1 (str): The entity1 value.
        entity2 (str | None): The entity2 value.
        relation_type (str): The relation type value.
        entity3 (str | None): Third entity ID — only used by the
            ``symmetric`` relation (the centerline of symmetry). All
            other relation types reject a non-null ``entity3``.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_sketch_constraint is not implemented by this adapter",
    )
add_sketch_dimension async
add_sketch_dimension(entity1: str, entity2: str | None, dimension_type: str, value: float) -> AdapterResult[str]

Add a sketch dimension.

Parameters:

Name Type Description Default
entity1 str

The entity1 value.

required
entity2 str | None

The entity2 value.

required
dimension_type str

The dimension type value.

required
value float

The value value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_sketch_dimension(
    self,
    entity1: str,
    entity2: str | None,
    dimension_type: str,
    value: float,
) -> AdapterResult[str]:
    """Add a sketch dimension.

    Args:
        entity1 (str): The entity1 value.
        entity2 (str | None): The entity2 value.
        dimension_type (str): The dimension type value.
        value (float): The value value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_sketch_dimension is not implemented by this adapter",
    )
add_sketch_fillet async
add_sketch_fillet(corners: list[list[float]], radius: float) -> AdapterResult[dict[str, Any]]

Round sketch corners picked by point.

Parameters:

Name Type Description Default
corners list[list[float]]

[x, y] sketch mm, one per corner.

required
radius float

Fillet radius in mm.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: ids (one per corner) and corners.

Source code in src/solidworks_mcp/adapters/base.py
async def add_sketch_fillet(
    self, corners: list[list[float]], radius: float
) -> AdapterResult[dict[str, Any]]:
    """Round sketch corners picked by point.

    Args:
        corners (list[list[float]]): ``[x, y]`` sketch mm, one per corner.
        radius (float): Fillet radius in mm.

    Returns:
        AdapterResult[dict[str, Any]]: ``ids`` (one per corner) and ``corners``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_sketch_fillet is not implemented by this adapter",
    )
add_sketch_text async
add_sketch_text(text: str, x: float = 0.0, y: float = 0.0, height: float = 3.5, center_at: list[float] | None = None) -> AdapterResult[dict[str, Any]]

Add text to the current sketch.

Parameters:

Name Type Description Default
text str

The text; $PRP:"name" shows a custom property.

required
x float

Start x in mm (sketch coordinates).

0.0
y float

Start y in mm (the baseline).

0.0
height float

Letter height in mm.

3.5
center_at list[float] | None

A model point [x, y, z] in mm for the text's middle.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: id, text and height.

Source code in src/solidworks_mcp/adapters/base.py
async def add_sketch_text(
    self,
    text: str,
    x: float = 0.0,
    y: float = 0.0,
    height: float = 3.5,
    center_at: list[float] | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Add text to the current sketch.

    Args:
        text (str): The text; ``$PRP:"name"`` shows a custom property.
        x (float): Start x in mm (sketch coordinates).
        y (float): Start y in mm (the baseline).
        height (float): Letter height in mm.
        center_at (list[float] | None): A model point [x, y, z] in mm for
            the text's middle.

    Returns:
        AdapterResult[dict[str, Any]]: ``id``, ``text`` and ``height``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_sketch_text is not implemented by this adapter",
    )
add_slot async
add_slot(kind: str, width: float, start: list[float], end: list[float], center: list[float] | None = None) -> AdapterResult[str]

Draw a straight or arc slot.

Parameters:

Name Type Description Default
kind str

straight or arc.

required
width float

Slot width, mm.

required
start list[float]

Straight: first arc centre; arc: start on the arc.

required
end list[float]

Straight: second arc centre; arc: end on the arc.

required
center list[float] | None

Arc slot: the arc's centre.

None

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The slot's id.

Source code in src/solidworks_mcp/adapters/base.py
async def add_slot(
    self,
    kind: str,
    width: float,
    start: list[float],
    end: list[float],
    center: list[float] | None = None,
) -> AdapterResult[str]:
    """Draw a straight or arc slot.

    Args:
        kind (str): ``straight`` or ``arc``.
        width (float): Slot width, mm.
        start (list[float]): Straight: first arc centre; arc: start on the arc.
        end (list[float]): Straight: second arc centre; arc: end on the arc.
        center (list[float] | None): Arc slot: the arc's centre.

    Returns:
        AdapterResult[str]: The slot's id.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_slot is not implemented by this adapter",
    )
add_spline async
add_spline(points: list[dict[str, float]]) -> AdapterResult[str]

Add a spline through the provided points.

Parameters:

Name Type Description Default
points list[dict[str, float]]

The points value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def add_spline(self, points: list[dict[str, float]]) -> AdapterResult[str]:
    """Add a spline through the provided points.

    Args:
        points (list[dict[str, float]]): The points value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="add_spline is not implemented by this adapter",
    )
arrange_dimensions async
arrange_dimensions(view_name: str | None = None) -> AdapterResult[dict[str, Any]]

Move drawing dimensions so none overlaps, then verify.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def arrange_dimensions(
    self,
    view_name: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Move drawing dimensions so none overlaps, then verify.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="arrange_dimensions is not implemented by this adapter",
    )
auto_center_marks async
auto_center_marks(view_name: str, mark_holes: bool = True, mark_fillets: bool = False, mark_slots: bool = True) -> AdapterResult[dict[str, Any]]

Auto-insert centre marks on circular features in a drawing view.

Parameters:

Name Type Description Default
view_name str

Name of a view on the active drawing.

required
mark_holes bool

Mark holes / bores.

True
mark_fillets bool

Mark fillets.

False
mark_slots bool

Mark slots.

True

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The view and before/after centre-mark

AdapterResult[dict[str, Any]]

counts, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def auto_center_marks(
    self,
    view_name: str,
    mark_holes: bool = True,
    mark_fillets: bool = False,
    mark_slots: bool = True,
) -> AdapterResult[dict[str, Any]]:
    """Auto-insert centre marks on circular features in a drawing view.

    Args:
        view_name (str): Name of a view on the active drawing.
        mark_holes (bool): Mark holes / bores.
        mark_fillets (bool): Mark fillets.
        mark_slots (bool): Mark slots.

    Returns:
        AdapterResult[dict[str, Any]]: The view and before/after centre-mark
        counts, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="auto_center_marks is not implemented by this adapter",
    )
auto_dimension_view async
auto_dimension_view(view: str, scheme: str = 'baseline') -> AdapterResult[dict[str, Any]]

Auto-dimension one drawing view.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def auto_dimension_view(
    self,
    view: str,
    scheme: str = "baseline",
) -> AdapterResult[dict[str, Any]]:
    """Auto-dimension one drawing view.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="auto_dimension_view is not implemented by this adapter",
    )
check_interference async
check_interference(params: Any = None) -> AdapterResult[dict[str, Any]]

Check the active assembly for interfering components.

Parameters:

Name Type Description Default
params Any

Optional settings; coincident, components.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Interference details, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def check_interference(
    self, params: Any = None
) -> AdapterResult[dict[str, Any]]:
    """Check the active assembly for interfering components.

    Args:
        params (Any): Optional settings; ``coincident``, ``components``.

    Returns:
        AdapterResult[dict[str, Any]]: Interference details, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="check_interference is not implemented by this adapter",
    )
check_sketch_fully_defined async
check_sketch_fully_defined(sketch_name: str | None = None) -> AdapterResult[dict[str, Any]]

Check whether a sketch is fully defined.

Parameters:

Name Type Description Default
sketch_name str | None

Optional sketch name to inspect. Defaults to None.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Definition status payload.

Source code in src/solidworks_mcp/adapters/base.py
async def check_sketch_fully_defined(
    self, sketch_name: str | None = None
) -> AdapterResult[dict[str, Any]]:
    """Check whether a sketch is fully defined.

    Args:
        sketch_name (str | None): Optional sketch name to inspect. Defaults to None.

    Returns:
        AdapterResult[dict[str, Any]]: Definition status payload.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="check_sketch_fully_defined is not implemented by this adapter",
    )
close_model abstractmethod async
close_model(save: bool = False) -> AdapterResult[None]

Close the current model.

Parameters:

Name Type Description Default
save bool

The save value. Defaults to False.

False

Returns:

Type Description
AdapterResult[None]

AdapterResult[None]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def close_model(self, save: bool = False) -> AdapterResult[None]:
    """Close the current model.

    Args:
        save (bool): The save value. Defaults to False.

    Returns:
        AdapterResult[None]: The result produced by the operation.
    """
    pass
connect abstractmethod async
connect() -> None

Connect to SolidWorks application.

Returns:

Name Type Description
None None

None.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def connect(self) -> None:
    """Connect to SolidWorks application.

    Returns:
        None: None.
    """
    pass
create_assembly abstractmethod async
create_assembly(name: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]

Create a new assembly document.

Parameters:

Name Type Description Default
name str | None

The name value. Defaults to None.

None
template str | None

Template file path. Defaults to None.

None

Returns:

Type Description
AdapterResult[SolidWorksModel]

AdapterResult[SolidWorksModel]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def create_assembly(
    self, name: str | None = None, template: str | None = None
) -> AdapterResult[SolidWorksModel]:
    """Create a new assembly document.

    Args:
        name (str | None): The name value. Defaults to None.
        template (str | None): Template file path. Defaults to None.

    Returns:
        AdapterResult[SolidWorksModel]: The result produced by the operation.
    """
    pass
create_axis async
create_axis(reference: str) -> AdapterResult[dict[str, Any]]

Create a reference axis along a principal direction.

Parameters:

Name Type Description Default
reference str

"x", "y" or "z" (case-insensitive, leading ± stripped).

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The plane pair used and feature counts, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def create_axis(self, reference: str) -> AdapterResult[dict[str, Any]]:
    """Create a reference axis along a principal direction.

    Args:
        reference (str): "x", "y" or "z" (case-insensitive, leading +/- stripped).

    Returns:
        AdapterResult[dict[str, Any]]: The plane pair used and feature counts, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_axis is not implemented by this adapter",
    )
create_base_flange async
create_base_flange(thickness: float, bend_radius: float, k_factor: float = 0.5, depth: float | None = None, sketch: str | None = None, reverse: bool = False) -> AdapterResult[dict[str, Any]]

A sheet-metal base flange from a sketch.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def create_base_flange(
    self,
    thickness: float,
    bend_radius: float,
    k_factor: float = 0.5,
    depth: float | None = None,
    sketch: str | None = None,
    reverse: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """A sheet-metal base flange from a sketch.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_base_flange is not implemented by this adapter",
    )
create_configuration async
create_configuration(name: str, parent: str | None = None, description: str = '', activate: bool = False) -> AdapterResult[dict[str, Any]]

Add a configuration to the active model.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def create_configuration(
    self,
    name: str,
    parent: str | None = None,
    description: str = "",
    activate: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Add a configuration to the active model.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_configuration is not implemented by this adapter",
    )
create_cut async
create_cut(sketch_name: str, depth: float) -> AdapterResult[str]

Create a cut feature from an existing sketch.

Parameters:

Name Type Description Default
sketch_name str

The sketch name value.

required
depth float

The depth value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def create_cut(self, sketch_name: str, depth: float) -> AdapterResult[str]:
    """Create a cut feature from an existing sketch.

    Args:
        sketch_name (str): The sketch name value.
        depth (float): The depth value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_cut is not implemented by this adapter",
    )
create_cut_extrude async
create_cut_extrude(params: ExtrusionParameters) -> AdapterResult[Any]

Create a cut-extrude feature from the active sketch.

Cuts material from the current solid body using the active sketch profile. Equivalent to SolidWorks Insert > Cut > Extrude.

Parameters:

Name Type Description Default
params ExtrusionParameters

Depth and direction parameters.

required

Returns:

Name Type Description
AdapterResult AdapterResult[Any]

Feature result or error.

Source code in src/solidworks_mcp/adapters/base.py
async def create_cut_extrude(
    self, params: ExtrusionParameters
) -> AdapterResult[Any]:
    """Create a cut-extrude feature from the active sketch.

    Cuts material from the current solid body using the active sketch profile.
    Equivalent to SolidWorks Insert > Cut > Extrude.

    Args:
        params (ExtrusionParameters): Depth and direction parameters.

    Returns:
        AdapterResult: Feature result or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_cut_extrude is not implemented by this adapter",
    )
create_detail_view async
create_detail_view(view: str, center: list[float], radius: float, position: list[float], scale: str = '2:1', label: str | None = None) -> AdapterResult[dict[str, Any]]

Add a detail view of a circle in a drawing view.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def create_detail_view(
    self,
    view: str,
    center: list[float],
    radius: float,
    position: list[float],
    scale: str = "2:1",
    label: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Add a detail view of a circle in a drawing view.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_detail_view is not implemented by this adapter",
    )
create_drawing abstractmethod async
create_drawing(name: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]

Create a new drawing document.

Parameters:

Name Type Description Default
name str | None

The name value. Defaults to None.

None
template str | None

Template file path. Defaults to None.

None

Returns:

Type Description
AdapterResult[SolidWorksModel]

AdapterResult[SolidWorksModel]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def create_drawing(
    self, name: str | None = None, template: str | None = None
) -> AdapterResult[SolidWorksModel]:
    """Create a new drawing document.

    Args:
        name (str | None): The name value. Defaults to None.
        template (str | None): Template file path. Defaults to None.

    Returns:
        AdapterResult[SolidWorksModel]: The result produced by the operation.
    """
    pass
create_drawing_view async
create_drawing_view(payload: Any = None) -> AdapterResult[dict[str, Any]]

Place a view of a model on the active drawing sheet.

Parameters:

Name Type Description Default
payload Any

Tool payload carrying the model path, orientation, position in millimetres and optional view scale.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The new view's details, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def create_drawing_view(
    self, payload: Any = None
) -> AdapterResult[dict[str, Any]]:
    """Place a view of a model on the active drawing sheet.

    Args:
        payload (Any): Tool payload carrying the model path, orientation,
            position in millimetres and optional view scale.

    Returns:
        AdapterResult[dict[str, Any]]: The new view's details, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_drawing_view is not implemented by this adapter",
    )
create_exploded_view async
create_exploded_view(steps: list[dict[str, Any]] | None = None) -> AdapterResult[dict[str, Any]]

Explode the active assembly, automatically or step by step, and show it.

Parameters:

Name Type Description Default
steps list[dict[str, Any]] | None

components, direction, distance, reverse; none explodes it automatically.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def create_exploded_view(
    self, steps: list[dict[str, Any]] | None = None
) -> AdapterResult[dict[str, Any]]:
    """Explode the active assembly, automatically or step by step, and show it.

    Args:
        steps (list[dict[str, Any]] | None): ``components``, ``direction``, ``distance``, ``reverse``; none explodes it automatically.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_exploded_view is not implemented by this adapter",
    )
create_extrusion abstractmethod async
create_extrusion(params: ExtrusionParameters) -> AdapterResult[SolidWorksFeature]

Create an extrusion feature.

Parameters:

Name Type Description Default
params ExtrusionParameters

The params value.

required

Returns:

Type Description
AdapterResult[SolidWorksFeature]

AdapterResult[SolidWorksFeature]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def create_extrusion(
    self, params: ExtrusionParameters
) -> AdapterResult[SolidWorksFeature]:
    """Create an extrusion feature.

    Args:
        params (ExtrusionParameters): The params value.

    Returns:
        AdapterResult[SolidWorksFeature]: The result produced by the operation.
    """
    pass
create_hole async
create_hole(face_point: list[float], hole_type: str, standard: str, size: str, end_condition: str = 'through_all', depth: float | None = None, positions: list[list[float]] | None = None, fastener: str | None = None) -> AdapterResult[dict[str, Any]]

Add a Hole Wizard hole at a point on a flat face.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def create_hole(
    self,
    face_point: list[float],
    hole_type: str,
    standard: str,
    size: str,
    end_condition: str = "through_all",
    depth: float | None = None,
    positions: list[list[float]] | None = None,
    fastener: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Add a Hole Wizard hole at a point on a flat face.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_hole is not implemented by this adapter",
    )
create_loft abstractmethod async
create_loft(params: LoftParameters) -> AdapterResult[SolidWorksFeature]

Create a loft feature.

Parameters:

Name Type Description Default
params LoftParameters

The params value.

required

Returns:

Type Description
AdapterResult[SolidWorksFeature]

AdapterResult[SolidWorksFeature]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def create_loft(
    self, params: LoftParameters
) -> AdapterResult[SolidWorksFeature]:
    """Create a loft feature.

    Args:
        params (LoftParameters): The params value.

    Returns:
        AdapterResult[SolidWorksFeature]: The result produced by the operation.
    """
    pass
create_part abstractmethod async
create_part(name: str | None = None, units: str | None = None, template: str | None = None) -> AdapterResult[SolidWorksModel]

Create a new part document.

Parameters:

Name Type Description Default
name str | None

The name value. Defaults to None.

None
units str | None

The units value. Defaults to None.

None
template str | None

Template file path. Defaults to None.

None

Returns:

Type Description
AdapterResult[SolidWorksModel]

AdapterResult[SolidWorksModel]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def create_part(
    self,
    name: str | None = None,
    units: str | None = None,
    template: str | None = None,
) -> AdapterResult[SolidWorksModel]:
    """Create a new part document.

    Args:
        name (str | None): The name value. Defaults to None.
        units (str | None): The units value. Defaults to None.
        template (str | None): Template file path. Defaults to None.

    Returns:
        AdapterResult[SolidWorksModel]: The result produced by the operation.
    """
    pass
create_reference_plane async
create_reference_plane(reference: str, offset: float = 0.0, angle: float = 0.0, flip: bool = False, axis: str | None = None, face_point: list[float] | None = None) -> AdapterResult[dict[str, Any]]

Create a reference plane offset from, angled to, or on a plane or face.

Parameters:

Name Type Description Default
reference str

Name of the reference plane.

required
offset float

Offset distance in millimetres. Defaults to 0.0.

0.0
angle float

Angle in degrees about axis. Defaults to 0.0.

0.0
flip bool

Reverse the offset or angle direction. Defaults to False.

False
axis str | None

Named axis to rotate about; needed with angle.

None
face_point list[float] | None

[x, y, z] mm on a flat face to use as the reference instead of reference.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The new plane's name and parameters, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def create_reference_plane(
    self,
    reference: str,
    offset: float = 0.0,
    angle: float = 0.0,
    flip: bool = False,
    axis: str | None = None,
    face_point: list[float] | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Create a reference plane offset from, angled to, or on a plane or face.

    Args:
        reference (str): Name of the reference plane.
        offset (float): Offset distance in millimetres. Defaults to 0.0.
        angle (float): Angle in degrees about ``axis``. Defaults to 0.0.
        flip (bool): Reverse the offset or angle direction. Defaults to False.
        axis (str | None): Named axis to rotate about; needed with ``angle``.
        face_point (list[float] | None): ``[x, y, z]`` mm on a flat face to
            use as the reference instead of ``reference``.

    Returns:
        AdapterResult[dict[str, Any]]: The new plane's name and parameters, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_reference_plane is not implemented by this adapter",
    )
create_reference_point async
create_reference_point(mode: str, x: float, y: float, z: float, distance: float | None = None, percent: float | None = None) -> AdapterResult[dict[str, Any]]

Create a reference point on the active part.

Parameters:

Name Type Description Default
mode str

"along_curve" or "face_center".

required
x float

X of a point on the target edge/face, in millimetres.

required
y float

Y of a point on the target edge/face, in millimetres.

required
z float

Z of a point on the target edge/face, in millimetres.

required
distance float | None

For "along_curve", offset from the edge start in millimetres.

None
percent float | None

For "along_curve", position as 0-100 of the edge length.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The mode and feature counts, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def create_reference_point(
    self,
    mode: str,
    x: float,
    y: float,
    z: float,
    distance: float | None = None,
    percent: float | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Create a reference point on the active part.

    Args:
        mode (str): "along_curve" or "face_center".
        x (float): X of a point on the target edge/face, in millimetres.
        y (float): Y of a point on the target edge/face, in millimetres.
        z (float): Z of a point on the target edge/face, in millimetres.
        distance (float | None): For "along_curve", offset from the edge
            start in millimetres.
        percent (float | None): For "along_curve", position as 0-100 of
            the edge length.

    Returns:
        AdapterResult[dict[str, Any]]: The mode and feature counts, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_reference_point is not implemented by this adapter",
    )
create_revolve abstractmethod async
create_revolve(params: RevolveParameters) -> AdapterResult[SolidWorksFeature]

Create a revolve feature.

Parameters:

Name Type Description Default
params RevolveParameters

The params value.

required

Returns:

Type Description
AdapterResult[SolidWorksFeature]

AdapterResult[SolidWorksFeature]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def create_revolve(
    self, params: RevolveParameters
) -> AdapterResult[SolidWorksFeature]:
    """Create a revolve feature.

    Args:
        params (RevolveParameters): The params value.

    Returns:
        AdapterResult[SolidWorksFeature]: The result produced by the operation.
    """
    pass
create_rib async
create_rib(sketch: str, thickness: float, both_sides: bool = True, flip_material: bool = False, normal_to_sketch: bool = False) -> AdapterResult[dict[str, Any]]

Add a rib from an open sketch.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def create_rib(
    self,
    sketch: str,
    thickness: float,
    both_sides: bool = True,
    flip_material: bool = False,
    normal_to_sketch: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Add a rib from an open sketch.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_rib is not implemented by this adapter",
    )
create_section_view async
create_section_view(view: str, line_start: list[float], line_end: list[float], position: list[float], label: str | None = None) -> AdapterResult[dict[str, Any]]

Add a section view cut along a line across a drawing view.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def create_section_view(
    self,
    view: str,
    line_start: list[float],
    line_end: list[float],
    position: list[float],
    label: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Add a section view cut along a line across a drawing view.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_section_view is not implemented by this adapter",
    )
create_shell async
create_shell(thickness: float, faces: list[list[float]], outward: bool = False) -> AdapterResult[dict[str, Any]]

Hollow the body to a wall thickness.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def create_shell(
    self,
    thickness: float,
    faces: list[list[float]],
    outward: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Hollow the body to a wall thickness.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_shell is not implemented by this adapter",
    )
create_sketch abstractmethod async
create_sketch(plane: str | None, face_point: tuple[float, float, float] | None = None) -> AdapterResult[str]

Create a new sketch on a plane, or on the flat face at a point.

Parameters:

Name Type Description Default
plane str | None

The plane's name; None when face_point is given.

required
face_point tuple[float, float, float] | None

(x, y, z) in mm on a flat face of the active part, in place of plane.

None

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def create_sketch(
    self,
    plane: str | None,
    face_point: tuple[float, float, float] | None = None,
) -> AdapterResult[str]:
    """Create a new sketch on a plane, or on the flat face at a point.

    Args:
        plane (str | None): The plane's name; None when ``face_point`` is given.
        face_point (tuple[float, float, float] | None): ``(x, y, z)`` in mm on
            a flat face of the active part, in place of ``plane``.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    pass
create_sketched_bend async
create_sketched_bend(angle: float = 90.0, bend_radius: float | None = None, sketch: str | None = None, reverse: bool = False) -> AdapterResult[dict[str, Any]]

Bend the sheet along a sketched line.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def create_sketched_bend(
    self,
    angle: float = 90.0,
    bend_radius: float | None = None,
    sketch: str | None = None,
    reverse: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Bend the sheet along a sketched line.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_sketched_bend is not implemented by this adapter",
    )
create_standard_drawing async
create_standard_drawing(model_path: str, output_dir: str | None = None, title: str | None = None, subtitle: str | None = None, drawing_number: str | None = None, author: str = '', revision: str = 'A', company: str = '', drawn_date: str | None = None, notes: list[str] | None = None, include_isometric: bool = True, write_model_properties: bool = True, title_block_text_height_mm: float | None = None, include_bom: bool = False) -> AdapterResult[dict[str, Any]]

Create a complete standard A3 drawing.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def create_standard_drawing(
    self,
    model_path: str,
    output_dir: str | None = None,
    title: str | None = None,
    subtitle: str | None = None,
    drawing_number: str | None = None,
    author: str = "",
    revision: str = "A",
    company: str = "",
    drawn_date: str | None = None,
    notes: list[str] | None = None,
    include_isometric: bool = True,
    write_model_properties: bool = True,
    title_block_text_height_mm: float | None = None,
    include_bom: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Create a complete standard A3 drawing.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_standard_drawing is not implemented by this adapter",
    )
create_sweep abstractmethod async
create_sweep(params: SweepParameters) -> AdapterResult[SolidWorksFeature]

Create a sweep feature.

Parameters:

Name Type Description Default
params SweepParameters

The params value.

required

Returns:

Type Description
AdapterResult[SolidWorksFeature]

AdapterResult[SolidWorksFeature]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def create_sweep(
    self, params: SweepParameters
) -> AdapterResult[SolidWorksFeature]:
    """Create a sweep feature.

    Args:
        params (SweepParameters): The params value.

    Returns:
        AdapterResult[SolidWorksFeature]: The result produced by the operation.
    """
    pass
create_technical_drawing async
create_technical_drawing(payload: Any = None) -> AdapterResult[dict[str, Any]]

Lay out the standard views of a model on the active sheet.

Parameters:

Name Type Description Default
payload Any

Tool payload carrying the model path and the projection angle.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The view names created, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def create_technical_drawing(
    self, payload: Any = None
) -> AdapterResult[dict[str, Any]]:
    """Lay out the standard views of a model on the active sheet.

    Args:
        payload (Any): Tool payload carrying the model path and the
            projection angle.

    Returns:
        AdapterResult[dict[str, Any]]: The view names created, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="create_technical_drawing is not implemented by this adapter",
    )
delete_configuration async
delete_configuration(name: str) -> AdapterResult[dict[str, Any]]

Delete a configuration.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def delete_configuration(
    self,
    name: str,
) -> AdapterResult[dict[str, Any]]:
    """Delete a configuration.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="delete_configuration is not implemented by this adapter",
    )
delete_equation async
delete_equation(name: str) -> AdapterResult[dict[str, Any]]

Delete the equation for name.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def delete_equation(self, name: str) -> AdapterResult[dict[str, Any]]:
    """Delete the equation for ``name``.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="delete_equation is not implemented by this adapter",
    )
delete_feature async
delete_feature(name: str) -> AdapterResult[dict[str, Any]]

Delete a named feature or sketch from the active model.

Parameters:

Name Type Description Default
name str

Feature or sketch name.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: What was deleted, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def delete_feature(self, name: str) -> AdapterResult[dict[str, Any]]:
    """Delete a named feature or sketch from the active model.

    Args:
        name (str): Feature or sketch name.

    Returns:
        AdapterResult[dict[str, Any]]: What was deleted, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="delete_feature is not implemented by this adapter",
    )
disconnect abstractmethod async
disconnect() -> None

Disconnect from SolidWorks application.

Returns:

Name Type Description
None None

None.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def disconnect(self) -> None:
    """Disconnect from SolidWorks application.

    Returns:
        None: None.
    """
    pass
drawing_report async
drawing_report() -> AdapterResult[dict[str, Any]]

Read what check_drawing judges on the active drawing.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def drawing_report(self) -> AdapterResult[dict[str, Any]]:
    """Read what check_drawing judges on the active drawing.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="drawing_report is not implemented by this adapter",
    )
exit_sketch abstractmethod async
exit_sketch() -> AdapterResult[None]

Exit sketch editing mode.

Returns:

Type Description
AdapterResult[None]

AdapterResult[None]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def exit_sketch(self) -> AdapterResult[None]:
    """Exit sketch editing mode.

    Returns:
        AdapterResult[None]: The result produced by the operation.
    """
    pass
export_file abstractmethod async
export_file(file_path: str, format_type: str) -> AdapterResult[None]

Export the current model to a file.

Parameters:

Name Type Description Default
file_path str

Path to the target file.

required
format_type str

The format type value.

required

Returns:

Type Description
AdapterResult[None]

AdapterResult[None]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def export_file(
    self, file_path: str, format_type: str
) -> AdapterResult[None]:
    """Export the current model to a file.

    Args:
        file_path (str): Path to the target file.
        format_type (str): The format type value.

    Returns:
        AdapterResult[None]: The result produced by the operation.
    """
    pass
export_flat_pattern async
export_flat_pattern(file_path: str) -> AdapterResult[dict[str, Any]]

Export the active sheet-metal part's flat pattern.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def export_flat_pattern(
    self,
    file_path: str,
) -> AdapterResult[dict[str, Any]]:
    """Export the active sheet-metal part's flat pattern.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="export_flat_pattern is not implemented by this adapter",
    )
export_image abstractmethod async
export_image(payload: dict) -> AdapterResult[dict]

Export a viewport screenshot (PNG/JPG) of the current model.

Payload keys: file_path (str): Absolute output path. width (int): Image width in pixels. height (int): Image height in pixels. view_orientation (str): One of "isometric", "front", "top", "right", "back", "bottom", "current".

Parameters:

Name Type Description Default
payload dict

The payload value.

required

Returns:

Type Description
AdapterResult[dict]

AdapterResult[dict]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def export_image(self, payload: dict) -> AdapterResult[dict]:
    """Export a viewport screenshot (PNG/JPG) of the current model.

    Payload keys: file_path (str): Absolute output path. width (int): Image width in pixels.
    height (int): Image height in pixels. view_orientation (str): One of "isometric",
    "front", "top", "right", "back", "bottom", "current".

    Args:
        payload (dict): The payload value.

    Returns:
        AdapterResult[dict]: The result produced by the operation.
    """
    pass
get_application_info async
get_application_info() -> AdapterResult[dict[str, Any]]

Describe the connected SolidWorks without changing anything.

Only file names leave the adapter, never full paths, so the result can be pasted into a public report. A value that cannot be read is None, never guessed.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: revision (e.g. "34.4.0"),

AdapterResult[dict[str, Any]]

language (e.g. "english") and templates: for each of

AdapterResult[dict[str, Any]]

part, assembly and drawing, the default template's

AdapterResult[dict[str, Any]]

file_name and whether the file exists.

Source code in src/solidworks_mcp/adapters/base.py
async def get_application_info(self) -> AdapterResult[dict[str, Any]]:
    """Describe the connected SolidWorks without changing anything.

    Only file names leave the adapter, never full paths, so the result
    can be pasted into a public report. A value that cannot be read is
    ``None``, never guessed.

    Returns:
        AdapterResult[dict[str, Any]]: ``revision`` (e.g. ``"34.4.0"``),
        ``language`` (e.g. ``"english"``) and ``templates``: for each of
        ``part``, ``assembly`` and ``drawing``, the default template's
        ``file_name`` and whether the file ``exists``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="get_application_info is not implemented by this adapter",
    )
get_custom_properties async
get_custom_properties(configuration: str | None = None) -> AdapterResult[dict[str, Any]]

Read the custom properties of the active document.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def get_custom_properties(
    self,
    configuration: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Read the custom properties of the active document.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="get_custom_properties is not implemented by this adapter",
    )
get_dimension abstractmethod async
get_dimension(name: str) -> AdapterResult[dict[str, Any]]

Get the value of a dimension.

Parameters:

Name Type Description Default
name str

The name value.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: value and units (mm, deg or None).

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def get_dimension(self, name: str) -> AdapterResult[dict[str, Any]]:
    """Get the value of a dimension.

    Args:
        name (str): The name value.

    Returns:
        AdapterResult[dict[str, Any]]: ``value`` and ``units`` (mm, deg or None).
    """
    pass
get_mass_properties abstractmethod async
get_mass_properties() -> AdapterResult[MassProperties]

Get mass properties of the current model.

Returns:

Type Description
AdapterResult[MassProperties]

AdapterResult[MassProperties]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def get_mass_properties(self) -> AdapterResult[MassProperties]:
    """Get mass properties of the current model.

    Returns:
        AdapterResult[MassProperties]: The result produced by the operation.
    """
    pass
get_material async
get_material(configuration: str | None = None, material: str | None = None, database: str | None = None) -> AdapterResult[dict[str, Any]]

Read the active part's material and its properties, or a library material's.

Parameters:

Name Type Description Default
configuration str | None

Configuration name; the active one when omitted.

None
material str | None

A library material to read instead of the part's.

None
database str | None

The library to look in first for material.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def get_material(
    self,
    configuration: str | None = None,
    material: str | None = None,
    database: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Read the active part's material and its properties, or a library material's.

    Args:
        configuration: Configuration name; the active one when omitted.
        material: A library material to read instead of the part's.
        database: The library to look in first for ``material``.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="get_material is not implemented by this adapter",
    )
get_metrics
get_metrics() -> dict[str, Any]

Get adapter metrics.

Returns:

Type Description
dict[str, Any]

dict[str, Any]: A dictionary containing the resulting values.

Source code in src/solidworks_mcp/adapters/base.py
def get_metrics(self) -> dict[str, Any]:
    """Get adapter metrics.

    Returns:
        dict[str, Any]: A dictionary containing the resulting values.
    """
    return self._metrics.copy()
get_model_geometry_summary async
get_model_geometry_summary() -> AdapterResult[dict[str, Any]]

Summarise the active part or assembly without changing it.

Must not rebuild the model, modify it, or clear the selection, so callers can read it around a feature call. Values the adapter cannot determine are None, never guessed.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: document_type ("part" or

AdapterResult[dict[str, Any]]

"assembly"), volume_mm3, bounding_box_mm (min,

AdapterResult[dict[str, Any]]

max and size as [x, y, z]), bounding_box_method,

AdapterResult[dict[str, Any]]

solid_body_count, and for assemblies component_count and

AdapterResult[dict[str, Any]]

mate_count. Error when there is no active part or assembly.

Source code in src/solidworks_mcp/adapters/base.py
async def get_model_geometry_summary(self) -> AdapterResult[dict[str, Any]]:
    """Summarise the active part or assembly without changing it.

    Must not rebuild the model, modify it, or clear the selection, so
    callers can read it around a feature call. Values the adapter cannot
    determine are ``None``, never guessed.

    Returns:
        AdapterResult[dict[str, Any]]: ``document_type`` (``"part"`` or
        ``"assembly"``), ``volume_mm3``, ``bounding_box_mm`` (``min``,
        ``max`` and ``size`` as ``[x, y, z]``), ``bounding_box_method``,
        ``solid_body_count``, and for assemblies ``component_count`` and
        ``mate_count``. Error when there is no active part or assembly.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="get_model_geometry_summary is not implemented by this adapter",
    )
get_model_info abstractmethod async
get_model_info() -> AdapterResult[dict[str, Any]]

Get metadata for the active model.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def get_model_info(self) -> AdapterResult[dict[str, Any]]:
    """Get metadata for the active model.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    pass
get_selected_entities async
get_selected_entities() -> AdapterResult[list[dict[str, Any]]]

Report the faces/edges/vertices currently selected in the live UI.

Lets an agent see exactly what the user has clicked on in SolidWorks (e.g. "chamfer THIS face") instead of inferring it from a screenshot.

Returns:

Type Description
AdapterResult[list[dict[str, Any]]]

AdapterResult[list[dict[str, Any]]]: One descriptor per selected

AdapterResult[list[dict[str, Any]]]

entity. See the PyWin32 adapter's implementation for the field

AdapterResult[list[dict[str, Any]]]

set (varies by entity type).

Source code in src/solidworks_mcp/adapters/base.py
async def get_selected_entities(self) -> AdapterResult[list[dict[str, Any]]]:
    """Report the faces/edges/vertices currently selected in the live UI.

    Lets an agent see exactly what the user has clicked on in SolidWorks
    (e.g. "chamfer THIS face") instead of inferring it from a screenshot.

    Returns:
        AdapterResult[list[dict[str, Any]]]: One descriptor per selected
        entity. See the PyWin32 adapter's implementation for the field
        set (varies by entity type).
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="get_selected_entities is not implemented by this adapter",
    )
get_template_folders async
get_template_folders() -> AdapterResult[dict[str, Any]]

SolidWorks' document template folders and the active document's template extension.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def get_template_folders(self) -> AdapterResult[dict[str, Any]]:
    """SolidWorks' document template folders and the active document's template extension.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="get_template_folders is not implemented by this adapter",
    )
health_check abstractmethod async
health_check() -> AdapterHealth

Get adapter health status.

Returns:

Name Type Description
AdapterHealth AdapterHealth

The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def health_check(self) -> AdapterHealth:
    """Get adapter health status.

    Returns:
        AdapterHealth: The result produced by the operation.
    """
    pass
insert_bom_table async
insert_bom_table(view_name: str, template_path: str | None = None, bom_type: str = 'top_level_only', x_mm: float | None = None, y_mm: float | None = None) -> AdapterResult[dict[str, Any]]

Insert a BOM table anchored to an assembly drawing view.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def insert_bom_table(
    self,
    view_name: str,
    template_path: str | None = None,
    bom_type: str = "top_level_only",
    x_mm: float | None = None,
    y_mm: float | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Insert a BOM table anchored to an assembly drawing view.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="insert_bom_table is not implemented by this adapter",
    )
insert_component async
insert_component(file_path: str, x: float = 0.0, y: float = 0.0, z: float = 0.0) -> AdapterResult[dict[str, Any]]

Insert a part or sub-assembly into the active assembly.

Parameters:

Name Type Description Default
file_path str

Absolute path to the .sldprt or .sldasm.

required
x float

X position in millimetres. Defaults to 0.0.

0.0
y float

Y position in millimetres. Defaults to 0.0.

0.0
z float

Z position in millimetres. Defaults to 0.0.

0.0

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Component name and counts, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def insert_component(
    self, file_path: str, x: float = 0.0, y: float = 0.0, z: float = 0.0
) -> AdapterResult[dict[str, Any]]:
    """Insert a part or sub-assembly into the active assembly.

    Args:
        file_path (str): Absolute path to the ``.sldprt`` or ``.sldasm``.
        x (float): X position in millimetres. Defaults to 0.0.
        y (float): Y position in millimetres. Defaults to 0.0.
        z (float): Z position in millimetres. Defaults to 0.0.

    Returns:
        AdapterResult[dict[str, Any]]: Component name and counts, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="insert_component is not implemented by this adapter",
    )
insert_model_dimensions async
insert_model_dimensions(view_name: str | None = None, include_hole_wizard: bool = True) -> AdapterResult[dict[str, Any]]

Bring model dimensions into drawing views.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def insert_model_dimensions(
    self,
    view_name: str | None = None,
    include_hole_wizard: bool = True,
) -> AdapterResult[dict[str, Any]]:
    """Bring model dimensions into drawing views.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="insert_model_dimensions is not implemented by this adapter",
    )
is_connected abstractmethod
is_connected() -> bool

Check if connected to SolidWorks.

Returns:

Name Type Description
bool bool

True if connected, otherwise False.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
def is_connected(self) -> bool:
    """Check if connected to SolidWorks.

    Returns:
        bool: True if connected, otherwise False.
    """
    pass
list_available_materials async
list_available_materials(search: str | None = None) -> AdapterResult[list[dict[str, str]]]

List materials from the configured material libraries.

Returns:

Type Description
AdapterResult[list[dict[str, str]]]

AdapterResult[list[dict[str, str]]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def list_available_materials(
    self,
    search: str | None = None,
) -> AdapterResult[list[dict[str, str]]]:
    """List materials from the configured material libraries.

    Returns:
        AdapterResult[list[dict[str, str]]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="list_available_materials is not implemented by this adapter",
    )
list_components async
list_components() -> AdapterResult[list[str]]

List the top-level components of the active assembly.

Returns:

Type Description
AdapterResult[list[str]]

AdapterResult[list[str]]: Component instance names, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def list_components(self) -> AdapterResult[list[str]]:
    """List the top-level components of the active assembly.

    Returns:
        AdapterResult[list[str]]: Component instance names, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="list_components is not implemented by this adapter",
    )
list_configurations abstractmethod async
list_configurations() -> AdapterResult[list[str]]

List configuration names for the active model.

Returns:

Type Description
AdapterResult[list[str]]

AdapterResult[list[str]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def list_configurations(self) -> AdapterResult[list[str]]:
    """List configuration names for the active model.

    Returns:
        AdapterResult[list[str]]: The result produced by the operation.
    """
    pass
list_drawing_views async
list_drawing_views() -> AdapterResult[list[str]]

List the views on the active drawing.

Returns:

Type Description
AdapterResult[list[str]]

AdapterResult[list[str]]: View names, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def list_drawing_views(self) -> AdapterResult[list[str]]:
    """List the views on the active drawing.

    Returns:
        AdapterResult[list[str]]: View names, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="list_drawing_views is not implemented by this adapter",
    )
list_equations async
list_equations() -> AdapterResult[list[dict[str, Any]]]

List the active model's equations and global variables.

Returns:

Type Description
AdapterResult[list[dict[str, Any]]]

AdapterResult[list[dict[str, Any]]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def list_equations(self) -> AdapterResult[list[dict[str, Any]]]:
    """List the active model's equations and global variables.

    Returns:
        AdapterResult[list[dict[str, Any]]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="list_equations is not implemented by this adapter",
    )
list_features abstractmethod async
list_features(include_suppressed: bool = False, max_assembly_depth: int = 2) -> AdapterResult[list[dict[str, Any]]]

List model features from the feature tree.

For a Part document, returns that document's own feature list, unchanged from prior behavior. For an Assembly document, returns a single flat list containing the assembly's own top-level features plus every resolved component's features, recursing into sub-assemblies up to max_assembly_depth. Every descriptor gains component, component_path, and component_parent keys: None for a document's own features (Part features, or an Assembly's top-level features), or the owning component's name/path for a component-derived feature. component_parent is the immediate parent component name when the component is nested inside a sub-assembly, otherwise None. A component that cannot be resolved (suppressed, lightweight-and-unloaded, missing file) is represented by one descriptor with type: "UnresolvedComponent" instead of being silently dropped.

Parameters:

Name Type Description Default
include_suppressed bool

The include suppressed value. Defaults to False. Applied independently to the assembly's own features and to each component's features.

False
max_assembly_depth int

How many levels of sub-assembly to recurse into. Defaults to 2. Ignored for Part documents. A component beyond the configured depth still appears in the result as a single descriptor (name + path), not expanded.

2

Returns:

Type Description
AdapterResult[list[dict[str, Any]]]

AdapterResult[list[dict[str, Any]]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def list_features(
    self, include_suppressed: bool = False, max_assembly_depth: int = 2
) -> AdapterResult[list[dict[str, Any]]]:
    """List model features from the feature tree.

    For a Part document, returns that document's own feature list,
    unchanged from prior behavior. For an Assembly document, returns a
    single flat list containing the assembly's own top-level features
    plus every resolved component's features, recursing into
    sub-assemblies up to ``max_assembly_depth``. Every descriptor gains
    ``component``, ``component_path``, and ``component_parent`` keys:
    ``None`` for a document's own features (Part features, or an Assembly's
    top-level features), or the owning component's name/path for a
    component-derived feature. ``component_parent`` is the immediate parent
    component name when the component is nested inside a sub-assembly,
    otherwise ``None``. A component that cannot be resolved (suppressed,
    lightweight-and-unloaded, missing file) is represented by one descriptor
    with ``type: "UnresolvedComponent"`` instead of being silently dropped.

    Args:
        include_suppressed (bool): The include suppressed value. Defaults to False.
            Applied independently to the assembly's own features and to
            each component's features.
        max_assembly_depth (int): How many levels of sub-assembly to
            recurse into. Defaults to 2. Ignored for Part documents. A
            component beyond the configured depth still appears in the
            result as a single descriptor (name + path), not expanded.

    Returns:
        AdapterResult[list[dict[str, Any]]]: The result produced by the operation.
    """
    pass
list_hole_sizes async
list_hole_sizes(standard: str, hole_type: str, fastener: str | None = None, size: str | None = None) -> AdapterResult[dict[str, Any]]

List the Hole Wizard hole types and sizes of a standard.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def list_hole_sizes(
    self,
    standard: str,
    hole_type: str,
    fastener: str | None = None,
    size: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """List the Hole Wizard hole types and sizes of a standard.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="list_hole_sizes is not implemented by this adapter",
    )
list_model_dimensions async
list_model_dimensions(feature_name: str | None = None) -> AdapterResult[list[dict[str, Any]]]

List every dimension in the active part or assembly.

Returns:

Type Description
AdapterResult[list[dict[str, Any]]]

AdapterResult[list[dict[str, Any]]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def list_model_dimensions(
    self,
    feature_name: str | None = None,
) -> AdapterResult[list[dict[str, Any]]]:
    """List every dimension in the active part or assembly.

    Returns:
        AdapterResult[list[dict[str, Any]]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="list_model_dimensions is not implemented by this adapter",
    )
list_open_documents async
list_open_documents() -> AdapterResult[list[dict[str, Any]]]

Enumerate every document currently open in SolidWorks.

Returns:

Type Description
AdapterResult[list[dict[str, Any]]]

AdapterResult[list[dict[str, Any]]]: One entry per open document

AdapterResult[list[dict[str, Any]]]

(title, path, type, is_active), or error.

Source code in src/solidworks_mcp/adapters/base.py
async def list_open_documents(self) -> AdapterResult[list[dict[str, Any]]]:
    """Enumerate every document currently open in SolidWorks.

    Returns:
        AdapterResult[list[dict[str, Any]]]: One entry per open document
        (``title``, ``path``, ``type``, ``is_active``), or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="list_open_documents is not implemented by this adapter",
    )
measure_entities async
measure_entities(entities: list[str]) -> AdapterResult[dict[str, Any]]

Measure one or two selected entities.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def measure_entities(
    self,
    entities: list[str],
) -> AdapterResult[dict[str, Any]]:
    """Measure one or two selected entities.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="measure_entities is not implemented by this adapter",
    )
mirror_components async
mirror_components(components: list[str], plane: str) -> AdapterResult[dict[str, Any]]

Mirror components about a plane, as instances of the same parts.

Parameters:

Name Type Description Default
components list[str]

Instance names.

required
plane str

The plane's name.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def mirror_components(
    self, components: list[str], plane: str
) -> AdapterResult[dict[str, Any]]:
    """Mirror components about a plane, as instances of the same parts.

    Args:
        components (list[str]): Instance names.
        plane (str): The plane's name.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="mirror_components is not implemented by this adapter",
    )
mirror_feature async
mirror_feature(features: list[str], mirror_plane: str, merge: bool = True, mirror_bodies: bool = True) -> AdapterResult[dict[str, Any]]

Mirror solid bodies or features about a plane.

Parameters:

Name Type Description Default
features list[str]

Body or feature names to mirror.

required
mirror_plane str

Plane name to mirror about.

required
merge bool

Merge the mirrored result with the original. Defaults to True.

True
mirror_bodies bool

Mirror whole bodies rather than features. Defaults to True.

True

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The mirror feature's name, inputs and volume

AdapterResult[dict[str, Any]]

before/after, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def mirror_feature(
    self,
    features: list[str],
    mirror_plane: str,
    merge: bool = True,
    mirror_bodies: bool = True,
) -> AdapterResult[dict[str, Any]]:
    """Mirror solid bodies or features about a plane.

    Args:
        features (list[str]): Body or feature names to mirror.
        mirror_plane (str): Plane name to mirror about.
        merge (bool): Merge the mirrored result with the original. Defaults to True.
        mirror_bodies (bool): Mirror whole bodies rather than features. Defaults to True.

    Returns:
        AdapterResult[dict[str, Any]]: The mirror feature's name, inputs and volume
        before/after, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="mirror_feature is not implemented by this adapter",
    )
open_model abstractmethod async
open_model(file_path: str) -> AdapterResult[SolidWorksModel]

Open a SolidWorks model (part, assembly, or drawing).

Parameters:

Name Type Description Default
file_path str

Path to the target file.

required

Returns:

Type Description
AdapterResult[SolidWorksModel]

AdapterResult[SolidWorksModel]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def open_model(self, file_path: str) -> AdapterResult[SolidWorksModel]:
    """Open a SolidWorks model (part, assembly, or drawing).

    Args:
        file_path (str): Path to the target file.

    Returns:
        AdapterResult[SolidWorksModel]: The result produced by the operation.
    """
    pass
pack_and_go_assembly async
pack_and_go_assembly(source_path: str, target_dir: str) -> AdapterResult[dict[str, Any]]

Copy an assembly and every file it uses into one folder.

Parameters:

Name Type Description Default
source_path str

The .sldasm file.

required
target_dir str

The folder to copy into.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def pack_and_go_assembly(
    self, source_path: str, target_dir: str
) -> AdapterResult[dict[str, Any]]:
    """Copy an assembly and every file it uses into one folder.

    Args:
        source_path (str): The ``.sldasm`` file.
        target_dir (str): The folder to copy into.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="pack_and_go_assembly is not implemented by this adapter",
    )
pattern_circular async
pattern_circular(features: list[str], axis: str, count: int, angle: float = 360.0, equal_spacing: bool = True) -> AdapterResult[dict[str, Any]]

Pattern features around an axis.

Parameters:

Name Type Description Default
features list[str]

Names of the features to pattern.

required
axis str

Name of the axis to rotate about.

required
count int

Total number of instances including the original.

required
angle float

Total angle in degrees to spread them over. Defaults to 360.0.

360.0
equal_spacing bool

Space instances evenly across angle. Defaults to True.

True

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: What was patterned and the volume

AdapterResult[dict[str, Any]]

before/after, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def pattern_circular(
    self,
    features: list[str],
    axis: str,
    count: int,
    angle: float = 360.0,
    equal_spacing: bool = True,
) -> AdapterResult[dict[str, Any]]:
    """Pattern features around an axis.

    Args:
        features (list[str]): Names of the features to pattern.
        axis (str): Name of the axis to rotate about.
        count (int): Total number of instances including the original.
        angle (float): Total angle in degrees to spread them over. Defaults to 360.0.
        equal_spacing (bool): Space instances evenly across ``angle``. Defaults to True.

    Returns:
        AdapterResult[dict[str, Any]]: What was patterned and the volume
        before/after, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="pattern_circular is not implemented by this adapter",
    )
pattern_components async
pattern_components(components: list[str], axis: str, count: int, kind: str = 'linear', spacing: float | None = None, angle: float | None = None) -> AdapterResult[dict[str, Any]]

Repeat components along or around a reference axis.

Parameters:

Name Type Description Default
components list[str]

The seed components' instance names.

required
axis str

A reference axis's name.

required
count int

Instances, the seeds included.

required
kind str

linear or circular.

'linear'
spacing float | None

Linear spacing, mm.

None
angle float | None

Circular angle, degrees.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def pattern_components(
    self,
    components: list[str],
    axis: str,
    count: int,
    kind: str = "linear",
    spacing: float | None = None,
    angle: float | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Repeat components along or around a reference axis.

    Args:
        components (list[str]): The seed components' instance names.
        axis (str): A reference axis's name.
        count (int): Instances, the seeds included.
        kind (str): ``linear`` or ``circular``.
        spacing (float | None): Linear spacing, mm.
        angle (float | None): Circular angle, degrees.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="pattern_components is not implemented by this adapter",
    )
pattern_linear async
pattern_linear(features: list[str], direction: list[float] | str, count: int, spacing: float, direction2: list[float] | str | None = None, count2: int = 1, spacing2: float = 0.0, reverse: bool = False, reverse2: bool = False) -> AdapterResult[dict[str, Any]]

Repeat features along one or two directions.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def pattern_linear(
    self,
    features: list[str],
    direction: list[float] | str,
    count: int,
    spacing: float,
    direction2: list[float] | str | None = None,
    count2: int = 1,
    spacing2: float = 0.0,
    reverse: bool = False,
    reverse2: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Repeat features along one or two directions.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="pattern_linear is not implemented by this adapter",
    )
rebuild_model async
rebuild_model(top_level_only: bool = False) -> AdapterResult[dict[str, Any]]

Force a rebuild and report per-feature rebuild errors.

Parameters:

Name Type Description Default
top_level_only bool

Rebuild only the top level of an assembly. Defaults to False (full rebuild).

False

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: rebuilt, top_level_only,

AdapterResult[dict[str, Any]]

errors (one entry per failing feature with feature,

AdapterResult[dict[str, Any]]

type, code, code_name, severity, description,

AdapterResult[dict[str, Any]]

parents, hint), error_count and warning_count.

AdapterResult[dict[str, Any]]

ERROR (still carrying data) when any error-severity entry

AdapterResult[dict[str, Any]]

remains.

Source code in src/solidworks_mcp/adapters/base.py
async def rebuild_model(
    self, top_level_only: bool = False
) -> AdapterResult[dict[str, Any]]:
    """Force a rebuild and report per-feature rebuild errors.

    Args:
        top_level_only (bool): Rebuild only the top level of an assembly.
            Defaults to False (full rebuild).

    Returns:
        AdapterResult[dict[str, Any]]: ``rebuilt``, ``top_level_only``,
        ``errors`` (one entry per failing feature with ``feature``,
        ``type``, ``code``, ``code_name``, ``severity``, ``description``,
        ``parents``, ``hint``), ``error_count`` and ``warning_count``.
        ERROR (still carrying ``data``) when any error-severity entry
        remains.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="rebuild_model is not implemented by this adapter",
    )
rename_feature async
rename_feature(old_name: str, new_name: str) -> AdapterResult[dict[str, Any]]

Rename an existing feature on the feature tree.

Parameters:

Name Type Description Default
old_name str

Current feature name.

required
new_name str

New feature name.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The old and new names, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def rename_feature(
    self, old_name: str, new_name: str
) -> AdapterResult[dict[str, Any]]:
    """Rename an existing feature on the feature tree.

    Args:
        old_name (str): Current feature name.
        new_name (str): New feature name.

    Returns:
        AdapterResult[dict[str, Any]]: The old and new names, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="rename_feature is not implemented by this adapter",
    )
replace_component async
replace_component(component: str, file_path: str, all_instances: bool = False) -> AdapterResult[dict[str, Any]]

Swap a component for another part or assembly file.

Parameters:

Name Type Description Default
component str

The instance name.

required
file_path str

The part or assembly to put in its place.

required
all_instances bool

Replace every instance of the same file.

False

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def replace_component(
    self, component: str, file_path: str, all_instances: bool = False
) -> AdapterResult[dict[str, Any]]:
    """Swap a component for another part or assembly file.

    Args:
        component (str): The instance name.
        file_path (str): The part or assembly to put in its place.
        all_instances (bool): Replace every instance of the same file.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="replace_component is not implemented by this adapter",
    )
reset_circuit_breakers async
reset_circuit_breakers(operation: str | None = None) -> AdapterResult[dict[str, list[str]]]

Re-open operations a circuit breaker paused.

An adapter without a circuit breaker has nothing paused; the breaker and the connection pool override this.

Parameters:

Name Type Description Default
operation str | None

The operation to reset; None resets every one.

None

Returns:

Type Description
AdapterResult[dict[str, list[str]]]

AdapterResult[dict[str, list[str]]]: reset, the operations that were paused.

Source code in src/solidworks_mcp/adapters/base.py
async def reset_circuit_breakers(
    self, operation: str | None = None
) -> AdapterResult[dict[str, list[str]]]:
    """Re-open operations a circuit breaker paused.

    An adapter without a circuit breaker has nothing paused; the breaker
    and the connection pool override this.

    Args:
        operation: The operation to reset; ``None`` resets every one.

    Returns:
        AdapterResult[dict[str, list[str]]]: ``reset``, the operations that were paused.
    """
    return AdapterResult(status=AdapterResultStatus.SUCCESS, data={"reset": []})
save_as_template async
save_as_template(file_path: str) -> AdapterResult[dict[str, Any]]

Save a copy of the active document as a template.

Parameters:

Name Type Description Default
file_path str

The template's full path, with the document's template extension (.prtdot, .asmdot or .drwdot).

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def save_as_template(self, file_path: str) -> AdapterResult[dict[str, Any]]:
    """Save a copy of the active document as a template.

    Args:
        file_path: The template's full path, with the document's template
            extension (.prtdot, .asmdot or .drwdot).

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="save_as_template is not implemented by this adapter",
    )
save_body_as_part async
save_body_as_part(body_name: str, file_path: str) -> AdapterResult[dict[str, Any]]

Extract one solid body from the active multibody part to a new file.

Parameters:

Name Type Description Default
body_name str

Name of a solid body in the active part.

required
file_path str

Absolute path for the new .sldprt.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The body, the written path, and the

AdapterResult[dict[str, Any]]

solid-body names found, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def save_body_as_part(
    self, body_name: str, file_path: str
) -> AdapterResult[dict[str, Any]]:
    """Extract one solid body from the active multibody part to a new file.

    Args:
        body_name (str): Name of a solid body in the active part.
        file_path (str): Absolute path for the new ``.sldprt``.

    Returns:
        AdapterResult[dict[str, Any]]: The body, the written path, and the
        solid-body names found, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="save_body_as_part is not implemented by this adapter",
    )
save_copy async
save_copy(file_path: str) -> AdapterResult[dict[str, Any]]

Write a copy of the active document and keep the original open.

Parameters:

Name Type Description Default
file_path str

Where to write the copy.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def save_copy(self, file_path: str) -> AdapterResult[dict[str, Any]]:
    """Write a copy of the active document and keep the original open.

    Args:
        file_path (str): Where to write the copy.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="save_copy is not implemented by this adapter",
    )
save_file async
save_file(file_path: str | None = None) -> AdapterResult[Any]

Save the active model to the existing path or the provided path.

Parameters:

Name Type Description Default
file_path str | None

Path to the target file. Defaults to None.

None

Returns:

Type Description
AdapterResult[Any]

AdapterResult[Any]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def save_file(self, file_path: str | None = None) -> AdapterResult[Any]:
    """Save the active model to the existing path or the provided path.

    Args:
        file_path (str | None): Path to the target file. Defaults to None.

    Returns:
        AdapterResult[Any]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="save_file is not implemented by this adapter",
    )
select_face_edges async
select_face_edges(point: list[float] | None = None, side: str | None = None, plane: str | None = None, edge_type: str = 'all', append: bool = False) -> AdapterResult[dict[str, Any]]

Multi-select every edge bounding one face of the active part.

Exactly one of point/side/plane identifies the face.

Parameters:

Name Type Description Default
point list[float] | None

[x, y, z] in mm on the face.

None
side str | None

+X..-Z or top/bottom/front/back/ right/left; the furthest planar face facing that way.

None
plane str | None

Reference plane name; the body face(s) lying on it.

None
edge_type str

all, linear or circular.

'all'
append bool

Add to the current selection. Defaults to False.

False

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: face (or faces), edges

AdapterResult[dict[str, Any]]

(one descriptor per selected edge) and selection_count.

Source code in src/solidworks_mcp/adapters/base.py
async def select_face_edges(
    self,
    point: list[float] | None = None,
    side: str | None = None,
    plane: str | None = None,
    edge_type: str = "all",
    append: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Multi-select every edge bounding one face of the active part.

    Exactly one of ``point``/``side``/``plane`` identifies the face.

    Args:
        point (list[float] | None): ``[x, y, z]`` in mm on the face.
        side (str | None): ``+X``..``-Z`` or ``top/bottom/front/back/
            right/left``; the furthest planar face facing that way.
        plane (str | None): Reference plane name; the body face(s) lying
            on it.
        edge_type (str): ``all``, ``linear`` or ``circular``.
        append (bool): Add to the current selection. Defaults to False.

    Returns:
        AdapterResult[dict[str, Any]]: ``face`` (or ``faces``), ``edges``
        (one descriptor per selected edge) and ``selection_count``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="select_face_edges is not implemented by this adapter",
    )
select_feature async
select_feature(feature_name: str, append: bool = False) -> AdapterResult[dict[str, Any]]

Select a named feature, sketch, plane or component.

Parameters:

Name Type Description Default
feature_name str

The feature name, optionally @document qualified.

required
append bool

Add to the current selection instead of replacing it. Defaults to False.

False

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: On success selected (True),

AdapterResult[dict[str, Any]]

feature_name, selected_name, entity_type and

AdapterResult[dict[str, Any]]

selection_count. ERROR when nothing could be selected - never

AdapterResult[dict[str, Any]]

SUCCESS with selected: False.

Source code in src/solidworks_mcp/adapters/base.py
async def select_feature(
    self, feature_name: str, append: bool = False
) -> AdapterResult[dict[str, Any]]:
    """Select a named feature, sketch, plane or component.

    Args:
        feature_name (str): The feature name, optionally ``@document``
            qualified.
        append (bool): Add to the current selection instead of replacing
            it. Defaults to False.

    Returns:
        AdapterResult[dict[str, Any]]: On success ``selected`` (True),
        ``feature_name``, ``selected_name``, ``entity_type`` and
        ``selection_count``. ERROR when nothing could be selected - never
        SUCCESS with ``selected: False``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="select_feature is not implemented by this adapter",
    )
set_component_appearance async
set_component_appearance(component: str, visible: bool | None = None, transparent: bool | None = None) -> AdapterResult[dict[str, Any]]

Hide or show a component, and make it transparent or opaque.

Parameters:

Name Type Description Default
component str

The instance name.

required
visible bool | None

Show (True) or hide (False).

None
transparent bool | None

Transparent or opaque.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def set_component_appearance(
    self,
    component: str,
    visible: bool | None = None,
    transparent: bool | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Hide or show a component, and make it transparent or opaque.

    Args:
        component (str): The instance name.
        visible (bool | None): Show (``True``) or hide (``False``).
        transparent (bool | None): Transparent or opaque.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_component_appearance is not implemented by this adapter",
    )
set_component_state async
set_component_state(component: str, fixed: bool | None = None, flexible: bool | None = None) -> AdapterResult[dict[str, Any]]

Fix or float a component, and make a sub-assembly rigid or flexible.

Parameters:

Name Type Description Default
component str

Instance name, as list_components reports it.

required
fixed bool | None

True fixes it, False floats it.

None
flexible bool | None

True flexible, False rigid.

None

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The state before and after, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def set_component_state(
    self,
    component: str,
    fixed: bool | None = None,
    flexible: bool | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Fix or float a component, and make a sub-assembly rigid or flexible.

    Args:
        component (str): Instance name, as ``list_components`` reports it.
        fixed (bool | None): True fixes it, False floats it.
        flexible (bool | None): True flexible, False rigid.

    Returns:
        AdapterResult[dict[str, Any]]: The state before and after, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_component_state is not implemented by this adapter",
    )
set_construction_geometry async
set_construction_geometry(entities: list[str], construction: bool = True) -> AdapterResult[dict[str, Any]]

Make sketch entities construction geometry, or normal again.

Parameters:

Name Type Description Default
entities list[str]

Sketch entity ids.

required
construction bool

True for construction, False for normal.

True

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: entities (id to state) and

AdapterResult[dict[str, Any]]

construction.

Source code in src/solidworks_mcp/adapters/base.py
async def set_construction_geometry(
    self, entities: list[str], construction: bool = True
) -> AdapterResult[dict[str, Any]]:
    """Make sketch entities construction geometry, or normal again.

    Args:
        entities (list[str]): Sketch entity ids.
        construction (bool): ``True`` for construction, ``False`` for normal.

    Returns:
        AdapterResult[dict[str, Any]]: ``entities`` (id to state) and
        ``construction``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_construction_geometry is not implemented by this adapter",
    )
set_custom_property async
set_custom_property(name: str, value: str, configuration: str | None = None) -> AdapterResult[dict[str, Any]]

Create or overwrite one custom property.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def set_custom_property(
    self,
    name: str,
    value: str,
    configuration: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Create or overwrite one custom property.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_custom_property is not implemented by this adapter",
    )
set_dimension abstractmethod async
set_dimension(name: str, value: float, configurations: str | list[str] = 'this') -> AdapterResult[dict[str, Any]]

Set the value of a dimension.

Parameters:

Name Type Description Default
name str

The name value.

required
value float

The value value.

required
configurations str | list[str]

"this", "all" or names.

'this'

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: configurations, the names set in.

Source code in src/solidworks_mcp/adapters/base.py
@abstractmethod
async def set_dimension(
    self, name: str, value: float, configurations: str | list[str] = "this"
) -> AdapterResult[dict[str, Any]]:
    """Set the value of a dimension.

    Args:
        name (str): The name value.
        value (float): The value value.
        configurations (str | list[str]): "this", "all" or names.

    Returns:
        AdapterResult[dict[str, Any]]: ``configurations``, the names set in.
    """
    pass
set_equation async
set_equation(name: str, expression: str, configurations: str | list[str] = 'all') -> AdapterResult[dict[str, Any]]

Add an equation, or change the one name has.

Parameters:

Name Type Description Default
name str

A global variable or a dimension (D1@Sketch1).

required
expression str

The right-hand side.

required
configurations str | list[str]

"all", "this" or names.

'all'

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def set_equation(
    self,
    name: str,
    expression: str,
    configurations: str | list[str] = "all",
) -> AdapterResult[dict[str, Any]]:
    """Add an equation, or change the one ``name`` has.

    Args:
        name (str): A global variable or a dimension (``D1@Sketch1``).
        expression (str): The right-hand side.
        configurations (str | list[str]): "all", "this" or names.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_equation is not implemented by this adapter",
    )
set_exploded_view async
set_exploded_view(exploded: bool) -> AdapterResult[dict[str, Any]]

Show the assembly's exploded view, or collapse it.

Parameters:

Name Type Description Default
exploded bool

True explodes, False collapses.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def set_exploded_view(self, exploded: bool) -> AdapterResult[dict[str, Any]]:
    """Show the assembly's exploded view, or collapse it.

    Args:
        exploded (bool): ``True`` explodes, ``False`` collapses.

    Returns:
        AdapterResult[dict[str, Any]]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_exploded_view is not implemented by this adapter",
    )
set_flat_pattern async
set_flat_pattern(flat: bool) -> AdapterResult[dict[str, Any]]

Flatten the sheet-metal part, or fold it back.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def set_flat_pattern(self, flat: bool) -> AdapterResult[dict[str, Any]]:
    """Flatten the sheet-metal part, or fold it back.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_flat_pattern is not implemented by this adapter",
    )
set_material async
set_material(material_name: str, database: str | None = None, configuration: str | None = None) -> AdapterResult[dict[str, Any]]

Assign a material to the active part.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def set_material(
    self,
    material_name: str,
    database: str | None = None,
    configuration: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Assign a material to the active part.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_material is not implemented by this adapter",
    )
set_sheet_scale async
set_sheet_scale(numerator: float, denominator: float) -> AdapterResult[dict[str, Any]]

Set the active drawing sheet's scale.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Error unless the adapter implements it.

Source code in src/solidworks_mcp/adapters/base.py
async def set_sheet_scale(
    self,
    numerator: float,
    denominator: float,
) -> AdapterResult[dict[str, Any]]:
    """Set the active drawing sheet's scale.

    Returns:
        AdapterResult[dict[str, Any]]: Error unless the adapter implements it.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_sheet_scale is not implemented by this adapter",
    )
set_sketch_text async
set_sketch_text(sketch_name: str, text: str) -> AdapterResult[dict[str, Any]]

Rewrite the text in a sketch, with the sketch open, then rebuild.

Parameters:

Name Type Description Default
sketch_name str

The sketch, e.g. Sketch12.

required
text str

The new text.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: sketch, before and after.

Source code in src/solidworks_mcp/adapters/base.py
async def set_sketch_text(
    self, sketch_name: str, text: str
) -> AdapterResult[dict[str, Any]]:
    """Rewrite the text in a sketch, with the sketch open, then rebuild.

    Args:
        sketch_name (str): The sketch, e.g. ``Sketch12``.
        text (str): The new text.

    Returns:
        AdapterResult[dict[str, Any]]: ``sketch``, ``before`` and ``after``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_sketch_text is not implemented by this adapter",
    )
set_units async
set_units(unit_system: str) -> AdapterResult[dict[str, Any]]

Set the active document's linear unit system.

Parameters:

Name Type Description Default
unit_system str

One of mm, cm, m, in, ft.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: What was applied, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def set_units(self, unit_system: str) -> AdapterResult[dict[str, Any]]:
    """Set the active document's linear unit system.

    Args:
        unit_system (str): One of ``mm``, ``cm``, ``m``, ``in``, ``ft``.

    Returns:
        AdapterResult[dict[str, Any]]: What was applied, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="set_units is not implemented by this adapter",
    )
sketch_circular_pattern async
sketch_circular_pattern(entities: list[str], angle: float, count: int) -> AdapterResult[str]

Create a circular pattern of sketch entities around the sketch origin.

The rotation axis is always the sketch origin — SW's CreateCircularSketchStepAndRepeat has no pattern-centre parameter and derives the axis from the seed's geometry. Place the seed entity at the desired radius from the origin.

Parameters:

Name Type Description Default
entities list[str]

The entities value.

required
angle float

The angle value.

required
count int

The count value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def sketch_circular_pattern(
    self,
    entities: list[str],
    angle: float,
    count: int,
) -> AdapterResult[str]:
    """Create a circular pattern of sketch entities around the sketch origin.

    The rotation axis is always the sketch origin — SW's
    ``CreateCircularSketchStepAndRepeat`` has no pattern-centre
    parameter and derives the axis from the seed's geometry. Place
    the seed entity at the desired radius from the origin.

    Args:
        entities (list[str]): The entities value.
        angle (float): The angle value.
        count (int): The count value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="sketch_circular_pattern is not implemented by this adapter",
    )
sketch_convert_entities async
sketch_convert_entities(edge_points: list[list[float]] | None = None, face_point: list[float] | None = None, construction: bool = False) -> AdapterResult[dict[str, Any]]

Copy model edges or a face outline into the open sketch.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def sketch_convert_entities(
    self,
    edge_points: list[list[float]] | None = None,
    face_point: list[float] | None = None,
    construction: bool = False,
) -> AdapterResult[dict[str, Any]]:
    """Copy model edges or a face outline into the open sketch.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="sketch_convert_entities is not implemented by this adapter",
    )
sketch_extend async
sketch_extend(point: list[float]) -> AdapterResult[dict[str, Any]]

Extend a sketch entity from its end nearest a point.

Parameters:

Name Type Description Default
point list[float]

[x, y] sketch mm near the end to extend.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: point, segments_before and

AdapterResult[dict[str, Any]]

segments_after.

Source code in src/solidworks_mcp/adapters/base.py
async def sketch_extend(self, point: list[float]) -> AdapterResult[dict[str, Any]]:
    """Extend a sketch entity from its end nearest a point.

    Args:
        point (list[float]): ``[x, y]`` sketch mm near the end to extend.

    Returns:
        AdapterResult[dict[str, Any]]: ``point``, ``segments_before`` and
        ``segments_after``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="sketch_extend is not implemented by this adapter",
    )
sketch_linear_pattern async
sketch_linear_pattern(entities: list[str], direction_x: float, direction_y: float, spacing: float, count: int) -> AdapterResult[str]

Create a linear pattern of sketch entities.

Parameters:

Name Type Description Default
entities list[str]

The entities value.

required
direction_x float

The direction x value.

required
direction_y float

The direction y value.

required
spacing float

The spacing value.

required
count int

The count value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def sketch_linear_pattern(
    self,
    entities: list[str],
    direction_x: float,
    direction_y: float,
    spacing: float,
    count: int,
) -> AdapterResult[str]:
    """Create a linear pattern of sketch entities.

    Args:
        entities (list[str]): The entities value.
        direction_x (float): The direction x value.
        direction_y (float): The direction y value.
        spacing (float): The spacing value.
        count (int): The count value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="sketch_linear_pattern is not implemented by this adapter",
    )
sketch_mirror async
sketch_mirror(entities: list[str], mirror_line: str) -> AdapterResult[str]

Mirror sketch entities about a mirror line.

Parameters:

Name Type Description Default
entities list[str]

The entities value.

required
mirror_line str

The mirror line value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def sketch_mirror(
    self, entities: list[str], mirror_line: str
) -> AdapterResult[str]:
    """Mirror sketch entities about a mirror line.

    Args:
        entities (list[str]): The entities value.
        mirror_line (str): The mirror line value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="sketch_mirror is not implemented by this adapter",
    )
sketch_offset async
sketch_offset(entities: list[str], offset_distance: float, reverse_direction: bool) -> AdapterResult[str]

Offset sketch entities.

Parameters:

Name Type Description Default
entities list[str]

The entities value.

required
offset_distance float

The offset distance value.

required
reverse_direction bool

The reverse direction value.

required

Returns:

Type Description
AdapterResult[str]

AdapterResult[str]: The result produced by the operation.

Source code in src/solidworks_mcp/adapters/base.py
async def sketch_offset(
    self,
    entities: list[str],
    offset_distance: float,
    reverse_direction: bool,
) -> AdapterResult[str]:
    """Offset sketch entities.

    Args:
        entities (list[str]): The entities value.
        offset_distance (float): The offset distance value.
        reverse_direction (bool): The reverse direction value.

    Returns:
        AdapterResult[str]: The result produced by the operation.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="sketch_offset is not implemented by this adapter",
    )
sketch_trim async
sketch_trim(point: list[float]) -> AdapterResult[dict[str, Any]]

Trim the piece of a sketch entity nearest a point.

Parameters:

Name Type Description Default
point list[float]

[x, y] sketch mm on the piece to remove.

required

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: point, segments_before and

AdapterResult[dict[str, Any]]

segments_after.

Source code in src/solidworks_mcp/adapters/base.py
async def sketch_trim(self, point: list[float]) -> AdapterResult[dict[str, Any]]:
    """Trim the piece of a sketch entity nearest a point.

    Args:
        point (list[float]): ``[x, y]`` sketch mm on the piece to remove.

    Returns:
        AdapterResult[dict[str, Any]]: ``point``, ``segments_before`` and
        ``segments_after``.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="sketch_trim is not implemented by this adapter",
    )
suppress_feature async
suppress_feature(name: str, suppress: bool = True, configurations: str | list[str] = 'this') -> AdapterResult[dict[str, Any]]

Suppress or unsuppress a named feature.

Parameters:

Name Type Description Default
name str

Feature name.

required
suppress bool

True to suppress, False to unsuppress.

True
configurations str | list[str]

"this", "all" or names.

'this'

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: The resulting state, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def suppress_feature(
    self, name: str, suppress: bool = True, configurations: str | list[str] = "this"
) -> AdapterResult[dict[str, Any]]:
    """Suppress or unsuppress a named feature.

    Args:
        name (str): Feature name.
        suppress (bool): True to suppress, False to unsuppress.
        configurations (str | list[str]): "this", "all" or names.

    Returns:
        AdapterResult[dict[str, Any]]: The resulting state, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="suppress_feature is not implemented by this adapter",
    )
undo async
undo(count: int = 1) -> AdapterResult[dict[str, Any]]

Undo the last operations in the active model.

Parameters:

Name Type Description Default
count int

Number of steps to undo.

1

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Whether the tree changed, or error.

Source code in src/solidworks_mcp/adapters/base.py
async def undo(self, count: int = 1) -> AdapterResult[dict[str, Any]]:
    """Undo the last operations in the active model.

    Args:
        count (int): Number of steps to undo.

    Returns:
        AdapterResult[dict[str, Any]]: Whether the tree changed, or error.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="undo is not implemented by this adapter",
    )
update_metrics
update_metrics(operation_time: float, success: bool) -> None

Update adapter metrics.

Parameters:

Name Type Description Default
operation_time float

The operation time value.

required
success bool

The success value.

required

Returns:

Name Type Description
None None

None.

Source code in src/solidworks_mcp/adapters/base.py
def update_metrics(self, operation_time: float, success: bool) -> None:
    """Update adapter metrics.

    Args:
        operation_time (float): The operation time value.
        success (bool): The success value.

    Returns:
        None: None.
    """
    self._metrics["operations_count"] += 1
    if not success:
        self._metrics["errors_count"] += 1

    # Update average response time
    current_avg = self._metrics["average_response_time"]
    count = self._metrics["operations_count"]
    self._metrics["average_response_time"] = (
        current_avg * (count - 1) + operation_time
    ) / count
update_sheet_format async
update_sheet_format(sheet_format: str, paper_size: str | None = None) -> AdapterResult[dict[str, Any]]

Change the active sheet's format and paper size, keeping its views.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def update_sheet_format(
    self,
    sheet_format: str,
    paper_size: str | None = None,
) -> AdapterResult[dict[str, Any]]:
    """Change the active sheet's format and paper size, keeping its views.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="update_sheet_format is not implemented by this adapter",
    )
update_title_block async
update_title_block(fields: dict[str, str]) -> AdapterResult[dict[str, Any]]

Write title-block fields on the active drawing.

Returns:

Type Description
AdapterResult[dict[str, Any]]

AdapterResult[dict[str, Any]]: Not implemented by this adapter.

Source code in src/solidworks_mcp/adapters/base.py
async def update_title_block(
    self,
    fields: dict[str, str],
) -> AdapterResult[dict[str, Any]]:
    """Write title-block fields on the active drawing.

    Returns:
        AdapterResult[dict[str, Any]]: Not implemented by this adapter.
    """
    return AdapterResult(
        status=AdapterResultStatus.ERROR,
        error="update_title_block is not implemented by this adapter",
    )

Functions:

_check_configurations

_check_configurations(configurations: str | list[str]) -> None

A list of configuration names must name at least one, each non-blank.

Raises:

Type Description
ValueError

For an empty list or a blank name.

Source code in src/solidworks_mcp/tools/modeling.py
def _check_configurations(configurations: str | list[str]) -> None:
    """A list of configuration names must name at least one, each non-blank.

    Raises:
        ValueError: For an empty list or a blank name.
    """
    if isinstance(configurations, list) and (
        not configurations or any(not str(n).strip() for n in configurations)
    ):
        raise ValueError(
            "configurations is 'this', 'all' or a list of configuration names"
        )

normalize_input

normalize_input(input_data: Any, model_type: type[TModel]) -> TModel

Validate input_data as model_type.

Parameters:

Name Type Description Default
input_data Any

A model_type instance, a mapping of its fields, another pydantic model (converted through model_dump), or None for a tool whose fields all have defaults.

required
model_type type[TModel]

The tool's pydantic input model.

required

Returns:

Name Type Description
TModel TModel

The validated model.

Raises:

Type Description
InvalidInputError

Naming the offending field(s).

Source code in src/solidworks_mcp/tools/tool_boundary.py
def normalize_input[TModel: BaseModel](
    input_data: Any, model_type: type[TModel]
) -> TModel:
    """Validate ``input_data`` as ``model_type``.

    Args:
        input_data: A ``model_type`` instance, a mapping of its fields, another
            pydantic model (converted through ``model_dump``), or ``None`` for
            a tool whose fields all have defaults.
        model_type: The tool's pydantic input model.

    Returns:
        TModel: The validated model.

    Raises:
        InvalidInputError: Naming the offending field(s).
    """
    if isinstance(input_data, model_type):
        return input_data
    if input_data is None:
        input_data = {}
    elif not isinstance(input_data, dict) and hasattr(input_data, "model_dump"):
        input_data = input_data.model_dump()
    try:
        return model_type.model_validate(input_data)
    except ValidationError as exc:  # also wraps ValueErrors from validators
        raise InvalidInputError(describe_validation_error(exc)) from exc

register_equation_tools async

register_equation_tools(mcp: FastMCP, adapter: SolidWorksAdapter, config: Any) -> int

Register the equation tools with FastMCP.

Parameters:

Name Type Description Default
mcp FastMCP

The mcp value.

required
adapter SolidWorksAdapter

Adapter instance used for the operation.

required
config Any

Configuration values for the operation.

required

Returns:

Name Type Description
int int

How many tools were registered.

Source code in src/solidworks_mcp/tools/equations.py
async def register_equation_tools(
    mcp: FastMCP, adapter: SolidWorksAdapter, config: Any
) -> int:
    """Register the equation tools with FastMCP.

    Args:
        mcp (FastMCP): The mcp value.
        adapter (SolidWorksAdapter): Adapter instance used for the operation.
        config (Any): Configuration values for the operation.

    Returns:
        int: How many tools were registered.
    """
    mcp = with_tool_boundary(mcp)

    @mcp.tool()
    async def list_equations() -> dict[str, Any]:
        """List the active part's or assembly's equations and global variables, with their values.

        Use it before `set_equation` or `delete_equation`, to see which values
        drive which dimensions. Needs: an open part or assembly. Read-only.
        Returns: `equations`, each with `index`, `name`, `expression`, `kind`
        (`global_variable`, `dimension` or `other`) and `value` (solved, in the
        document's units; null when SolidWorks has none), and `count`.
        """
        require_capability(
            adapter, "list_equations", "Active adapter can't read equations"
        )
        result = await adapter.list_equations()
        require_success(result, "Failed to list equations")
        rows = result.data or []
        return {
            "status": "success",
            "equations": rows,
            "count": len(rows),
            "execution_time": result.execution_time,
        }

    @mcp.tool()
    async def set_equation(input_data: SetEquationInput) -> dict[str, Any]:
        """Add or change an equation or global variable, so one value drives others (a parametric part).

        E.g. `Width` = `60mm`, then `D1@Sketch1` = `"Width" / 2`: changing `Width`
        later resizes the sketch. A `name` with `@` is a dimension of the active
        document (`list_model_dimensions`); any other is a global variable. An
        existing equation for `name` is changed, else one is added; the model
        is solved and rebuilt. Applies in all configurations unless
        `configurations` says otherwise. An expression SolidWorks can't use
        fails as `equation_refused`, changing nothing. Needs: an open part or
        assembly. Changes: the equation and what it drives. Returns:
        `equation` with `name`, `expression`, `kind`, `value` (document units),
        `action` (`added` or `changed`) and `configurations`.

        Args:
            input_data: `name` and `expression` are required; `configurations`
                defaults to `all`.

        Returns:
            dict[str, Any]: The equation as SolidWorks stored it.
        """
        input_data = normalize_input(input_data, SetEquationInput)
        require_capability(
            adapter, "set_equation", "Active adapter can't change equations"
        )
        result = await adapter.set_equation(
            input_data.name, input_data.expression, input_data.configurations
        )
        require_success(result, "Failed to set equation")
        data = result.data or {}
        return {
            "status": "success",
            "message": f"{str(data.get('action', 'set')).capitalize()} "
            f"{input_data.name} = {input_data.expression.strip()}",
            "equation": data,
            "execution_time": result.execution_time,
        }

    @mcp.tool()
    async def delete_equation(input_data: EquationNameInput) -> dict[str, Any]:
        """Delete an equation or global variable of the active part or assembly, by name.

        A dimension the equation drove keeps its last value; an equation that
        used a deleted global variable stops solving, so check
        `list_equations` afterwards. Needs: an open part or assembly with that
        equation. Changes: removes the equation. Returns: `deleted` and the
        `equations` left (names).

        Args:
            input_data: `name`, as `list_equations` gives it.

        Returns:
            dict[str, Any]: The deleted name and those left.
        """
        input_data = normalize_input(input_data, EquationNameInput)
        require_capability(
            adapter, "delete_equation", "Active adapter can't delete equations"
        )
        result = await adapter.delete_equation(input_data.name)
        require_success(result, "Failed to delete equation")
        data = result.data or {}
        return {
            "status": "success",
            "message": f"Deleted equation {data.get('deleted', input_data.name)}",
            "deleted": data.get("deleted"),
            "equations": data.get("equations", []),
            "execution_time": result.execution_time,
        }

    return 3

require_capability

require_capability(adapter: Any, method: str, message: str) -> None

Raise :class:UnsupportedOperationError unless adapter has method.

Parameters:

Name Type Description Default
adapter Any

The active SolidWorks adapter.

required
method str

The adapter method the tool needs.

required
message str

What was not done, and what to do instead.

required
Source code in src/solidworks_mcp/tools/tool_boundary.py
def require_capability(adapter: Any, method: str, message: str) -> None:
    """Raise :class:`UnsupportedOperationError` unless ``adapter`` has ``method``.

    Args:
        adapter: The active SolidWorks adapter.
        method: The adapter method the tool needs.
        message: What was not done, and what to do instead.
    """
    if not hasattr(adapter, method):
        raise UnsupportedOperationError(message)

require_success

require_success(result: AdapterResult[TResult], failure_message: str = 'Operation failed', *, context: str | None = None, with_data: bool = False) -> AdapterResult[TResult]

Return result when it succeeded; raise otherwise.

Mirrors the if result.is_success: ... else: error the tools used before the boundary, so anything that is not a success - including a warning - is reported as a failure. Tools that treat a warning as success check result.status themselves before calling this.

Parameters:

Name Type Description Default
result AdapterResult[TResult]

The adapter result to check.

required
failure_message str

Message used when the adapter gave none.

'Operation failed'
context str | None

Prefix naming what failed, e.g. "Failed to create part", giving "<context>: <adapter error>".

None
with_data bool

Return the adapter's data with the error, for tools whose failure data is the diagnosis (e.g. rebuild_model).

False

Raises:

Type Description
ToolOperationError

Carrying the adapter's message and timing.

Source code in src/solidworks_mcp/tools/tool_boundary.py
def require_success[TResult](
    result: AdapterResult[TResult],
    failure_message: str = "Operation failed",
    *,
    context: str | None = None,
    with_data: bool = False,
) -> AdapterResult[TResult]:
    """Return ``result`` when it succeeded; raise otherwise.

    Mirrors the ``if result.is_success: ... else: error`` the tools used before
    the boundary, so anything that is not a success - including a warning - is
    reported as a failure. Tools that treat a warning as success check
    ``result.status`` themselves before calling this.

    Args:
        result: The adapter result to check.
        failure_message: Message used when the adapter gave none.
        context: Prefix naming what failed, e.g. ``"Failed to create part"``,
            giving ``"<context>: <adapter error>"``.
        with_data: Return the adapter's ``data`` with the error, for tools whose
            failure data is the diagnosis (e.g. ``rebuild_model``).

    Raises:
        ToolOperationError: Carrying the adapter's message and timing.
    """
    if not result.is_success:
        message = str(result.error or failure_message)
        raise ToolOperationError(
            f"{context}: {message}" if context else message,
            result.execution_time,
            result.data if with_data else None,
        )
    return result

with_tool_boundary

with_tool_boundary(mcp: TServer) -> TServer

Return mcp wrapped in a :class:ToolRegistrar (typed as mcp).

The registrar duck-types the FastMCP surface the tool modules use (tool() plus attribute forwarding), so modules keep their annotations.

Source code in src/solidworks_mcp/tools/tool_boundary.py
def with_tool_boundary[TServer](mcp: TServer) -> TServer:
    """Return ``mcp`` wrapped in a :class:`ToolRegistrar` (typed as ``mcp``).

    The registrar duck-types the FastMCP surface the tool modules use
    (``tool()`` plus attribute forwarding), so modules keep their annotations.
    """
    return cast(TServer, ToolRegistrar.of(mcp))