Skip to main content
Glama
SolidworksMCP-python

SolidworksMCP-python

Look Up API Method

lookup_api_method
Read-onlyIdempotent

Look up a SolidWorks API method or property to check it exists on an interface and how to call it, including parameters, return type, and description, before writing or debugging VBA or COM calls.

Instructions

Look up one SolidWorks API method or property: parameters, return type, description.

Use this before writing or debugging a SolidWorks API call (VBA, a macro or COM) to check that the member exists on that interface and how to call it. Answers come from the SolidWorks type library installed on this machine, so they match the installed version.

Setup: none. SolidWorks must be installed, not running; it is never contacted. Read-only. The first lookup builds the index (about a second). index_status is ready, rebuilt or unavailable.

Names match regardless of case, as COM does. result.member is SolidWorks' own spelling, with a note when yours differs. Each parameter has a type and a direction: in, out (SolidWorks fills it) or in_out (pass a variable by reference). return_type is null when the method returns nothing; a property has its value type there and an access. result.found false means there is no such member, and result.note says why, including when no index could be built (SolidWorks isn't installed here, or the requested year isn't).

Example input: {"interface": "ISldWorks", "method": "OpenDoc6"}

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "lookup_api_method"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataNoThe member to look up. `interface` (e.g. "ISldWorks") and `method` (a method or property name) are required; `year` has a default.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.0.0
    • changedInput schema / properties / input_data / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": true,
      -    "description": "Input schema for a single method/property lookup.",
      -    "properties": {
      -      "index_file": {
      -        "anyOf": [
      -          {
      -            "type": "string"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "Optional explicit index file path (JSON)"
      -      },
      -      "interface": {
      -        "description": "COM interface name, e.g. 'IFeatureManager'",
      -        "minLength": 2,
      -        "type": "string"
      -      },
      -      "method": {
      -        "description": "Method or property name, e.g. 'InsertFeatureChamfer'",
      -        "minLength": 1,
      -        "type": "string"
      -      },
      -      "year": {
      -        "anyOf": [
      -          {
      -            "type": "integer"
      -          },
      -          {
      -            "type": "null"
      -          }
      -        ],
      -        "default": null,
      -        "description": "SolidWorks year override"
      -      }
      -    },
      -    "required": [
      -      "interface",
      -      "method"
      -    ],
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "additionalProperties": true,
      +    "description": "Input schema for ``lookup_api_method``.\n\nAttributes:\n    interface (str): The COM interface the member is on.\n    method (str): The method or property name.",
      +    "properties": {
      +      "index_file": {
      +        "anyOf": [
      +          {
      +            "type": "string"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "Path to a saved index JSON to answer from instead of the installed type library, e.g. one copied from another machine. Rarely needed."
      +      },
      +      "interface": {
      +        "description": "COM interface name, e.g. 'IFeatureManager' or 'IModelDoc2'",
      +        "minLength": 2,
      +        "type": "string"
      +      },
      +      "method": {
      +        "description": "Method or property name, e.g. 'InsertFeatureChamfer'; case does not matter",
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "year": {
      +        "anyOf": [
      +          {
      +            "maximum": 2100,
      +            "minimum": 1995,
      +            "type": "integer"
      +          },
      +          {
      +            "type": "null"
      +          }
      +        ],
      +        "default": null,
      +        "description": "SolidWorks year whose API to answer for, e.g. 2026. Usually leave unset: the server's --year, else the newest installed. A year that isn't installed is explained in the result's note."
      +      }
      +    },
      +    "required": [
      +      "interface",
      +      "method"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / input_data / description
      Added value: +"The member to look up.\n`interface` (e.g. \"ISldWorks\") and `method` (a method or\nproperty name) are required; `year` has a default."
  2. Addedv1.5.0

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent/non-destructive annotations: it discloses that SolidWorks must be installed but is never contacted or required to be running, that the first call builds an index (~1 second), and that index_status can be ready/rebuilt/unavailable. It also explains the failure path (result.found false, result.note explaining missing install or year), which annotations cannot convey.

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

Conciseness3/5

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

Purpose and usage are correctly front-loaded, but the middle section spends several sentences explaining result shape (result.member, parameter type/direction, return_type nullability, access) even though an output schema exists and covers these. That detail dilutes an otherwise tight definition.

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?

For a single-parameter, read-only lookup, everything an agent needs is present: trigger context, setup prerequisites, index warm-up latency, case-matching behavior, and not-found semantics. The presence of an output schema means return values need not be documented here, so the remaining coverage is more than sufficient.

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

Parameters3/5

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

Schema coverage is 100% and the schema already documents interface, method, year and index_file in detail, so the baseline is 3. The description adds the COM-style case-insensitive matching rule and an example input, but case-insensitivity is largely restated in the method field's own schema description, so the marginal gain is modest.

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?

States a specific verb and scope: "Look up one SolidWorks API method or property: parameters, return type, description." The singular "one ... member" scope cleanly separates it from interface-level or search-oriented siblings such as lookup_api_interface or find_related_api_members without needing to name them.

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?

Gives a clear use context: "Use this before writing or debugging a SolidWorks API call (VBA, a macro or COM) to check that the member exists on that interface and how to call it." That is an explicit trigger condition, but no exclusions or named alternatives (e.g., when to prefer the interface lookup or the related-members tool instead) are offered.

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

Deploy Server

Other Tools