Skip to main content
Glama
onshape-mcp

onshape-mcp

by gpambrozio

Relate two mates

onshape_assembly_relation

Couple mates so one drives the other: GEAR (two revolutes, ratio), RACK_AND_PINION (a revolute and a slider, distance per revolution), SCREW (one cylindrical mate, distance per revolution) or LINEAR (two sliders, ratio).

Instructions

Couple mates so one drives the other: GEAR (two revolutes, ratio), RACK_AND_PINION (a revolute and a slider, distance per revolution), SCREW (one cylindrical mate, distance per revolution) or LINEAR (two sliders, ratio). Each mate's degree of freedom follows from its type; cylindrical mates contribute whichever the relation needs. Mates missing the parameter relations need (made by hand-written payloads) are completed first and listed in completedMates. Fails if the relation does not regenerate.

Input Schema

NameRequiredDescriptionDefault
wsYesWorkspace id — the <ws> segment of the document URL.
docYesDocument id — the <doc> in cad.onshape.com/documents/<doc>/w/<ws>/e/<elem>.
dofsNoOverride the degree of freedom per mate: Rz rotation about, Tz translation along, its Z axis.
elemYesElement id (tab) — the <elem> segment of the document URL.
nameNoFeature name (default "Relation").
typeYesRelation type.
matesYesMate feature ids: two, or one for SCREW.
ratioNoGEAR and LINEAR: the ratio between the mates (default 1).
reverseNoReverse the direction of the coupling.
distance_per_revolutionNoRACK_AND_PINION and SCREW: travel per full turn, inches. A pinion's is its pitch circumference.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations carry only a title, so the description bears the full burden and does disclose meaningful behavior beyond the schema: it mutates other features by completing missing mate parameters and reports them in completedMates, and it fails if the relation does not regenerate. It does not state permission requirements or whether an existing relation is overwritten, but the side-effect and failure disclosures are unusually concrete.

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 core purpose, then the type enumeration, then the side-effect and failure notes. Dense but every sentence adds information; the first sentence is long with nested parentheticals but remains scannable.

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?

For a 10-parameter mutation tool with no annotations and no output schema, the description covers the valid type/mate combinations, the dof derivation, the completedMates return value, and the failure mode. Missing only permission/prerequisite and overwrite semantics to be fully complete.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: it explains that each mate's degree of freedom follows from its type and that cylindrical mates contribute whichever the relation needs, which clarifies the purpose of the dofs override. It also maps ratio and distance_per_revolution to their relation types, though that partly duplicates the schema text.

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 resource — coupling two existing mates so one drives the other — and then enumerates the four relation types with the mate types each requires (GEAR = two revolutes, SCREW = one cylindrical mate). This clearly separates it from the sibling mate-creation tools like onshape_assembly_mate, since it operates on already-existing mates rather than creating 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?

The per-type prerequisites (e.g. 'RACK_AND_PINION (a revolute and a slider)', 'SCREW (one cylindrical mate)') effectively tell an agent when a given relation is valid. There is no explicit exclusion or named alternative, but the context for selecting among the four relation types is clear.

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