Validate document
validate_documentValidate a loaded SVG document and return structured findings covering errors, warnings, missing fonts, glyphs, and id issues.
Instructions
Validate a loaded document and return structured, machine-readable findings.
When to use: a pass/fail correctness check on a document. For quantitative metrics + optimize
opportunities use quality_report; to fix size opportunities use svg_web_optimize.
Key params: none beyond doc_id.
Return shape: ValidationReport — ok (True iff no error-severity findings), error_count,
warning_count, and findings (each a stable machine code, a severity
error|warning|info, a human-readable message, and an optional locator). Covers missing
fonts, glyph coverage (a missing_glyphs warning naming the characters a text element's
declared font cannot render — read from the font's own cmap, not fontconfig substitution — plus
a covering family to try), external asset refs, large embedded rasters, id problems (duplicate
ids / dangling #id refs), and viewBox presence/sanity.
Example: validate_document(doc_id)
Risk class: low (read-only validation; document unchanged).
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": {
"doc_id": "<doc_id>"
},
"name": "validate_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| doc_id | Yes | ||
| findings | Yes | ||
| error_count | Yes | ||
| warning_count | Yes |