SVG layout check: clipping, overlaps and empty shapes from supplied geometry
Checks up to 200 SVG shapes you describe (rect, circle, ellipse, line, polygon, polyline, text, or a path's bounding box) against the viewBox and viewport the way an SVG renderer would: finds shapes clipped or entirely outside the drawn region, shapes that render nothing (zero or negative size, unstroked line), partial overlaps between shapes, and a zero, negative or malformed viewBox, for agents that generate diagrams, charts or icons. It does not parse SVG markup or path data, apply transforms, CSS or clip-paths, or render anything; text boxes are ESTIMATES from the character count and font size (no font metrics), and any finding that depends on an estimate or on bounding boxes of round or polygonal shapes yields `unknown`, not `fail`.
What you get
Labels that spill off the canvas and overlapping shapes are the usual flaws in generated diagrams; the coordinates of each violation come back without rendering.
Call it
Send the JSON body below to https://agents.writerslogic.com/api/v1/svg-geometry. An unpaid request answers 402 with the price and how to pay; a request that fails with a 5xx status is not charged.
curl -i -X POST https://agents.writerslogic.com/api/v1/svg-geometry \
-H 'content-type: application/json' \
-d '{"viewBox":"0 0 200 100","shapes":[{"id":"card","type":"rect","x":10,"y":10,"width":120,"height":60},{"id":"badge","type":"circle","cx":120,"cy":40,"r":25},{"id":"title","type":"text","x":150,"y":90,"text":"Quarterly revenue","fontSize":14}]}'
Input
| Field | Type | Required | Description |
|---|---|---|---|
viewBox | string; length 0..120 | no | The viewBox attribute value, e.g. "0 0 800 600". |
width | number; 0.001..10000000 | no | Viewport width in px (the svg width attribute). |
height | number; 0.001..10000000 | no | Viewport height in px. |
preserveAspectRatio | string; length 0..40 | no | Default xMidYMid meet. |
shapes | array<object>; max 200 items | yes | Shapes in user coordinates (no transform). rect: x,y,width,height. circle: cx,cy,r. ellipse: cx,cy,rx,ry. line: x1,y1,x2,y2,strokeWidth. polygon/polyline: points. text: x,y,text,fontSize,textAnchor. bbox: bbox [minX,minY,maxX,maxY] for a path you measured yourself. |
checks | array<string; one of "clip", "empty", "overlap">; max 3 items | no | Subset of clip, empty, overlap; default all. Overlap reports partial overlaps only; a shape fully inside another (a label on a card) is listed as nested and never fails. |
Example request body
{
"viewBox": "0 0 200 100",
"shapes": [
{
"id": "card",
"type": "rect",
"x": 10,
"y": 10,
"width": 120,
"height": 60
},
{
"id": "badge",
"type": "circle",
"cx": 120,
"cy": 40,
"r": 25
},
{
"id": "title",
"type": "text",
"x": 150,
"y": 90,
"text": "Quarterly revenue",
"fontSize": 14
}
]
}
Result
The response is { "data": ..., "_provenance": ... }. data carries these fields; _provenance is a signed W3C Verifiable Credential with a C2PA-style manifest, checked free at POST /api/v1/verify-provenance.
| Field | Type | Required | Description |
|---|---|---|---|
status | string; one of "pass", "fail", "unknown", "unsupported" | no | pass: every rule held. fail: a rule was violated (see witnesses). unknown: the input lacks the evidence to decide. unsupported: outside what this engine covers. Missing evidence is never a pass. |
visibleRegion | array<number> | no | [minX, minY, maxX, maxY] in user units that the viewport displays; empty when it cannot be determined. |
visibleNote | string | no | |
shapes | array<object> | no | |
pairs | array<object> | no | |
witnesses | array<object> | no | |
versions | object | no | Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile). |
limits | array<string> | no | |
deterministic | boolean | no | Always true: pure code, no model. |
Pay and connect
Available through: x402 (USDC on Base), MCP. MCP clients reach it through the infra-preflight-kit package.
Machine-readable
- This agent as JSON (schemas, example, OpenAPI operation)
- Free signed sample response
- OpenAPI 3.1 · Catalog · Index of every agent