{"id":"svg-geometry","title":"SVG layout check: clipping, overlaps and empty shapes from supplied geometry","description":"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`.","roi":"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.","audience":"developer","package":"infra-preflight-kit","channels":["x402","mcp"],"endpoint":{"method":"POST","url":"https://agents.writerslogic.com/api/v1/svg-geometry","path":"/api/v1/svg-geometry","contentType":"application/json"},"price":{"amount":"0.005","currency":"USDC","network":"base","perCall":true,"failedCallsCharged":false},"inputSchema":{"type":"object","additionalProperties":false,"required":["shapes"],"properties":{"viewBox":{"type":"string","maxLength":120,"description":"The viewBox attribute value, e.g. \"0 0 800 600\"."},"width":{"type":"number","minimum":0.001,"maximum":10000000,"description":"Viewport width in px (the svg width attribute)."},"height":{"type":"number","minimum":0.001,"maximum":10000000,"description":"Viewport height in px."},"preserveAspectRatio":{"type":"string","maxLength":40,"description":"Default xMidYMid meet."},"shapes":{"type":"array","minItems":1,"maxItems":200,"description":"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.","items":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"id":{"type":"string","maxLength":80},"type":{"type":"string","enum":["rect","circle","ellipse","line","polygon","polyline","text","bbox"]},"x":{"type":"number","minimum":-1000000000,"maximum":1000000000},"y":{"type":"number","minimum":-1000000000,"maximum":1000000000},"width":{"type":"number","minimum":-1000000000,"maximum":1000000000},"height":{"type":"number","minimum":-1000000000,"maximum":1000000000},"cx":{"type":"number","minimum":-1000000000,"maximum":1000000000},"cy":{"type":"number","minimum":-1000000000,"maximum":1000000000},"r":{"type":"number","minimum":-1000000000,"maximum":1000000000},"rx":{"type":"number","minimum":-1000000000,"maximum":1000000000},"ry":{"type":"number","minimum":-1000000000,"maximum":1000000000},"x1":{"type":"number","minimum":-1000000000,"maximum":1000000000},"y1":{"type":"number","minimum":-1000000000,"maximum":1000000000},"x2":{"type":"number","minimum":-1000000000,"maximum":1000000000},"y2":{"type":"number","minimum":-1000000000,"maximum":1000000000},"points":{"type":"array","maxItems":200,"items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number","minimum":-1000000000,"maximum":1000000000}}},"strokeWidth":{"type":"number","minimum":0,"maximum":1000000},"bbox":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"number","minimum":-1000000000,"maximum":1000000000}},"text":{"type":"string","maxLength":500},"fontSize":{"type":"number","minimum":0,"maximum":100000},"textAnchor":{"type":"string","enum":["start","middle","end"]}}}},"checks":{"type":"array","maxItems":3,"items":{"type":"string","enum":["clip","empty","overlap"]},"description":"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."}}},"resultSchema":{"type":"object","properties":{"status":{"type":"string","enum":["pass","fail","unknown","unsupported"],"description":"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":{"type":"array","items":{"type":"number"},"description":"[minX, minY, maxX, maxY] in user units that the viewport displays; empty when it cannot be determined."},"visibleNote":{"type":"string"},"shapes":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"id":{"type":"string"},"bbox":{"type":"array","items":{"type":"number"}},"estimate":{"type":"boolean","description":"true for text boxes (character-count estimate)."},"placement":{"type":"string","enum":["inside","partial","outside","unknown"]}}}},"pairs":{"type":"array","items":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"},"relation":{"type":"string","enum":["partial","nested"]},"exact":{"type":"boolean"}}}},"witnesses":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"detail":{"type":"string"},"path":{"type":"string","description":"JSON pointer or dotted path into the input."},"offset":{"type":"integer"},"index":{"type":"integer"},"expected":{"description":"What the rule required."},"actual":{"description":"What the input had."}}}},"versions":{"type":"object","description":"Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile)."},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"Always true: pure code, no model."}}},"outputSchema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["pass","fail","unknown","unsupported"],"description":"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":{"type":"array","items":{"type":"number"},"description":"[minX, minY, maxX, maxY] in user units that the viewport displays; empty when it cannot be determined."},"visibleNote":{"type":"string"},"shapes":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"id":{"type":"string"},"bbox":{"type":"array","items":{"type":"number"}},"estimate":{"type":"boolean","description":"true for text boxes (character-count estimate)."},"placement":{"type":"string","enum":["inside","partial","outside","unknown"]}}}},"pairs":{"type":"array","items":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"},"relation":{"type":"string","enum":["partial","nested"]},"exact":{"type":"boolean"}}}},"witnesses":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"detail":{"type":"string"},"path":{"type":"string","description":"JSON pointer or dotted path into the input."},"offset":{"type":"integer"},"index":{"type":"integer"},"expected":{"description":"What the rule required."},"actual":{"description":"What the input had."}}}},"versions":{"type":"object","description":"Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile)."},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"Always true: pure code, no model."}}},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]},"example":{"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}]},"openapiOperation":{"operationId":"svg_geometry","summary":"SVG layout check: clipping, overlaps and empty shapes from supplied geometry","description":"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`.\n\nPrice: 0.005 USDC on Base (x402).","x-x402-price-usdc":"0.005","x-x402-amount":"5000","x-payment-info":{"protocols":["x402"],"price":{"mode":"fixed","currency":"USD","amount":"0.005"}},"x-audience":"developer","x-sample-url":"https://agents.writerslogic.com/api/v1/samples/svg-geometry","security":[{"x402":[]},{"apiKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["shapes"],"properties":{"viewBox":{"type":"string","maxLength":120,"description":"The viewBox attribute value, e.g. \"0 0 800 600\"."},"width":{"type":"number","minimum":0.001,"maximum":10000000,"description":"Viewport width in px (the svg width attribute)."},"height":{"type":"number","minimum":0.001,"maximum":10000000,"description":"Viewport height in px."},"preserveAspectRatio":{"type":"string","maxLength":40,"description":"Default xMidYMid meet."},"shapes":{"type":"array","minItems":1,"maxItems":200,"description":"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.","items":{"type":"object","additionalProperties":false,"required":["type"],"properties":{"id":{"type":"string","maxLength":80},"type":{"type":"string","enum":["rect","circle","ellipse","line","polygon","polyline","text","bbox"]},"x":{"type":"number","minimum":-1000000000,"maximum":1000000000},"y":{"type":"number","minimum":-1000000000,"maximum":1000000000},"width":{"type":"number","minimum":-1000000000,"maximum":1000000000},"height":{"type":"number","minimum":-1000000000,"maximum":1000000000},"cx":{"type":"number","minimum":-1000000000,"maximum":1000000000},"cy":{"type":"number","minimum":-1000000000,"maximum":1000000000},"r":{"type":"number","minimum":-1000000000,"maximum":1000000000},"rx":{"type":"number","minimum":-1000000000,"maximum":1000000000},"ry":{"type":"number","minimum":-1000000000,"maximum":1000000000},"x1":{"type":"number","minimum":-1000000000,"maximum":1000000000},"y1":{"type":"number","minimum":-1000000000,"maximum":1000000000},"x2":{"type":"number","minimum":-1000000000,"maximum":1000000000},"y2":{"type":"number","minimum":-1000000000,"maximum":1000000000},"points":{"type":"array","maxItems":200,"items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number","minimum":-1000000000,"maximum":1000000000}}},"strokeWidth":{"type":"number","minimum":0,"maximum":1000000},"bbox":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"number","minimum":-1000000000,"maximum":1000000000}},"text":{"type":"string","maxLength":500},"fontSize":{"type":"number","minimum":0,"maximum":100000},"textAnchor":{"type":"string","enum":["start","middle","end"]}}}},"checks":{"type":"array","maxItems":3,"items":{"type":"string","enum":["clip","empty","overlap"]},"description":"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":{"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}]}}}},"responses":{"200":{"description":"Paid result with provenance","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["pass","fail","unknown","unsupported"],"description":"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":{"type":"array","items":{"type":"number"},"description":"[minX, minY, maxX, maxY] in user units that the viewport displays; empty when it cannot be determined."},"visibleNote":{"type":"string"},"shapes":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"id":{"type":"string"},"bbox":{"type":"array","items":{"type":"number"}},"estimate":{"type":"boolean","description":"true for text boxes (character-count estimate)."},"placement":{"type":"string","enum":["inside","partial","outside","unknown"]}}}},"pairs":{"type":"array","items":{"type":"object","properties":{"a":{"type":"integer"},"b":{"type":"integer"},"relation":{"type":"string","enum":["partial","nested"]},"exact":{"type":"boolean"}}}},"witnesses":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"detail":{"type":"string"},"path":{"type":"string","description":"JSON pointer or dotted path into the input."},"offset":{"type":"integer"},"index":{"type":"integer"},"expected":{"description":"What the rule required."},"actual":{"description":"What the input had."}}}},"versions":{"type":"object","description":"Every semantic dependency of this answer (engine, tables and their as-of dates, tokenizer, calendar, rounding profile)."},"limits":{"type":"array","items":{"type":"string"}},"deterministic":{"type":"boolean","description":"Always true: pure code, no model."}}},"_provenance":{"type":"object","description":"C2PA-aligned manifest and W3C VC 2.0 (eddsa-jcs-2022) issued by the hub DID; verify at POST /api/v1/verify-provenance"}},"required":["data","_provenance"]}}}},"400":{"description":"Invalid request (no payment consumed)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"401":{"description":"Invalid X-API-KEY","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}},"402":{"description":"Payment required or invalid","content":{"application/json":{"schema":{"type":"object","description":"x402 v2 PaymentRequired (also base64 in the PAYMENT-REQUIRED header)","properties":{"x402Version":{"type":"integer"},"error":{"type":"string"},"code":{"type":"string"},"resource":{"type":"object"},"accepts":{"type":"array","items":{"type":"object"}},"extensions":{"type":"object"}}}}}},"502":{"description":"Upstream failure; the payment is released or not settled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}}}}}}}},"links":{"docs":"https://agents.writerslogic.com/docs/svg-geometry/","docsJson":"https://agents.writerslogic.com/docs/svg-geometry.json","sample":"https://agents.writerslogic.com/api/v1/samples/svg-geometry","openapi":"https://agents.writerslogic.com/openapi.json","catalog":"https://agents.writerslogic.com/api/v1/catalog","verifyProvenance":"https://agents.writerslogic.com/api/v1/verify-provenance","index":"https://agents.writerslogic.com/docs/index.json"}}