Skip to main content
Glama
Mastercam MCP Server

Mastercam MCP Server

by FunSize77

create_pocket

Generate or regenerate a 2D pocket toolpath from closed chains, with nested chains treated as islands, to machine flat pocket geometry in Mastercam.

Instructions

Create and regenerate a 2D pocket (closed chains; chains inside others are islands).

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_pocket"
  }
}

Input Schema

NameRequiredDescriptionDefault
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.
depthYesPocket floor (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
finishNo{"passes": n, "spacing": d}, or false to disable finishing
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.
subtypeNostandard, facing, island_facing, remachining, open
stepoverNoRoughing stepover distance (default 50% of the tool diameter)
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_stockNo
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/5.0
Behavior3/5

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

Annotations already declare a non-read-only, non-idempotent, non-destructive creation operation, so the safety profile is covered. The description adds that the operation can be "regenerated" and explains island nesting behavior, but says nothing about whether the operation is appended to the tree immediately, what preconditions exist (tool must already exist), or what happens on failure. With annotations present this partial disclosure is a reasonable 3.

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?

A single front-loaded sentence with a parenthetical qualifier; every clause (create/regenerate, 2D pocket, closed chains, islands) adds information and nothing is redundant.

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

Completeness2/5

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

This is a high-complexity creation tool with 20 parameters, no output schema, and no explanation of return value or side effects such as tree placement. For a mutation of this size, the description should at minimum state preconditions and what the caller gets back; it leaves those entirely to the schema and caller inference.

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

Parameters2/5

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

With 20 parameters and only 60% schema description coverage, the description carries part of the burden but delivers almost nothing: no mention of depth, stepover, finish, linking, or subtype. The one piece of added meaning is the nesting/island rule for the chain parameter, which is useful but marginal across twenty fields.

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+resource pair ("Create and regenerate a 2D pocket") plus a scoping clause about closed chains and nested islands, which separates it from contour/drill/circle-mill siblings. It stops short of naming an alternative tool explicitly, but an agent can tell what this produces.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance: nothing says when a pocket is the right choice over create_contour or create_facing, and no prerequisites are stated. The only constraint offered is geometric (closed chains required, nested chains become islands), which is an input requirement rather than usage routing.

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