Skip to main content
Glama
danielproxd2

MCP_CAD

by danielproxd2

open_document

Open an existing SolidWorks document by absolute path for editing. Supports SLDPRT, SLDASM, and SLDDRW files, auto-activating the document.

Instructions

Abrir un documento de SolidWorks existente por ruta absoluta.

Carga un .SLDPRT / .SLDASM / .SLDDRW ya guardado. El tipo se infiere de la extensión y SW lo activa automáticamente — el documento abierto pasa a ser el documento activo que reportan get_active_part_info, list_faces, list_edges, etc. [en: Open an existing SolidWorks document by absolute path. Doc type is inferred from the extension; SW auto-activates the opened doc so the standard "active document" tools (get_active_part_info, etc.) operate on it immediately.]

Úsalo para "modifica esta pieza guardada" — se reabre y se modifica en su lugar, nunca se rehace desde cero.

Args: path: Ruta absoluta al archivo INCLUYENDO la extensión. La extensión determina el tipo: .SLDPRT parts (swDocPART) .SLDASM assemblies (swDocASSEMBLY) .SLDDRW drawings (swDocDRAWING) Cualquier otra extensión → SolidWorksError.

Returns: { "name": str, # title del doc (sin trailing '*') "path": str, # path tal cual lo pasaste "type": "part" | "assembly" | "drawing", "opened": True, "errors": 0, # bitmask placeholder (OpenDoc6 path "warnings": 0, # for these is v1.1) }

Raises: - ValueError si path está vacío. - SolidWorksError si el archivo no existe en disco. - SolidWorksError si la extensión no es .SLDPRT/.SLDASM/.SLDDRW. - SolidWorksError si SW devuelve None (archivo corrupto, versión más nueva que la instalación, mismatch tipo↔extensión).

Caveat:

  • Usa ISldWorks.OpenDoc (la variante simple de 2 args), no OpenDoc6. Por eso errors/warnings vienen siempre en 0 — el bitmask completo requiere VARIANT BYREF bajo pywin32 late-binding y está deferido a v1.1. Para "abrió bien o no", basta con "opened": True.

  • Si ya hay un documento con el mismo nombre abierto en SW, SW activa el existente en vez de re-abrir. Comportamiento default de SW — no lo sobreescribimos.

  • Desktop and Documents locations may be redirected. Use an explicit absolute path instead of assuming a profile-folder layout.

Example — abrir una pieza guardada y verificar: open_document(r"C:\CAD\input\bracket.SLDPRT") get_active_part_info() # name + saved feature tree (Para refrescar tras una edición externa: close_active_document(force=True) → open_document(...).)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It details auto-activation behavior, the behavior when a document with the same name is already open (SW activates existing), the limitation of using OpenDoc vs OpenDoc6 (errors/warnings always 0), and caveats about redirected paths. It also explains error types (ValueError, SolidWorksError) and conditions under which they occur.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections: main description, usage guidance, args, returns, raises, caveat, and example. Every sentence adds value. However, it is bilingual (Spanish and English), which duplicates content and slightly reduces conciseness. Despite this, the structure is logical and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter, no output schema), the description is highly complete. It explains the return value structure, error handling, caveats about OpenDoc vs OpenDoc6 and existing documents, and provides a concrete example. All necessary context for correct invocation is present.

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

Parameters5/5

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

The input schema only defines 'path' as a string with 0% coverage. The description adds critical meaning: the path must be absolute and include the extension, which determines the document type. It lists valid extensions, explains that invalid extensions cause SolidWorksError, and specifies that empty path raises ValueError. This goes far beyond the schema's minimal definition.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it opens an existing SolidWorks document by absolute path, specifies the supported file extensions (.SLDPRT, .SLDASM, .SLDDRW), and explains that the opened document becomes the active document for other tools. This distinguishes it from sibling tools like new_part, new_assembly, save_active_document, and close_active_document.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

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

The description provides clear usage context: 'Úsalo para modifica esta pieza guardada' and explains that it reopens and modifies in place, never rebuilding from scratch. It also gives an example of refreshing after external edits using close_active_document and open_document. However, it lacks explicit 'when not to use' statements or comparisons to alternatives beyond the example, so it does not fully exclude alternatives.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/danielproxd2/solidworks-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server