Skip to main content
Glama
Onshape MCP

Onshape MCP

onshape_set_variables

Sets named variables and expressions in an Onshape Variable Studio, replacing the table to drive parametric CAD models.

Instructions

Set variables in a Variable Studio (replaces the table). Each item: {"name": "width", "type": "LENGTH", "expression": "25 mm", "description": ""}. type is one of LENGTH, ANGLE, NUMBER, ANY.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "did": "<did>",
      "wid": "<wid>",
      "eid": "<eid>",
      "variables": "<variables>"
    },
    "name": "onshape_set_variables"
  }
}

Input Schema

NameRequiredDescriptionDefault
didYes
eidYes
widYes
variablesYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, openWorldHint=true and destructiveHint=false, so the safety profile is largely covered. The description adds genuine value with the '(replaces the table)' overwrite semantics, though this sits in mild tension with destructiveHint=false since variables not listed are dropped. It says nothing about required edit permissions or failure 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?

Front-loaded with the action and the overwrite caveat, then an inline JSON example that is far more efficient than prose. No filler sentences; the only weakness is that the compact form leaves no room for the identifier parameters.

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

Completeness3/5

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

An output schema exists, so return values need no explanation, and the variables payload is well specified. For a four-required-parameter mutation with 0% schema coverage, though, the definition should identify did/wid/eid and state whether the caller needs an existing Variable Studio element and edit access.

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 description coverage is 0%, so the description must compensate, and it does well for the most important parameter by giving the exact item shape and the allowed type values (LENGTH, ANGLE, NUMBER, ANY). However, did/wid/eid — three of four required parameters — are left completely unexplained in both schema and description, so the gap is only partly closed.

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

Purpose4/5

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

States a specific verb and resource ('Set variables in a Variable Studio') and adds the crucial semantic that this replaces the existing table rather than appending, which distinguishes it from onshape_get_variables. It does not name any sibling tool explicitly, so it stops short of a 5.

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

Usage Guidelines3/5

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

Usage is implied: use this to write/replace a studio's variables, and (by implication) onshape_get_variables to read them. There is no explicit when-to-use/when-not statement, no note that a Variable Studio must already exist (onshape_create_variable_studio), and no warning that omitting an existing variable removes it.

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