Skip to main content
Glama

Trace Outline from Image

trace_from_image

Use this when you need to trace features from a reference photo into waypoints. Trace pixel-space features from a reference photo into normalized [0..1] waypoints the agent can map to mm via a known scale anchor and feed to path().spline / path().nurbsSegment. Three backends are dispatched behind the scenes: opencv (deterministic; uniform-bg silhouette only), vision-llm (Claude vision; named points/cluttered backgrounds; caller-supplied ANTHROPIC_API_KEY), and hybrid (opencv silhouette + LLM-labeled named points). Default backend is auto — the tool picks based on the image's corner-color stddev. Accuracy honesty: opencv contour is geometrically exact; vision-LLM is typically 5–10% off on dense landmarks. Per-feature confidence is reported. Caller pays for any vision-LLM API spend via their own ANTHROPIC_API_KEY. Pair with the kernelcad-trace-from-image skill for the conversion-to-mm pipeline.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hintNoOptional free-text hint forwarded to vision-LLM backends (e.g. "a pair of eyewear; trace the upper brow only").
priorsNoCaller-supplied category-norm defaults (e.g. wall thickness) recorded verbatim as `assumed` ledger facts.
backendNoForce a specific backend; default `auto` routes by corner-color stddev.
featuresNoFeatures to trace. Defaults to a single { label: "silhouette", kind: "silhouette" } when omitted.
imageUrlYesURL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path.
validateNoAssumption-ledger strictness. `warn` (default) never blocks. `error` fails the call when any `missing` ledger fact (e.g. scale) is still open.
scaleAnchorNoPixel-to-real-world scale anchor: two measured points on the image. Absent -> the returned ledger's `scale` fact is `missing`.
maxWaypointsPerFeatureNoCap on waypoints per feature. Defaults to 12 (suitable for medium-inflection outlines).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
ledgerYesAssumption ledger: { facts, scale?, unresolvedCount } classifying every fact as visible/inferred/assumed/missing.
featuresYesTraced features with normalized [0..1] waypoints + confidence.
imageDimsYesPixel dimensions [width, height] of the source image.
diagnosticsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedInput schema / properties / priors
      Added value: +{
      +  "description": "Caller-supplied category-norm defaults (e.g. wall thickness) recorded verbatim as `assumed` ledger facts.",
      +  "items": {
      +    "properties": {
      +      "confidence": {
      +        "maximum": 1,
      +        "minimum": 0,
      +        "type": "number"
      +      },
      +      "id": {
      +        "type": "string"
      +      },
      +      "statement": {
      +        "type": "string"
      +      },
      +      "value": {}
      +    },
      +    "required": [
      +      "id",
      +      "statement",
      +      "value",
      +      "confidence"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / scaleAnchor
      Added value: +{
      +  "description": "Pixel-to-real-world scale anchor: two measured points on the image. Absent -> the returned ledger's `scale` fact is `missing`.",
      +  "properties": {
      +    "pixelDistance": {
      +      "description": "Distance in pixels between the two measured points.",
      +      "type": "number"
      +    },
      +    "realDistance": {
      +      "description": "The same distance in real-world units.",
      +      "type": "number"
      +    },
      +    "unit": {
      +      "enum": [
      +        "mm",
      +        "cm",
      +        "in"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "pixelDistance",
      +    "realDistance",
      +    "unit"
      +  ],
      +  "type": "object"
      +}
    • addedInput schema / properties / validate
      Added value: +{
      +  "description": "Assumption-ledger strictness. `warn` (default) never blocks. `error` fails the call when any `missing` ledger fact (e.g. scale) is still open.",
      +  "enum": [
      +    "warn",
      +    "error"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / ledger
      Added value: +{
      +  "additionalProperties": true,
      +  "description": "Assumption ledger: { facts, scale?, unresolvedCount } classifying every fact as visible/inferred/assumed/missing.",
      +  "type": "object"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "ok",
      -  "features",
      -  "imageDims",
      -  "diagnostics"
      -]New value: +[
      +  "ok",
      +  "features",
      +  "imageDims",
      +  "diagnostics",
      +  "ledger"
      +]
  2. Added
  3. Removed
  4. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "properties": {
      +    "diagnostics": {
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "features": {
      +      "description": "Traced features with normalized [0..1] waypoints + confidence.",
      +      "items": {
      +        "additionalProperties": true,
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "imageDims": {
      +      "description": "Pixel dimensions [width, height] of the source image.",
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    },
      +    "ok": {
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "ok",
      +    "features",
      +    "imageDims",
      +    "diagnostics"
      +  ],
      +  "type": "object"
      +}
  5. First observed

TDQS

A4.7/5.0
Behavior5/5

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

The description goes well beyond the minimal annotations by disclosing backend dispatch behavior, backend determinism, vision-LLM accuracy fallibility (5–10% off on dense landmarks), per-feature confidence reporting, and caller-paid API costs. This is exactly the kind of behavioral nuance an agent needs to set expectations and avoid surprise spend.

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?

The description is dense but every clause earns its place: use case, output representation, backend dispatch, accuracy, cost, and the companion skill. It is front-loaded with the primary purpose and does not repeat schema content.

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?

Given its complexity (8 params, nested objects, output schema), the description covers the critical integration points: normalized output, mm-scale anchoring, backend selection, cost implications, confidence reporting, and the companion skill. The output schema exists, so not explaining return fields is acceptable.

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% so the baseline is 3, but the description adds meaningful context on top: it explains how scaleAnchor maps pixel waypoints to mm, clarifies backend selection semantics beyond the enum labels, and positions features/hints against the different backends. This makes key parameters operationally intelligible without restating the schema.

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 opens with a specific verb-resource-output statement: 'trace features from a reference photo into waypoints,' then clarifies the output format (normalized [0..1] waypoints) and downstream use (path().spline / path().nurbsSegment). This clearly distinguishes it from broader image tools like mesh_to_features or project_curve.

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?

It explicitly says 'Use this when you need to trace features from a reference photo into waypoints' and adds a pairing note with the kernelcad-trace-from-image skill for the mm conversion. It lacks an explicit when-not-to-use or named alternative, but the context is strong enough for an agent to recognize the intended scenario.

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.