Skip to main content
Glama
onshape-jamcp

onshape-jamcp

Extrude sketch

extrude

Create solids or cut holes and pockets from closed sketch regions by setting depth, direction, and operation for Onshape CAD models.

Instructions

Extrude all closed regions of a sketch into a solid, or cut with it (operation 'remove'). The default direction follows the sketch plane's normal. For a sketch on a part's own face that normal points OUT of the part, so to cut a hole or pocket INTO the part pass opposite_direction=true (verified on live Onshape; without it nothing is cut). Always confirm with get_part_properties - the volume must drop. For operation 'new' the reply lists the created parts (parts_created) and names them when part_name is given.

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>",
      "sketch_feature_id": "<sketch_feature_id>",
      "depth": "<depth>"
    },
    "name": "extrude"
  }
}

Input Schema

NameRequiredDescriptionDefault
holeNoThe cut is a round drilled hole (use operation 'remove'): it is named 'Hole', without a size.
nameNoFeature name. Defaults to its size: 'Extrude 8 mm' ('Cut 8 mm' for operation 'remove', 'Hole' with hole=true); with a variable depth the name shows the variable, e.g. 'Extrude (head_h)'. Do not put '#word' in a name: Onshape reads it as a parameter of the feature and shows '?'.
depthYesLength: a number in the configured unit (see get_settings; mm by default), a string with a unit such as '2.5 in', or an Onshape expression such as '#width'.
operationNo'new' creates a separate part; 'add' merges into existing parts; 'remove' cuts material away (holes, pockets); 'intersect' keeps only the overlap.new
part_nameNoName for the part an operation 'new' creates, e.g. 'M10x40 Hex Bolt'. Give one unless the user chose a name: otherwise the part stays 'Part N'.
symmetricNoExtrude half the depth to each side of the sketch plane.
element_idYesElement (tab) ID: the string after /e/ in the Onshape URL. Get it from get_document.
only_partsNoPart IDs (from list_parts) that operations 'add', 'remove' and 'intersect' should affect. By default Onshape applies them to every part the extrusion touches, which matters when several parts share one Part Studio (e.g. a bolt and a nut).
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.
sketch_feature_idYesfeature_id returned by create_sketch.
opposite_directionNoFlip to the other side of the sketch plane.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1

TDQS

A4.3/5.0
Behavior4/5

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

Beyond the annotations, it discloses a verified behavioral gotcha (without opposite_direction nothing is cut), that the direction depends on which face the sketch sits on, and that the reply lists parts_created for operation 'new'. It does not describe failure modes such as an open or self-intersecting sketch. Note a mild tension with destructiveHint=false, since operation 'remove' deletes material, but the tool adds a reversible feature to the tree, so this reads as an annotation convention rather than a contradiction.

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?

It is front-loaded with purpose, then the highest-risk gotcha, then the verification step. Every sentence carries information, though the final sentence about parts_created partially restates what the output schema already provides.

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 12-parameter, output-schema-backed mutation tool, the description covers the non-obvious workflow (direction, cut behavior, volume verification) that an agent would otherwise get wrong. It omits error conditions and the multi-part caveat handled by the only_parts parameter, so it is strong but not exhaustive.

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 baseline is 3, but the description adds real meaning above the schema: it explains WHY opposite_direction matters and what the default direction is, plus what happens to part naming when part_name is supplied. Other parameters such as only_parts and symmetric are left entirely to 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 opening sentence gives a specific verb (extrude) and resource (all closed regions of a sketch), states both outcomes (solid or cut via operation 'remove'), and the title/name pairing leaves no ambiguity about which sibling geometry operation this is.

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?

It gives concrete operating guidance: default direction follows the sketch normal, use operation 'remove' to cut, and pass opposite_direction=true when cutting into a part's own face. It also prescribes a verification step via get_part_properties. It does not route the agent away from alternatives like revolve or boolean, so it stops short of full when/when-not guidance.

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