Skip to main content
Glama

Split a sheet of icons

split_icon_sheet

Splits a contact sheet grid of icons into individual traced SVGs with transparent backgrounds, consistent ink, and icon-set-ready viewBoxes.

Instructions

Cut a CONTACT SHEET — a grid of many icons on one canvas, which is what image models usually return for "a set of icons" — into individual traced SVGs. Detects the tiles (grid or free layout; pass grid when you know the layout, which also keeps an icon drawn as separate pieces whole), crops each with the sheet's own paper colour, and traces each one with its own plan: a one-ink glyph goes mono, a shaded badge goes colour. Tiles come back transparent (removeBackground is ON here) and every mono tile of the same ink is painted in ONE ink, so a set stays consistent; ink: "currentColor" and normalize: 24 give you icon-set-ready files in one call. Caption text under the icons is detected and reported, but not read (OCR is browser-only), so tiles are named by position — or by names, in reading order. Each run records what it wrote in logolab-sheet.json and removes what a previous run with the same prefix left behind.

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": {
      "sheet": "<sheet>",
      "outDir": "<outDir>"
    },
    "name": "split_icon_sheet"
  }
}

Input Schema

NameRequiredDescriptionDefault
gapNoForce the grouping gap in source px. Omit to detect it; prefer `grid` when the layout is known.
inkNoPaint a MONO trace in this instead of the ink the probe read: a hex colour, or "currentColor" so the icon takes the CSS text colour (what an icon set wants). Colour traces keep their colours.
gridNoThe layout, when you know it: { rows, cols }. Everything inside one cell is one icon, however far apart its pieces are (a dashed curve, four corner brackets, a dashboard of four rectangles) — the case no `gap` value can express. Omit to detect the layout.
modeNoPer-tile colour decision. Default auto.
insetNoWith normalize: units kept clear on each side. Default size/12 (2 on a 24 grid, as Lucide draws).
limitNoTrace at most this many tiles (tracing is the slow part). A limited run is a preview: it removes nothing.
namesNoFile names for the icons in READING order (row-major, top-left first): ["home", "search", …] writes home.svg, search.svg, …. Icons past the end of the list keep <prefix>-nn.
quietNoReturn only the summary (one line per icon for a sheet) and skip the JSON block. For batches, where the JSON repeats what the summary says.
sheetYesPath to the sheet image.
detailNohigh lifts the flat-art raster cap 2048 → 4096: crisper, ~4x the work.
outDirYesDirectory to write one SVG per detected icon into.
prefixNoFile-name stem: <prefix>-01.svg. Default: the sheet file name.
paddingNoPadding around each icon as a fraction of its long side. Default 0.08.
strokesNoTrace LINE ART as centreline strokes with a measured stroke-width (open and closed stroked paths you can re-weight), instead of filled outlines of each line. Ink no stroke explains (a dot, a note head) still becomes a fill. In colour mode each stroke is painted in the ink it runs through. Default off.
fidelityNoShape-beautification tolerance in px; 0 disables snapping to circles/lines.
layeringNoColour mode. stacked (default): a shape paints under the shapes in front of it — fewer nodes, no hairline seams between colours, shapes stay whole in a design tool. tiled: shapes fit edge to edge, with a hole wherever another sits inside. Same edges either way; mono ignores it.
despeckleNo0 keeps every speck, 100 is aggressive. Default 25.
gradientsNoDefault auto.
keepCropsNoAlso write each tile as a PNG next to its SVG.
normalizeNoRefit the SVG into a square viewBox of this many units: normalize: 24 fits the art into "0 0 24 24", centred, with `inset` units clear on every side, coordinates rounded to 2 decimals — so every icon of a set shares one grid. Stroke widths scale with it. Omit to keep the viewBox at the traced pixel size.
smoothingNo0 = crisp and node-dense, 100 = smooth and sparse. Default 50.
thresholdNoHow far from the paper colour a pixel counts as ink. Default 24.
strokesOnlyNoWith `strokes`: NO filled paths at all — the ink no stroke explains (a dot, a note head, a solid shape) is drawn as round-capped strokes too, along its own middle and as wide as it is there; a dot is a round-capped point. Nothing is dropped, but a shape that is not a line is approximated (a square comes back with round ends). For plotters and stroke-only icon sets. Default off.
removeBackgroundNoDefault TRUE on a sheet: tiles come back transparent. Pass false to keep each tile's paper as a rectangle under the ink.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

With zero annotations the description carries the full load and does it well: it discloses that tiles return transparent, that mono tiles share one ink, that captions are detected but not OCR'd, that files are named by position or `names`, and — critically — that a run removes what a previous run with the same prefix left behind. That last point is the destructive behavior an agent most needs warned about. It does not describe failure modes for a missing or non-sheet image.

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?

Dense but front-loaded: the what and the why precede the parameter notes, and nearly every clause carries a distinct fact (grid semantics, per-tile trace plan, ink unification, caption limitation, log/replace behavior). For a 24-parameter tool this is compact, with no filler sentences.

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?

Covers the output contract ('tiles come back transparent'), the side-effect log write, the replace behavior of repeat runs, and the summary-vs-JSON output split — substantial for a tool with no output schema and no annotations. What remains thin is error handling for a sheet that isn't actually a grid, and how detection fails when tiles touch.

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

Parameters5/5

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

The schema already documents all 24 parameters at high coverage, so the description only needed to stay consistent; instead it adds cross-parameter meaning the schema cannot express on its own — 'ink: currentColor and normalize: 24 give you icon-set-ready files in one call', and that a limited run removes nothing. It explains how the knobs combine rather than restating them.

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 specific verb and resource: 'Cut a CONTACT SHEET ... into individual traced SVGs', and explicitly scopes it to a multi-icon grid 'which is what image models usually return for a set of icons'. That scope implicitly separates it from a single-icon tracer, though no sibling is named outright.

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?

Gives real when-to guidance at the parameter level: pass `grid` when the layout is known (and why — it keeps multi-piece icons whole), omit to auto-detect, and `limit` produces a non-destructive preview. It stops short of naming trace_icon as the alternative for single images, so the tool-selection boundary must be inferred.

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

This server cannot be deployed

Other Tools