Skip to main content
Glama

Validate document

validate_document
Read-only

Validate 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: ValidationReportok (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).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
doc_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
doc_idYes
findingsYes
error_countYes
warning_countYes
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. Description adds rich behavioral context: return shape details, what findings are covered (missing fonts, glyph coverage, etc.), and risk class. No contradictions.

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?

Well-structured: purpose, usage, params, return shape, example, risk class. Each sentence adds value, no wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema is mentioned (ValidationReport) and description covers the output fields and checks performed. Given the tool's complexity, the description is sufficiently complete for an agent to understand behavior and return value.

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

Parameters4/5

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

Schema coverage is 0% but only one param 'doc_id'. Description states 'Key params: none beyond doc_id' and provides example call, which clarifies usage. Could specify that doc_id refers to a loaded document ID.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it validates a document and returns structured findings. It distinguishes from siblings 'quality_report' and 'svg_web_optimize' by specifying their different purposes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says when to use: 'a pass/fail correctness check on a document.' Provides clear alternatives: 'quality_report' for metrics/optimize and 'svg_web_optimize' for size fixes.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jjjsood/inkscape-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server