Skip to main content
Glama

open_document

Open a saved SolidWorks document by absolute path. The file extension determines the type (part, assembly, drawing) and activates it for immediate modification.

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 (mensaje incluye la pista del Escritorio de Spanish-Windows + OneDrive). - 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.

  • En Windows en español con OneDrive, el escritorio del cliente es C:\Users\<user>\OneDrive\Escritorio, NO C:\Users\<user>\Desktop. Si el usuario dice "abre la pieza del escritorio" sin path, usa la ruta de OneDrive\Escritorio.

Example — abrir una pieza guardada y verificar: open_document(r"C:\Users<user>\OneDrive\Escritorio\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, the description fully discloses behavior: auto-activation, type inference from extension, returns a structured object, raises specific errors (ValueError, SolidWorksError for various conditions), and caveats about using OpenDoc (not OpenDoc6) and duplicate name behavior. It also provides a warning about OneDrive path discrepancy. This is highly transparent.

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 sections (main description, args, returns, raises, caveat, example) and uses both Spanish and English. It is somewhat verbose (e.g., repeating type info in args and returns) but every sentence serves a purpose. It is front-loaded with the primary function. A slightly tighter rewrite could improve conciseness.

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 complexity (SolidWorks document handling), no output schema, and no annotations, the description is complete. It covers return values, error conditions, behavioral caveats, and integration with active document tools. The example demonstrates typical usage. The agent has enough information to invoke the tool correctly.

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 single parameter 'path' has 0% schema description coverage, so the description must add meaning. It does so extensively: path must be absolute including extension; extension determines document type; lists valid extensions and their types; warns about invalid extensions; provides example path; and explains OneDrive path handling. This goes far beyond the schema.

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 the tool's purpose: opening an existing SolidWorks document by absolute path. It specifies supported file types (.SLDPRT, .SLDASM, .SLDDRW) and mentions that the document becomes active, directly relating to sibling tools like get_active_part_info. The verb 'Abrir' (Open) and resource 'documento de SolidWorks existente' are specific and not tautological.

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 explicit usage context: it is for modifying saved parts without rebuilding from scratch. It also includes a caveat about OneDrive paths for Spanish Windows. However, it does not explicitly contrast with sibling tools like new_part or close_active_document, though the active document effect implies its role in a workflow. A clear when-to-use vs alternatives is missing, but the guidance is still strong.

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/MCP_CAD'

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