Skip to main content
Glama

Trace Outline from Image

trace_from_image
Idempotent

Use this when you need to trace a reference image into normalized 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 (vision model; named points/cluttered backgrounds; needs a configured vision endpoint), and hybrid (opencv silhouette + LLM-labeled named points). Default backend is auto. Per-feature confidence is reported. Pair with the kernelcad-trace-from-image skill for the conversion-to-mm pipeline. Hosted: give the file as an https:// URL, a data: URI (base64, max 25 MB) or "asset:" from request_upload (when the file is on the user's device).

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": {
      "image_url": "<image_url>"
    },
    "name": "trace_from_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
hintNoOptional free-text hint forwarded to vision-LLM backends (e.g. "a pair of eyewear; trace the upper brow only").
intentNoThe user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.
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.
validateNoAssumption-ledger strictness. `warn` (default) never blocks. `error` fails the call when any `missing` ledger fact (e.g. scale) is still open.
image_urlYesURL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path.
scale_anchorNoPixel-to-real-world scale anchor: two measured points on the image. Absent -> the returned ledger's `scale` fact is `missing`.
max_waypoints_per_featureNoCap on waypoints per feature. Defaults to 12 (suitable for medium-inflection outlines).

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • removedInput schema / properties / imageUrl
      Removed value: -{
      -  "description": "URL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path. Hosted server: pass an https:// URL, a data: URI, or \"asset:<id>\" from request_upload — not a path on your machine.",
      -  "type": "string"
      -}
    • addedInput schema / properties / image_url
      Added value: +{
      +  "description": "URL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path.",
      +  "type": "string"
      +}
    • removedInput schema / properties / maxWaypointsPerFeature
      Removed value: -{
      -  "description": "Cap on waypoints per feature. Defaults to 12 (suitable for medium-inflection outlines).",
      -  "minimum": 2,
      -  "type": "integer"
      -}
    • addedInput schema / properties / max_waypoints_per_feature
      Added value: +{
      +  "description": "Cap on waypoints per feature. Defaults to 12 (suitable for medium-inflection outlines).",
      +  "minimum": 2,
      +  "type": "integer"
      +}
    • removedInput schema / properties / scaleAnchor
      Removed 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 / scale_anchor
      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": {
      +    "pixel_distance": {
      +      "description": "Distance in pixels between the two measured points.",
      +      "type": "number"
      +    },
      +    "real_distance": {
      +      "description": "The same distance in real-world units.",
      +      "type": "number"
      +    },
      +    "unit": {
      +      "enum": [
      +        "mm",
      +        "cm",
      +        "in"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "pixel_distance",
      +    "real_distance",
      +    "unit"
      +  ],
      +  "type": "object"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "imageUrl"
      -]New value: +[
      +  "image_url"
      +]
  2. Changed1 schema field changed
    • removedInput schema / properties / detectParts
      Removed value: -{
      -  "description": "Optional: use the configured vision model to detect labeled component boxes and return detectedParts plus a draftBom, normalized to the traced outline frame.",
      -  "type": "boolean"
      -}
  3. Changed1 schema field changed
    • addedInput schema / properties / priors / items / properties / value / type
      Added value: +[
      +  "string",
      +  "number",
      +  "boolean",
      +  "array",
      +  "object"
      +]
  4. Changed1 schema field changed
    • addedInput schema / properties / detectParts
      Added value: +{
      +  "description": "Optional: use the configured vision model to detect labeled component boxes and return detectedParts plus a draftBom, normalized to the traced outline frame.",
      +  "type": "boolean"
      +}
  5. Changed2 schema fields changed
    • removedOutput schema / properties
      Removed value: -{
      -  "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"
      -  },
      -  "ledger": {
      -    "additionalProperties": true,
      -    "description": "Assumption ledger: { facts, scale?, unresolvedCount } classifying every fact as visible/inferred/assumed/missing.",
      -    "type": "object"
      -  },
      -  "ok": {
      -    "type": "boolean"
      -  }
      -}
    • removedOutput schema / required
      Removed value: -[
      -  "ok",
      -  "features",
      -  "imageDims",
      -  "diagnostics",
      -  "ledger"
      -]
  6. Changed2 schema fields changed
    • changedInput schema / properties / imageUrl / description
      Previous value: -"URL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path."New value: +"URL or path to the reference image. Supports file://, http(s)://, data:image/...;base64,..., or a bare filesystem path. Hosted server: pass an https:// URL, a data: URI, or \"asset:<id>\" from request_upload — not a path on your machine."
    • addedInput schema / properties / intent
      Added value: +{
      +  "description": "The user's request in one sentence, in the user's own words and language (e.g. 'M4 bracket for a 25 mm tube, print on Bambu A1'). Helps kernelCAD improve; leave out personal data.",
      +  "maxLength": 2000,
      +  "type": "string"
      +}
  7. 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"
      +]
  8. Added
  9. Removed
  10. 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"
      +}
  11. First observed

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 the three-backend dispatch model, that `auto` routes by corner-color stddev, that per-feature confidence is reported, the 25 MB data-URI cap, that vision-llm requires a configured endpoint, and that an absent scale_anchor leaves the ledger `scale` fact `missing` (interacting with `validate`). The openWorldHint and non-readOnly annotations are supplemented rather than contradicted by this network/asset-access detail.

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-loaded with the when-to-use clause, then backends, then delivery mechanics, which is a sensible reading order. It is on the dense side — several parenthetical asides packed into two long sentences — but nearly every clause carries operative information, so little is wasted.

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 a 9-parameter tool with nested objects and an output schema, the description covers the decision points an agent needs: which backend, what input forms are accepted, what happens without a scale anchor, and how strictness works. Return-value details are appropriately left to the output 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; the description still adds value by explaining why waypoints matter (mm mapping via a scale anchor) and by framing backends as a routing decision rather than a raw enum. It does not add much per-parameter syntax beyond the schema, so it is a modest gain over the baseline rather than a full 5.

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?

States a specific verb and resource: 'trace a reference image into normalized waypoints', plus the concrete coordinate space ('pixel-space features ... into normalized [0..1] waypoints'). It also explains what the output is destined for ('feed to path().spline / path().nurbsSegment'), so an agent knows this is a geometry-production step, not a generic vision call.

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?

Strong conditional routing guidance: opencv for 'uniform-bg silhouette only', vision-llm for 'named points/cluttered backgrounds; needs a configured vision endpoint', hybrid for both, and the note to pair with the `kernelcad-trace-from-image` skill for mm conversion. It also names the input-delivery alternatives (https URL, data: URI, `asset:<id>` from request_upload). It stops short of stating when to choose this over a sibling like drawing_to_cad, so it is not a full 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.