Skip to main content
Glama
onshape-jamcp

onshape-jamcp

Add custom feature

add_custom_feature

Adds a custom Feature Studio feature to an Onshape Part Studio using its feature type and parameter IDs, then returns the new feature ID and health status.

Instructions

Add a custom feature (a Feature Studio script such as Thread Creator) to a Part Studio. Find its feature_type and parameter IDs with list_custom_features first. Returns the new feature_id and its health status; if that is ERROR or WARNING, inspect it with list_features(feature_id=...), then fix it with update_feature or remove it with delete_feature.

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>",
      "feature_type": "<feature_type>"
    },
    "name": "add_custom_feature"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoName; defaults to the script's.
namespaceNoOnly to choose between custom features that share a feature_type; copy it exactly from list_custom_features.
element_idYesElement (tab) ID: the string after /e/ in the Onshape URL. Get it from get_document.
parametersNoMap of parameter ID to value, using the IDs from list_custom_features. Lengths are numbers in the configured unit (strings may carry units or be expressions such as '#width'); angles are degrees; enums take one of the listed options; booleans are true/false; selections (type 'query') are lists of face / edge / part IDs from get_body_details or list_parts. Anything left out keeps the script's own default.
document_idYesOnshape document ID: the 24-character hex string after /documents/ in the document URL. Get it from list_documents.
feature_typeYesfeature_type of the custom feature, from list_custom_features.
workspace_idNoWorkspace ID (the string after /w/ in the URL). Optional - defaults to the document's main workspace.
feature_studio_urlNoBrowser URL of the Feature Studio tab that defines the feature, for a Feature Script that list_custom_features does not show for this Part Studio. From another document it must be a version URL (/documents/<did>/v/<vid>/e/<eid>).

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 cover the safety profile (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true), so the description's contribution is the return contract — the new feature_id plus a health status that may be ERROR or WARNING — and the remediation workflow that status triggers. That is meaningful behavior beyond structured annotations, though the side effects of a failed add (whether a broken feature is left in the Part Studio) are not stated.

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 description is front-loaded with the core action and then layers prerequisite and error-recovery in a logical order, with no filler sentences. The final error-handling sentence is long but every clause carries operational information.

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 an eight-parameter mutation tool with a 100%-covered schema and an output schema, the description covers the important operational gaps: where the required identifiers come from and what to do with a bad health result. It is not fully complete only in that it omits when a different add tool should be chosen.

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%, so all eight parameters are already fully documented with provenance, units, and defaults. The description only reiterates that feature_type and parameter IDs come from list_custom_features, which the schema already says, so the baseline of 3 applies.

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?

The description gives a specific verb and resource ('Add a custom feature ... to a Part Studio') and disambiguates the concept by parenthetically defining a custom feature as a Feature Studio script such as Thread Creator. It does not explicitly contrast with built-in-feature siblings like add_feature or run_featurescript, so the differentiation is inferred from the concept rather than stated.

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 states a clear prerequisite ('Find its feature_type and parameter IDs with list_custom_features first') and a complete post-call branching path for ERROR/WARNING health using list_features, update_feature, and delete_feature. What is missing is an explicit exclusion: nothing tells the agent when to prefer add_feature or run_featurescript instead.

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