Skip to main content
Glama

Project Curve

project_curve
Idempotent

Use this when you need to wrap a 2D closed curve onto a 3D face. Insert a <shape>.projectCurve({ source, face, scaleMode? }) chained call into a kernelCAD script. The source is the structured { kind: "sketchCommands", commands: [...] } wire format the runtime API accepts. Wraps the curve onto the face along the face normal; pair with .extrude(d) / .cut(...) for raised or engraved logos on curved bodies. Open-wire projection (asEdge: true) is not implemented and is rejected at edit time. Side-effect-free; returns modified code plus diagnostics.

Input Schema

NameRequiredDescriptionDefault
codeYesThe .kcad.ts source code.
faceYesTarget face — canonical name or label.
asEdgeNoOpen-wire (edge) projection. NOT IMPLEMENTED — rejected at edit time. Use a closed-curve projection (omit asEdge).
bindAsNoOptional local variable name; emits `const <bindAs> = <target>.projectCurve(...);`.
targetYesVariable name of the Shape to chain onto.
commandsYesClosed 2D path to wrap onto the face, as plain-number commands. Must start with a `moveTo` and end with a `close` (e.g. [{kind:"moveTo",x:0,y:0},{kind:"lineTo",x:2,y:0},{kind:"lineTo",x:2,y:2},{kind:"close"}]).
scaleModeNoDrawing.sketchOnFace scaling mode. Default original.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "binding_name": {
      -    "description": "JS const name bound to the new construct (when one was created).",
      -    "type": "string"
      -  },
      -  "diagnostics": {
      -    "description": "Diagnostics from re-evaluating the modified source.",
      -    "items": {
      -      "additionalProperties": true,
      -      "type": "object"
      -    },
      -    "type": "array"
      -  },
      -  "error": {
      -    "description": "Failure message (present when ok is false).",
      -    "type": "string"
      -  },
      -  "new_code": {
      -    "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      -    "type": "string"
      -  },
      -  "ok": {
      -    "description": "Whether the edit applied and re-evaluated cleanly.",
      -    "type": "boolean"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok"
      -]
  2. Changed4 schema fields changed
    • changedInput schema / properties / asEdge / description
      Previous value: -"Project as an open edge instead of a closed face-bound sketch. Currently deferred."New value: +"Open-wire (edge) projection. NOT IMPLEMENTED — rejected at edit time. Use a closed-curve projection (omit asEdge)."
    • addedInput schema / properties / commands
      Added value: +{
      +  "description": "Closed 2D path to wrap onto the face, as plain-number commands. Must start with a `moveTo` and end with a `close` (e.g. [{kind:\"moveTo\",x:0,y:0},{kind:\"lineTo\",x:2,y:0},{kind:\"lineTo\",x:2,y:2},{kind:\"close\"}]).",
      +  "items": {
      +    "properties": {
      +      "kind": {
      +        "enum": [
      +          "moveTo",
      +          "lineTo",
      +          "close"
      +        ],
      +        "type": "string"
      +      },
      +      "x": {
      +        "type": "number"
      +      },
      +      "y": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "kind"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • removedInput schema / properties / curveExpression
      Removed value: -{
      -  "description": "JS expression returning a closed sketch (e.g. `path().moveTo(0,0).lineTo(2,0).lineTo(2,2).close().build()`). Inserted verbatim as the `curve:` field.",
      -  "type": "string"
      -}
    • changedInput schema / required
      Previous value: -[
      -  "code",
      -  "target",
      -  "curveExpression",
      -  "face"
      -]New value: +[
      +  "code",
      +  "target",
      +  "commands",
      +  "face"
      +]
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "binding_name": {
      +      "description": "JS const name bound to the new construct (when one was created).",
      +      "type": "string"
      +    },
      +    "diagnostics": {
      +      "description": "Diagnostics from re-evaluating the modified source.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "error": {
      +      "description": "Failure message (present when ok is false).",
      +      "type": "string"
      +    },
      +    "new_code": {
      +      "description": "Modified .kcad.ts source (present on success). Caller persists it.",
      +      "type": "string"
      +    },
      +    "ok": {
      +      "description": "Whether the edit applied and re-evaluated cleanly.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok"
      +  ],
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Goes well beyond the annotations: discloses projection direction (along the face normal), a hard limitation ('open-wire projection is not implemented and is rejected at edit time'), and the return shape (modified code plus diagnostics). 'Side-effect-free' is consistent with idempotentHint=true/destructiveHint=false, though it sits in mild tension with readOnlyHint=false (the script is edited) and the description never resolves which state is considered mutated.

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?

Four sentences, front-loaded with the selection condition, then the emitted call, then the constraint, then the return contract. Nothing is repeated from the schema and no sentence is padding.

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 a script-mutating tool with an output schema, the description covers what it emits, the geometric behavior, the one unsupported mode, and how it composes with downstream ops — enough for an agent to call it correctly. Only the interaction between `scaleMode` choices and the resulting geometry is left entirely to the schema.

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, but the description adds real meaning: it reframes `commands` as the runtime's `{ kind: "sketchCommands", commands: [...] }` wire format and explains that the curve is wrapped along the face normal. It does not elaborate on `scaleMode` beyond the schema's own enum 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 precise verb and resource ('wrap a 2D closed curve onto a 3D face') and names the exact call emitted (`<shape>.projectCurve({ source, face, scaleMode? })`). It is clearly distinct from add_curve/add_surface in substance, but never names a sibling or explicitly contrasts against one.

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?

'Use this when you need to wrap a 2D closed curve onto a 3D face' gives a clear triggering condition, and 'pair with .extrude(d) / .cut(...) for raised or engraved logos' gives the follow-on workflow. No explicit when-not or named alternative is provided, so it stops short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.