solidworks_mcp.tools.tool_hints¶
solidworks_mcp.tools.tool_hints ¶
MCP behaviour hints for every registered tool, in one reviewable table.
An MCP client reads a tool's title and its readOnlyHint,
destructiveHint and idempotentHint annotations to decide, for
example, whether to ask the user before calling it. ToolRegistrar
applies the entry for each tool at registration, and refuses a tool that has
no entry, so this table always matches the registered tools.
The hints describe what a tool is for, read from its adapter calls:
- read-only: changes neither the model, SolidWorks' state nor any file;
- destructive: may delete, overwrite or discard something the user can't get back from the feature tree (a file on disk, a deleted feature, unsaved work, a run macro);
- idempotent: calling it again with the same input changes nothing more.
A tool SolidWorks can't yet carry out (it reports unsupported) still
gets the hints of what it is meant to do.
Attributes¶
TOOL_HINTS
module-attribute
¶
TOOL_HINTS: dict[str, ToolHints] = {'calculate_mass_properties': _reads('Calculate Mass Properties'), 'get_mass_properties': _reads('Get Mass Properties'), 'check_interference': _reads('Check Assembly Interference'), 'verify_model': _reads('Verify Model Against Expectations'), 'generate_vba_code': _reads('Generate VBA Code'), 'discover_solidworks_docs': _sets('Rebuild SolidWorks API Index'), 'search_solidworks_api_help': _reads('Search SolidWorks API'), 'reset_circuit_breaker': _sets('Reset Circuit Breaker'), 'lookup_api_method': _reads('Look Up API Method'), 'lookup_api_interface': _reads('Look Up API Interface'), 'get_api_enum': _reads('Get API Enum'), 'find_related_api_members': _reads('Find Related API Members'), 'create_drawing_view': _adds('Create Drawing View'), 'add_dimension': _adds('Add Drawing Dimension'), 'add_note': _adds('Add Drawing Note'), 'create_section_view': _adds('Create Section View'), 'create_detail_view': _adds('Create Detail View'), 'update_sheet_format': _sets('Update Sheet Format'), 'auto_dimension_view': _adds('Auto-Dimension Drawing View'), 'check_drawing': _reads('Check Drawing Completeness'), 'create_technical_drawing': _adds('Create Technical Drawing'), 'add_drawing_view': _adds('Add Drawing View'), 'update_title_block': _sets('Update Title Block'), 'list_drawing_views': _reads('List Drawing Views'), 'auto_center_marks': _adds('Add Centre Marks'), 'compare_drawing_versions': _reads('Compare Drawing Files'), 'insert_model_dimensions': _adds('Insert Model Dimensions'), 'arrange_dimensions': _sets('Arrange Drawing Dimensions'), 'insert_bom_table': _adds('Insert BOM Table'), 'add_gtol': _adds('Add GD&T Frame'), 'add_datum_tag': _adds('Add Datum Tag'), 'set_sheet_scale': _sets('Set Sheet Scale'), 'generate_drawing_package': _overwrites('Generate Drawing Package'), 'list_model_dimensions': _reads('List Model Dimensions'), 'measure_entities': _reads('Measure Entities'), 'get_material': _reads('Get Material'), 'set_material': _sets('Set Material'), 'list_available_materials': _reads('List Available Materials'), 'get_custom_properties': _reads('Get Custom Properties'), 'set_custom_property': _overwrites('Set Custom Property'), 'export_flat_pattern': _overwrites('Export Flat Pattern'), 'export_step': _overwrites('Export STEP'), 'export_iges': _overwrites('Export IGES'), 'export_stl': _overwrites('Export STL'), 'export_pdf': _overwrites('Export PDF'), 'export_dwg': _overwrites('Export DWG'), 'export_image': _overwrites('Export Image'), 'save_file': _overwrites('Save File'), 'save_as_template': _overwrites('Save As Template'), 'save_as': _overwrites('Save As'), 'get_file_properties': _reads('Get File Properties'), 'get_model_info': _reads('Get Model Info'), 'list_features': _reads('List Features'), 'get_selected_entities': _reads('Get Selected Entities'), 'classify_feature_tree': _reads('Classify Feature Tree'), 'list_configurations': _reads('List Configurations'), 'create_configuration': _adds('Add Configuration'), 'activate_configuration': _sets('Activate Configuration'), 'delete_configuration': _discards('Delete Configuration'), 'create_exploded_view': _adds('Create Exploded View'), 'set_exploded_view': _sets('Set Exploded View'), 'pattern_components': _adds('Pattern Components'), 'mirror_components': _adds('Mirror Components'), 'replace_component': _overwrites('Replace Component'), 'add_balloons': _adds('Add Balloons'), 'list_equations': _reads('List Equations'), 'set_equation': _sets('Set Equation'), 'delete_equation': _discards('Delete Equation'), 'load_part': _sets('Load Part'), 'load_assembly': _sets('Load Assembly'), 'save_part': _overwrites('Save Part'), 'save_assembly': _overwrites('Save Assembly'), 'pack_and_go_assembly': _overwrites('Pack and Go Assembly'), 'list_open_documents': _reads('List Open Documents'), 'activate_document': _sets('Activate Document'), 'save_body_as_part': _overwrites('Save Body as Part'), 'execute_macro': _discards('Run Macro'), 'open_model': _sets('Open Model'), 'create_part': _adds('Create Part'), 'create_assembly': _adds('Create Assembly'), 'create_drawing': _adds('Create Drawing'), 'close_model': _discards('Close Model'), 'create_extrusion': _adds('Create Extrusion'), 'create_revolve': _adds('Create Revolve'), 'get_dimension': _reads('Get Dimension'), 'set_dimension': _sets('Set Dimension'), 'set_units': _sets('Set Units'), 'create_cut_extrude': _adds('Create Extruded Cut'), 'add_fillet': _adds('Add Fillet'), 'add_chamfer': _adds('Add Chamfer'), 'create_sweep': _adds('Create Sweep'), 'create_loft': _adds('Create Loft'), 'insert_component': _adds('Insert Component'), 'add_mate': _adds('Add Mate'), 'set_component_state': _sets('Set Component State'), 'list_components': _reads('List Components'), 'delete_feature': _discards('Delete Feature'), 'suppress_feature': _sets('Suppress or Unsuppress Feature'), 'rename_feature': _sets('Rename Feature'), 'select_feature': _sets('Select Feature'), 'select_face_edges': _sets('Select Face Edges'), 'rebuild_model': _sets('Rebuild Model'), 'undo': _discards('Undo'), 'create_reference_plane': _adds('Create Reference Plane'), 'create_axis': _adds('Create Reference Axis'), 'create_reference_point': _adds('Create Reference Point'), 'mirror_feature': _adds('Mirror Feature'), 'pattern_circular': _adds('Circular Pattern'), 'pattern_linear': _adds('Linear Pattern'), 'create_shell': _adds('Shell'), 'add_draft': _adds('Draft Faces'), 'create_rib': _adds('Rib'), 'create_base_flange': _adds('Base Flange'), 'add_edge_flange': _adds('Edge Flange'), 'create_sketched_bend': _adds('Sketched Bend'), 'set_flat_pattern': _sets('Flat Pattern'), 'create_hole': _adds('Hole Wizard Hole'), 'list_hole_sizes': _reads('List Hole Wizard Sizes'), 'add_cosmetic_thread': _adds('Cosmetic Thread'), 'create_sketch': _adds('Create Sketch'), 'add_line': _adds('Add Sketch Line'), 'add_circle': _adds('Add Sketch Circle'), 'add_rectangle': _adds('Add Sketch Rectangle'), 'exit_sketch': _sets('Exit Sketch'), 'check_sketch_fully_defined': _reads('Check Sketch Fully Defined'), 'add_arc': _adds('Add Sketch Arc'), 'add_spline': _adds('Add Sketch Spline'), 'add_centerline': _adds('Add Sketch Centerline'), 'add_polygon': _adds('Add Sketch Polygon'), 'add_ellipse': _adds('Add Sketch Ellipse'), 'add_sketch_text': _adds('Add Sketch Text'), 'set_sketch_text': _sets('Set Sketch Text'), 'add_sketch_fillet': _adds('Add Sketch Fillet'), 'add_sketch_chamfer': _adds('Add Sketch Chamfer'), 'add_slot': _adds('Add Slot'), 'sketch_trim': _discards('Trim Sketch Entity'), 'sketch_extend': _adds('Extend Sketch Entity'), 'set_construction_geometry': _sets('Set Construction Geometry'), 'add_sketch_constraint': _adds('Add Sketch Relation'), 'add_sketch_dimension': _adds('Add Sketch Dimension'), 'sketch_linear_pattern': _adds('Sketch Linear Pattern'), 'sketch_circular_pattern': _adds('Sketch Circular Pattern'), 'sketch_mirror': _adds('Mirror Sketch Entities'), 'sketch_offset': _adds('Offset Sketch Entities'), 'sketch_convert_entities': _adds('Convert Entities'), 'sketch_tutorial_simple_hole': _adds('Tutorial: Hole Sketch'), 'compare_templates': _reads('Compare Templates'), 'generate_vba_extrusion': _reads('Generate VBA: Extrusion'), 'generate_vba_revolve': _reads('Generate VBA: Revolve'), 'generate_vba_assembly_insert': _reads('Generate VBA: Insert Component'), 'generate_vba_drawing_views': _reads('Generate VBA: Drawing Views'), 'generate_vba_batch_export': _reads('Generate VBA: Batch Export'), 'generate_vba_part_modeling': _reads('Generate VBA: Part Modeling'), 'generate_vba_assembly_mates': _reads('Generate VBA: Assembly Mates'), 'generate_vba_drawing_dimensions': _reads('Generate VBA: Drawing Dimensions'), 'generate_vba_file_operations': _reads('Generate VBA: File Operations'), 'generate_vba_macro_recorder': _reads('Generate VBA: Macro Recorder')}
Classes¶
ToolHints
dataclass
¶
One tool's title and behaviour hints.
Attributes:
| Name | Type | Description |
|---|---|---|
title |
str
|
A short human-readable name for the tool. |
read_only |
bool
|
The tool changes nothing. |
destructive |
bool
|
The tool may delete, overwrite or discard work. |
idempotent |
bool
|
Repeating a call with the same input has no further effect. |
Methods:¶
__post_init__ ¶
Reject combinations that contradict each other.
Raises:
| Type | Description |
|---|---|
ValueError
|
If a read-only tool is marked destructive or not idempotent. |
Source code in src/solidworks_mcp/tools/tool_hints.py
annotations ¶
The hints as MCP tool annotations.
Returns:
| Name | Type | Description |
|---|---|---|
ToolAnnotations |
ToolAnnotations
|
|
Source code in src/solidworks_mcp/tools/tool_hints.py
Functions:¶
_adds ¶
_discards ¶
A tool that deletes, discards or runs something; each call acts again.
_overwrites ¶
A tool that writes or replaces a file or value, the same each time.
_reads ¶
_sets ¶
A tool that sets a state; repeating the call changes nothing more.