Skip to main content
Glama

Add Text

add_text

Use this when you need to author text into a kernelCAD script before the last top-level return. One authoring path, selected by mode:

  • 'sketch' — insert a sketch.text(...) call. The emitted sketch is chainable: pair with subsequent .extrude(...) / cut(...) edits to land an engraved or raised text feature.

  • 'emboss' — insert a <shape>.embossText({...}) chained call onto an existing Shape target. Use for engraved brand text on faces (Ray-Ban temple, CE mark, model number). depth > 0 raises text out of the face; depth < 0 engraves text into the face. Lowers via replicad drawText → sketchOnFace → extrude → fuse|cut. Default font is the runtime-bundled Liberation Sans. Side-effect-free; returns the modified code plus diagnostics from re-evaluating. Each mode fails closed on its own missing required params.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe .kcad.ts source code.
faceNomode:'emboss' — target face — canonical name ('top'/'bottom'/'left'/'right'/'front'/'back') or label.
fontNomode:'sketch' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans.
modeYesWhich text-authoring path to use.
sizeNomode:'sketch'|'emboss' — glyph cap height in mm (positive finite).
alignNomode:'sketch' — horizontal alignment relative to position (default left); mode:'emboss' — relative to the UV anchor (default center).
depthNomode:'emboss' — signed extrusion depth in mm: positive emboss out, negative engrave in. Must be non-zero.
bindAsNomode:'sketch' — emits `const <bindAs> = sketch.text(...)`; mode:'emboss' — emits `const <bindAs> = <target>.embossText(...);`.
targetNomode:'emboss' — variable name of the Shape to chain onto (inserted verbatim).
anchorUNomode:'emboss' — U anchor in [0, 1] face-local (0=umin, 0.5=centre, 1=umax). Default 0.5.
anchorVNomode:'emboss' — V anchor in [0, 1] face-local. Default 0.5.
contentNomode:'sketch' — text content (UTF-8, non-empty, non-whitespace).
positionNomode:'sketch' — [x, y] anchor in mm. Default [0, 0].
rotationNomode:'sketch' — CCW rotation in degrees around position (default 0); mode:'emboss' — CCW rotation in the face tangent plane (default 0).
scaleModeNomode:'emboss' — Drawing.sketchOnFace scaling mode. Default original.
fontFamilyNomode:'emboss' — optional logical font name or .ttf file path; defaults to bundled Liberation Sans.
textContentNomode:'emboss' — text content (UTF-8, non-empty, non-whitespace).

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/5.0
Behavior4/5

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

Annotations already indicate readOnlyHint=false and destructiveHint=false, meaning the tool modifies code but is not destructive. The description adds context about the default font, side-effect-free behavior, and return of modified code plus diagnostics, which enhances transparency beyond annotations.

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 concise and well-structured, starting with a clear purpose then detailing modes. It avoids fluff but could be slightly more compact.

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?

Given the tool's complexity (17 parameters, 2 modes, output schema exists), the description covers the main behaviors and parameter groups. However, it lacks explicit guidance on parameter dependencies or mutual exclusivity, which would improve completeness.

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

Parameters3/5

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

Schema description coverage is 100% with clear descriptions for each parameter. The tool description adds narrative grouping by mode and clarifies defaults, but this adds limited value beyond the schema's already-detailed parameter 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 clearly states the tool is for authoring text into a kernelCAD script, and distinguishes between two modes (sketch and emboss) with specific actions for each. This provides a clear verb+resource purpose and differentiates from sibling tools.

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 explicitly explains when to use each mode (e.g., 'sketch' for chainable text, 'emboss' for engraved/raised features) and mentions failure modes. However, it does not provide explicit guidance on when not to use the tool or compare alternatives.

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.