Skip to main content
Glama
Mastercam MCP Server

Mastercam MCP Server

by FunSize77

create_contour

Creates or regenerates a 2D contour toolpath in the active machine group from selected chains, with tool-sized lead in/out moves and specified depth.

Instructions

Create and regenerate a 2D contour toolpath in the active machine group. Closed chains run clockwise, so comp_side left cuts outside and right cuts inside. Lead in/out arcs and lines are sized to the tool.

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": {
      "tool_number": "<tool_number>",
      "depth": "<depth>"
    },
    "name": "create_contour"
  }
}

Input Schema

NameRequiredDescriptionDefault
leadNoLead in/out: {"line": length, "arc_radius": r} (default both 100% of the tool diameter), or false for none
nameNo
chainNoGeometry to machine: {"entity_ids": [..]} (ids from list_geometry), or {"level": n, "depth": z or "all", "closed_only": bool}: curves lying flat in the tool plane. Omit = all levels. If curves are at several depths, depth (plane Z) is required. Closed chains run clockwise seen from the plane, so comp_side left = outside, right = inside.
depthYesFinal depth (absolute Z unless linking.depth_incremental)
planeNoTool plane: top, front, back, bottom, left, right or a plane name (HMC: front = B0). Curves are chained in this plane
coolantNoflood, mist, thru or off
linkingNoHeights: {"clearance", "retract", "feed_plane", "top_stock"} are absolute Z unless the matching "*_incremental": true (also "depth_incremental"); "clearance_on", "retract_on", "rapid_retract". For drilling, feed_plane is the R plane.
subtypeNobasic, chamfer_2d, ramp_2d, remachining_2d, oscillate_2d
comp_sideNoleft or right of the chain direction
comp_typeNocomputer, control, wear, reverse_wear, off
feed_rateNo
depth_cutsNoMultiple Z steps: {"max_rough_step", "finish_cuts", "finish_step"}
parametersNoAny other parameter by path, e.g. {"LeadInOut.Enabled": true}. See get_operation_parameters for names.
leave_stockNoStock to leave on walls (default 0)
plunge_rateNo
tool_numberYes
retract_rateNo
length_offsetNoH number (default: the tool's)
spindle_speedNo
diameter_offsetNoD number (default: the tool's)
leave_stock_floorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare write (readOnlyHint=false), non-destructive, non-idempotent, closed-world behavior. The description adds real context beyond that by saying the tool can 'regenerate' an existing toolpath and that lead geometry is auto-sized to the tool, but it says nothing about what is overwritten on regenerate, whether the tool must already exist in the library, or what is returned.

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?

Three tight sentences with the core action front-loaded and the geometric convention immediately after. Some of the content overlaps the schema, but nothing is wasted or buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 21-parameter creation tool this is on the thin side: it never explains the outcome (operation handle/id, which toolpath group receives it) or the interaction between required `depth` and multi-level chains. The rich schema and the supplied annotations compensate enough that an agent can still call it, but the definition is not self-sufficient.

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?

With 21 parameters at 67% schema coverage, the schema does most of the work. The description restates the clockwise/comp_side mapping that the `chain` and `comp_side` schema fields already document, and the lead sizing note duplicates the `lead` default; it adds little new meaning for the roughly one-third of parameters with no schema description.

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?

States a specific verb and resource: 'Create and regenerate a 2D contour toolpath in the active machine group.' That is far more precise than a bare name, and the '2D contour' scope distinguishes it from siblings like create_pocket or create_circle_mill, though it never names those alternatives explicitly.

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?

Usage is implied by the tool name and by the note that closed chains run clockwise, but there is no explicit when-to-use/when-not guidance and no routing to sibling operations (pocket, circle mill, facing) for the cases where a contour is the wrong choice.

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