Skip to main content
Glama
danielproxd2

MCP_CAD

by danielproxd2

add_global_variable

Define named parametric variables (like 'A', 'B') that sketch and feature dimensions reference via equation, allowing variable changes across steps without rebuilding parts.

Instructions

Agregar variable global (ecuación) — declara un parámetro nombrado como "A", "B", "C" que las dimensiones de croquis y de feature pueden referenciar mediante una ecuación. Requisito habitual para piezas paramétricas como el CSWA Tool Block donde A, B, C deben modificarse entre pasos sin reconstruir.

[en: Add a global variable (equation) — declare a named parameter like "A", "B", "C" that sketch and feature dimensions can reference via an equation. Standard requirement for parametric parts like the CSWA Tool Block where A, B, C must change across steps without rebuilding.]

Args: name: Variable name (LHS of the equation). Cannot contain quotes, =, comma, or @. SW convention: short uppercase, e.g. "A", "B". value: The numeric value in the specified units. units: "mm" (default, length), "deg" (angle), or "raw" (dimensionless). SW stores values internally as meters / radians; this argument controls the equation suffix and the internal conversion.

Returns dict with: name, value, units, equation (raw SW string like '"A" = 81mm'), index (0-based position in the equation table).

Binding a dim to this variable: after creating the global, ADD ANOTHER EQUATION whose LHS is the dim name and whose RHS is the variable: add_global_variable("D1@Croquis1", '"A"', units="raw") (Pass an expression string; the equation manager accepts dim-paths on the LHS in addition to variable names.)

To change the value later, use set_global_variable. Do NOT call add_global_variable again with the same name.

Related: set_global_variable (modify existing), modify_dimension (feature dims only, not global vars).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYes
unitsNomm
valueYes
Behavior5/5

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

No annotations are provided, so the description fully carries the burden. It discloses the internal storage (meters/radians), the equation manager's behavior (accepts dim-paths on LHS), and the warning against re-adding. It also describes the return value in detail, ensuring the agent understands the tool's behavior.

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 (purpose, usage, parameters, return, additional notes). It is front-loaded with the primary purpose. While slightly lengthy, every sentence adds value, so it earns a 4 rather than a 5.

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

Completeness4/5

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

The description covers parameters, return value, and usage context thoroughly. It includes an example of binding a dimension. However, it lacks error handling details or edge cases, which would make it complete given the lack of an output schema.

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?

Schema description coverage is 0%, but the description compensates fully. It explains each parameter: name (LHS with constraints), value (numeric), units (options and default). It gives SW conventions and examples, adding significant meaning 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: to add a global variable (equation) as a named parameter. It specifies the verb 'add' and the resource 'global variable', and distinguishes from siblings like set_global_variable and modify_dimension. The context of parametric parts is also provided.

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

Usage Guidelines5/5

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

The description provides explicit when-to-use guidance (parametric parts like CSWA Tool Block) and when-not (do not call again with same name; use set_global_variable for modification). It also explains how to bind dimensions to the variable and lists related tools.

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