Skip to main content
Glama
mastercam-mcp

mastercam-mcp

by Praket7

analyze_nc_program

Read-onlyIdempotent

Parse bounded G-code linear/arc motion and flag risky rapids, feed/spindle limits, unsupported moves, and cycle-time evidence for NC program review.

Instructions

Parse bounded linear and planar G-code arc motion; flag risky rapids, feed/spindle limits, unsupported motion, and reviewable cycle-time evidence

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": {
      "program": "<program>",
      "units": "<units>",
      "coordinateFrame": "<coordinateFrame>",
      "initialPosition": "<initialPosition>",
      "machine": "<machine>"
    },
    "name": "analyze_nc_program"
  }
}

Input Schema

NameRequiredDescriptionDefault
safeZNo
stockNo
unitsYes
machineYes
programYes
fixturesNo
toolRadiusNo
workOffsetsNo
holderRadiusNo
safetyMarginNo
arcChordErrorNo
initialMotionNo
maxArcSegmentsNo
coordinateFrameYes
initialPositionYes
initialWorkOffsetNoG54
dwellPMillisecondsNo
defaultToolChangeSecondsNo

Output Schema

NameRequiredDescriptionDefault
okYes
dataNo
liveNo
toolYes
errorNo
receiptNo
documentRevisionNo
operationFingerprintNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.3.1
    • addedInput schema / properties / arcChordError
      Added value: +{
      +  "exclusiveMinimum": 0,
      +  "type": "number"
      +}
    • addedInput schema / properties / initialWorkOffset
      Added value: +{
      +  "default": "G54",
      +  "enum": [
      +    "G54",
      +    "G55",
      +    "G56",
      +    "G57",
      +    "G58",
      +    "G59"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / maxArcSegments
      Added value: +{
      +  "default": 2048,
      +  "maximum": 10000,
      +  "minimum": 8,
      +  "type": "integer"
      +}
    • addedInput schema / properties / workOffsets
      Added value: +{
      +  "additionalProperties": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "x": {
      +        "type": "number"
      +      },
      +      "y": {
      +        "type": "number"
      +      },
      +      "z": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "x",
      +      "y",
      +      "z"
      +    ],
      +    "type": "object"
      +  },
      +  "propertyNames": {
      +    "enum": [
      +      "G54",
      +      "G55",
      +      "G56",
      +      "G57",
      +      "G58",
      +      "G59"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "object"
      +}
  2. Addedv0.3.0

TDQS

B3/5.0
Behavior3/5

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

Annotations already declare readOnly/idempotent/non-destructive, lowering the bar. The description usefully discloses that it flags risky rapids, feed/spindle limits, unsupported motion, and cycle-time evidence, and 'bounded linear and planar' hints that other motion types are treated as unsupported. It does not say how unsupported motion is surfaced (error vs. warning) or any input constraints.

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?

A single dense sentence with the core action front-loaded and no filler. It is terse to the point of omitting needed detail, but every clause contributes a distinct capability.

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?

An output schema exists, so return values needn't be explained, and the description conveys the analysis intent. But for an 18-parameter, heavily nested tool with zero parameter documentation and no usage guidance, the description is thin relative to the tool's complexity.

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?

Schema description coverage is 0% across 18 parameters (machine travel, safeZ, fixtures, workOffsets, arcChordError, toolRadius, etc.), and the description adds no parameter meaning. With almost no schema-level documentation, the description fails to compensate for the coverage gap.

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 ('Parse') and a scoped resource ('bounded linear and planar G-code arc motion') and enumerates what it flags. An agent can tell it analyzes NC/G-code for risk rather than generating or comparing files, though it never explicitly distinguishes itself from siblings like analyze_cycle_time or compare_nc_files.

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?

No when-to-use guidance, prerequisites, or named alternatives. The description lists what the tool reports but gives no signal about when an agent should reach for it versus analyze_cycle_time, compare_nc_files, or analyze_toolpath_risk.

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