Quality report
quality_reportAssess an SVG document's health with validation findings, quantitative metrics, and optimization opportunities to identify what can be improved.
Instructions
Build a machine-readable quality report for a document: validation findings plus metrics.
When to use: assessing a document's health and what optimizing would save. For pass/fail
correctness only use validate_document; to actually strip the opportunities use
svg_web_optimize.
Key params: none beyond doc_id.
Return shape: QualityReport — ok, the validate_document findings (missing fonts, external
assets, large rasters, id problems, viewBox sanity), quantitative metrics (object/node/layer
counts, embedded-raster weight in bytes, font coverage, viewBox health), and opportunities
(keyed identically to svg_web_optimize.removed: editor metadata, unused defs, unreferenced
ids, empty groups, reducible coordinate precision). Every field is structured (not prose).
Example: quality_report(doc_id)
Risk class: low (read-only; document unchanged).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| score | Yes | ||
| doc_id | Yes | ||
| metrics | Yes | Quantitative document metrics (all read-only). | |
| findings | Yes | ||
| error_count | Yes | ||
| opportunities | Yes | ||
| warning_count | Yes |