solidworks_mcp.tools.toolsets¶
solidworks_mcp.tools.toolsets ¶
Which tools a client sees: toolsets, and the search mode (queue item 14).
Every tool is registered; these settings only change what tools/list
shows. SOLIDWORKS_MCP_TOOLSETS picks groups of families (each tool is
tagged with its family by ToolRegistrar), and
SOLIDWORKS_MCP_TOOL_MODE=search replaces the list with FastMCP's
search_tools and call_tool.
Attributes¶
TOOLSETS
module-attribute
¶
TOOLSETS: dict[str, frozenset[str]] = {'core': frozenset({'modeling', 'equations', 'assembly', 'sketching', 'file_management', 'analysis', 'engineering_data', 'export', 'server_admin'}), 'drawing': frozenset({'drawing', 'drawing_automation', 'drawing_analysis'}), 'automation': frozenset({'macro_recording', 'automation', 'template_management'}), 'vba': frozenset({'vba_generation'}), 'docs': frozenset({'docs_discovery'})}
Functions:¶
apply_tool_visibility ¶
Show only the chosen toolsets, and in search mode only search and call.
Call it after every tool is registered. The toolset filter comes first, so a search finds only tools in the chosen toolsets. Search mode also leaves deprecated tools out, so a search returns their replacements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mcp
|
Any
|
The FastMCP server. |
required |
toolsets
|
tuple[str, ...]
|
Names from :func: |
required |
mode
|
str
|
|
required |
Source code in src/solidworks_mcp/tools/toolsets.py
families_for ¶
The families the chosen toolsets show.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
toolsets
|
tuple[str, ...]
|
Names from :func: |
required |
Returns:
| Type | Description |
|---|---|
frozenset[str] | None
|
frozenset[str] | None: The families, or |
Source code in src/solidworks_mcp/tools/toolsets.py
parse_toolsets ¶
The toolsets a SOLIDWORKS_MCP_TOOLSETS value names, in table order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Comma-separated toolset names, or |
required |
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
tuple[str, ...]: The names, or |
Raises:
| Type | Description |
|---|---|
ValueError
|
When the value is empty or names an unknown toolset. |