Skip to main content
Glama
dsh18235538266-crypto

onshape-mcp-codex

edit_sketch

Modify an existing Onshape sketch by adding entities/constraints or removing ids, avoiding a full rebuild. Ideal for incremental edits like adding hole patterns or tightening constraints.

Instructions

Iterate on an existing sketch without rebuilding it. Pass any of addEntities, addConstraints, removeIds and the server fetches the current BTMSketch-151, splices the lists, and re-POSTs. Use this for the second/third pass on a sketch (adding a hole pattern after the outline lands; tightening a constraint after a regen check) instead of delete+recreate.

Add semantics are STRICT: every entity/constraint dict must carry a non-empty id string and ids may not collide with anything already on the wire. To retarget an id, removeIds it first and then addEntities it back.

removeIds is a single bag matched against entity ids AND constraint ids. Cascade: any constraint whose entities/entity (or sub-point ref like line1.start) names an entity in removeIds is auto-dropped and reported back in cascaded_removals so you see exactly what got pulled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
elementIdYesPart Studio element ID
removeIdsNoUser ids to drop. Matches entities AND constraints. Constraints referencing a removed entity cascade out and are reported in cascaded_removals.
documentIdYesDocument ID
addEntitiesNoEntity dicts to append. Each must carry a unique `id` plus the type-specific fields the constraint-first sketch surface accepts.
workspaceIdYesWorkspace ID
addConstraintsNoConstraint dicts to append. Each must carry a unique `id`. Reference entities by user-supplied `id` (e.g. `"entities": ["line1", "circle1"]`) or sub-points (`"line1.start"`).
sketchFeatureIdYesfeatureId of the sketch to edit (from a prior create_sketch).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden, and it delivers: it discloses mutation mechanics, strict ID uniqueness requirements, the need to remove before re-adding an id, and the cascade behavior that auto-drops constraints referencing removed entities. It also names the `cascaded_removals` response signal so the agent knows what to expect.

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

Conciseness5/5

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

The description is organized into four dense paragraphs, each with a distinct job: general purpose, usage scenario, add semantics, and removal/cascade semantics. It is front-loaded with the core purpose and contains no filler or redundant restatement of the tool name.

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?

Given the tool's complexity, full parameter coverage, and absence of an output schema, the description is unusually complete. It explains what happens server-side, what constraints the caller must satisfy, and how cascaded deletions are surfaced. An agent has enough information to select and correctly invoke the tool.

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 coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: it explains that any subset of `addEntities`, `addConstraints`, or `removeIds` can be passed, describes strict id semantics, and clarifies that `removeIds` matches both entity and constraint ids with cascade effects. This is material guidance the schema alone does not provide.

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 opens with a precise verb and resource: 'Iterate on an existing sketch without rebuilding it.' It goes on to explain the mechanism (fetch current BTMSketch, splice lists, re-POST), which clearly differentiates this from create_sketch or delete+recreate.

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?

Explicitly tells the agent when to use this tool: for second/third passes like 'adding a hole pattern after the outline lands' or 'tightening a constraint after a regen check.' It also names the alternative workflow it replaces, 'delete+recreate', giving clear selection guidance.

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