Skip to main content
Glama
onshape-jamcp

onshape-jamcp

List variables

list_variables
Read-only

List Part Studio variables with names, types, expressions, current values, and configuration options so you can reference them as #name in Onshape feature inputs.

Instructions

List the variables of a Part Studio: name, type, the expression it was set with and its current value (lengths in the configured unit, angles in degrees). A variable that depends on a configuration input also shows configured_by and its value per option. Reference a variable as '#name' in sketch sizes, extrude depths, fillet radii, thread pitch, etc.

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": {
      "document_id": "<document_id>",
      "element_id": "<element_id>"
    },
    "name": "list_variables"
  }
}

Input Schema

NameRequiredDescriptionDefault
element_idYesElement (tab) ID: the string after /e/ in the Onshape URL. Get it from get_document.
document_idYesOnshape document ID: the 24-character hex string after /documents/ in the document URL. Get it from list_documents.
workspace_idNoWorkspace ID (the string after /w/ in the URL). Optional - defaults to the document's main workspace.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description still adds genuinely useful behavior beyond that: units are normalized (lengths in the configured unit, angles in degrees) and results are conditionally shaped, with configuration-dependent variables gaining configured_by and per-option values. Only pagination or empty-result behavior is left unstated.

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 lead sentence front-loads what is listed and what comes back, followed by the conditional-output caveat and a usage note. It is efficient, though the trailing "sketch sizes, extrude depths, fillet radii, thread pitch, etc." is a slightly padded example list that could be trimmed.

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?

With an output schema present, return values need not be explained in prose, annotations cover safety, and all parameters are documented in the schema. The description supplies the extra semantics an agent needs (unit normalization, configuration-dependent fields). Minor gaps remain around empty Part Studios and error conditions, but nothing essential for correct invocation is missing.

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 100%, including the 24-character hex format for document_id and the /e/ URL hint for element_id, so the schema carries the parameter burden. The description only obliquely signals that element_id refers to a Part Studio tab; it adds no meaning about workspace_id or its default resolution. Baseline 3 is appropriate.

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 uses a specific verb ("List") with a precise resource ("the variables of a Part Studio") and enumerates the returned fields (name, type, expression, current value). This clearly separates it from sibling listers such as list_features, list_parts, and list_custom_features 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 Guidelines3/5

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

The final sentence explains how variables are consumed ("Reference a variable as '#name' in sketch sizes, extrude depths, fillet radii, thread pitch"), which implies the tool is a discovery step before those operations. However, it never states when to choose this over an alternative, nor any prerequisites or exclusions, leaving usage to inference.

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