Skip to main content
Glama
kompas-mcp

kompas-mcp

by biryak

Create sketch

sketch_create

Creates a complete 2D sketch in a KOMPAS document in one call, optionally parametric with constraints and driving dimensions, or adds geometry to an existing sketch for later edits.

Instructions

Create a whole sketch in ONE call (it is never left open in edit mode), optionally parametric: constraints and DRIVING dimensions whose variables change the sketch later (feature_edit(obj=sketch, params={var: value}) or tie them to part variables with expr). into=obj:sketch adds entities/constraints/dimensions to an existing sketch. inspect_model(obj=sketch) reads its geometry, dimensions and constraint state. Returns a receipt: created object handles, volume/mass before and after, backup path. The whole call is ONE Ctrl+Z for the user; if verification fails the model is restored and VERIFY_FAILED is returned.

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": {
      "doc": "<doc>"
    },
    "name": "sketch_create"
  }
}

Input Schema

NameRequiredDescriptionDefault
docYesDocument handle from doc_list/doc_open, e.g. 'doc:12001:0a1b2c3d'
intoNoobj: of an existing sketch to add to
nameNoMeaningful feature name for the tree, e.g. 'Отв_крепёжные_6xD11'
planeNoXY (front) | ZX (top) | ZY (left) | obj: plane | topo: planar face (ignored with into)XY
entitiesNoGeometry in the sketch's own 2D coordinates, mm/deg, each with an optional id (default e0, e1… by position): {type:'line',x1,y1,x2,y2,axis?} | {type:'rect',x,y,w,h} (sides .0 bottom .1 right .2 top .3 left) | {type:'circle',xc,yc,r} | {type:'arc',xc,yc,r,a1,a2,ccw?} | {type:'polyline',points:[[x,y],...],closed?} (side .k from point k). Contours for extrusion/revolve must be closed; draw a stepped profile as ONE closed polyline (adjacent regions sharing a segment are rejected by KOMPAS). For revolve the profile lies on one side of the axis.
dimensionsNoDriving dimensions, value = as drawn: {type:'length', of:'line'} | {type:'horizontal'|'vertical', a:'point', b:'point'} | {type:'diameter'|'radius', of:'circle/arc'}; optional var (name of the sketch variable; default L1, X1, Y1, D1, R1…), expr (e.g. a part variable name made by variables_set), offset (mm from the geometry).
parametricNoparametric sketch (default): joins of sides, horizontal/vertical, and — for rectangles, circles and arcs nobody dimensioned — driving dimensions (L1, D1, R1…) and a fixed anchor point, so simple sketches come out fully defined and their sizes are editable variables. false = bare geometry
constraintsNo{type, a, b?}: horizontal|vertical (a line) | parallel|perpendicular|equal_length|collinear (two lines) | equal_radius|concentric|tangent (two curves) | coincident (two points) | fix (a point) | point_on (a point, a curve). References: 'id', 'id.k' (side k), points 'id:start'|'id.k:end'|'circle:center'. Joins of rect/polyline sides and horizontal/vertical of axis-parallel lines are added automatically in a parametric sketch.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed12 schema fields changedv0.6.0
    • addedInput schema / properties / constraints
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "{type, a, b?}: horizontal|vertical (a line) | parallel|perpendicular|equal_length|collinear (two lines) | equal_radius|concentric|tangent (two curves) | coincident (two points) | fix (a point) | point_on (a point, a curve). References: 'id', 'id.k' (side k), points 'id:start'|'id.k:end'|'circle:center'. Joins of rect/polyline sides and horizontal/vertical of axis-parallel lines are added automatically in a parametric sketch.",
      +  "title": "Constraints"
      +}
    • addedInput schema / properties / dimensions
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Driving dimensions, value = as drawn: {type:'length', of:'line'} | {type:'horizontal'|'vertical', a:'point', b:'point'} | {type:'diameter'|'radius', of:'circle/arc'}; optional var (name of the sketch variable; default L1, X1, Y1, D1, R1…), expr (e.g. a part variable name made by variables_set), offset (mm from the geometry).",
      +  "title": "Dimensions"
      +}
    • addedInput schema / properties / entities / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / entities / default
      Added value: +null
    • changedInput schema / properties / entities / description
      Previous value: -"Geometry in the sketch's own 2D coordinates, mm/deg: {type:'line',x1,y1,x2,y2,axis?} | {type:'rect',x,y,w,h} | {type:'circle',xc,yc,r} | {type:'arc',xc,yc,r,a1,a2,ccw?} | {type:'polyline',points:[[x,y],...],closed?}. Contours for extrusion/revolve must be closed; draw a stepped profile as ONE closed polyline (adjacent regions sharing a segment are rejected by KOMPAS). For revolve the profile lies on one side of the axis."New value: +"Geometry in the sketch's own 2D coordinates, mm/deg, each with an optional id (default e0, e1… by position): {type:'line',x1,y1,x2,y2,axis?} | {type:'rect',x,y,w,h} (sides .0 bottom .1 right .2 top .3 left) | {type:'circle',xc,yc,r} | {type:'arc',xc,yc,r,a1,a2,ccw?} | {type:'polyline',points:[[x,y],...],closed?} (side .k from point k). Contours for extrusion/revolve must be closed; draw a stepped profile as ONE closed polyline (adjacent regions sharing a segment are rejected by KOMPAS). For revolve the profile lies on one side of the axis."
    • removedInput schema / properties / entities / items
      Removed value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}
    • removedInput schema / properties / entities / type
      Removed value: -"array"
    • addedInput schema / properties / into
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "obj: handle from inspect_model/receipt, or '$N' inside batch",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "obj: of an existing sketch to add to",
      +  "title": "Into"
      +}
    • addedInput schema / properties / parametric
      Added value: +{
      +  "default": true,
      +  "description": "parametric sketch (default): joins of sides, horizontal/vertical, and — for rectangles, circles and arcs nobody dimensioned — driving dimensions (L1, D1, R1…) and a fixed anchor point, so simple sketches come out fully defined and their sizes are editable variables. false = bare geometry",
      +  "title": "Parametric",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / plane / default
      Added value: +"XY"
    • changedInput schema / properties / plane / description
      Previous value: -"XY (front) | ZX (top) | ZY (left) | obj: plane | topo: planar face"New value: +"XY (front) | ZX (top) | ZY (left) | obj: plane | topo: planar face (ignored with into)"
    • changedInput schema / required
      Previous value: -[
      -  "doc",
      -  "plane",
      -  "entities"
      -]New value: +[
      +  "doc"
      +]
  2. First observedv0.4.2

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that the sketch is never left in edit mode, that the whole operation is a single Ctrl+Z for the user, that a backup path is produced, and that a failed verification restores the model and returns VERIFY_FAILED. It also describes the return receipt (object handles, volume/mass before and after), which annotations alone cannot convey for a non-read-only, non-idempotent call.

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?

Front-loads the core action in the first clause and keeps the sibling call references in compact parentheticals. The paragraph is dense with parenthetical asides and long compound sentences, which slightly slows scanning, but essentially every clause carries operational information rather than filler.

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

Completeness5/5

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

For an 8-parameter sketch builder with no output schema, the description covers the return payload (handles, volume/mass deltas, backup path), the undo semantics, and the failure path with its error code. Combined with a fully documented schema, an agent has everything needed to invoke and interpret the call correctly.

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 already 100%, so the baseline is 3, and the description adds real meaning on top: into= is framed as adding entities/constraints/dimensions rather than replacing, and parametric is explained in terms of joins, auto driving dimensions (L1, D1, R1) and a fixed anchor point versus 'bare geometry'. It does not restate the geometry-entity grammar, but the schema already does that thoroughly.

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?

Names a specific verb+resource ('Create a whole sketch in ONE call') and immediately qualifies the two modes: a fresh sketch vs. adding into an existing sketch via into=obj:sketch. It also distinguishes itself from siblings by routing to feature_edit for later parameter changes and inspect_model for reading geometry, so an agent can place it in the toolchain without opening a schema.

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?

Gives concrete when-to-use context: use into= to extend an existing sketch, use feature_edit(obj=sketch, params={var: value}) to change variables later, use inspect_model to read dimensions and constraint state. It stops short of explicit exclusions (e.g., when not to use parametric=true or when a sibling like part_extrude is the better next step), so it lands just below the top tier.

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