Skip to main content
Glama

Add Curve

add_curve

Use this when you need to author a 3D Curve3D into the user's .kcad.ts immediately before the last top-level return. One authoring path, selected by kind:

  • 'nurbs' — insert a nurbsCurve(controlPoints, opts?) declaration. Pass controlPoints as a Vec3[] (mm, at least 2 points). Optional NURBS knobs: degree (default 3), rational weights, explicit knots, closed.

  • 'hermite' — insert a hermiteG2(a, b) declaration: a quintic Hermite curve interpolating two endpoints with matching positions, tangents, and (optional) curvatures — bridges two curves with G2 continuity. Each endpoint is { point: Vec3, tangent: Vec3, curvature?: Vec3 } in mm; tangent magnitude ~ chord length; curvature defaults to [0,0,0] (G1-only). The returned binding has type Curve3D (peer to Shape / Surface) — consume it via add_variable_sweep (spine input), add_surface({ kind: 'boundary' }) (boundary curve), or downstream Curve3D-accepting features. Returns the modified code + diagnostics from re-evaluating. Side-effect-free. Each kind fails closed on its own missing required params.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
aNokind:'hermite' — start endpoint.
bNokind:'hermite' — end endpoint.
codeYesThe .kcad.ts source code.
kindYesWhich curve-construction path to use.
knotsNokind:'nurbs' — optional explicit knot vector; missing => clamped-uniform inferred.
closedNokind:'nurbs' — optional periodic/closed-curve flag.
degreeNokind:'nurbs' — curve degree; default 3 (cubic).
weightsNokind:'nurbs' — optional rational weights, one per control point (same length as controlPoints).
binding_nameNoJS const name for the new Curve3D binding (default: _curve_<N>).
controlPointsNokind:'nurbs' — control points as Vec3 triples in mm; at least 2 entries.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesWhether the edit applied and re-evaluated cleanly.
errorNoFailure message (present when ok is false).
new_codeNoModified .kcad.ts source (present on success). Caller persists it.
diagnosticsNoDiagnostics from re-evaluating the modified source.
binding_nameNoJS const name bound to the new construct (when one was created).

TDQS

A4.3/5.0
Behavior4/5

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

The description discloses the insertion location, return format (modified code + diagnostics), validation behavior ('fails closed'), and claims 'side-effect-free'. Annotations provide readOnlyHint=false and destructiveHint=false, so the description adds valuable behavioral context beyond those.

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?

The description is well-structured with bullet points and front-loads the primary use case. It is comprehensive but not verbose; all sentences add value. Minor length could be trimmed, but it remains effective.

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?

Given the tool's complexity (10 params, two kinds, nested objects) and minimal annotations, the description covers the two paths, required params, return type, and consumption. It lacks explicit error details but mentions 'fails closed'. The output schema exists, so return values need not be explained.

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 100%, and the description enriches parameter meanings by explaining kind-specific details (e.g., defaults, structure of Hermite endpoints, that controlPoints are in mm). This goes beyond the basic schema descriptions.

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?

The description specifies a clear action (authoring a 3D Curve3D) and resource (user's .kcad.ts file) with precise placement. It distinguishes the two kinds (nurbs and hermite) and differentiates from siblings by naming consumption tools like add_variable_sweep and add_surface.

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?

The description begins with 'Use this when you need to author a 3D Curve3D', providing explicit context for when to use the tool. It explains how to consume the result with other tools but does not state when not to use it or explicitly name alternatives, though the function is specific enough.

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.

TDQS

A3.9/5.0
Disambiguation4/5

Tools are mostly distinct, with clear descriptions for each. However, there is some potential overlap between inspection tools like 'inspect' and 'mesh_summary', and between rendering tools 'render_preview' and 'get_latest_render', which could cause minor confusion.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern, making it predictable for an agent to infer functionality.

Tool Count2/5

44 tools is significantly higher than the typical well-scoped range of 3-15. While the domain is complex, the count feels excessive and could overwhelm an agent.

Completeness4/5

The tool set covers an extensive range of CAD operations including creation, inspection, rendering, export, and verification. Minor gaps exist, such as direct sketch editing tools, but overall it is comprehensive.