Skip to main content
Glama

Validate template DSL

validate_dsl
Read-onlyIdempotent

Validate a PDF template DSL script for structure, tag/style correctness, and accessibility issues. Runs catalog validation plus alt-text checks. Cheap — no rendering. Returns JSON { valid, issues: [{ severity, message, path, rule }], summary: { errors, warnings } }; valid is false when any issue has severity 'error', and a script that fails to execute comes back as a single 'dsl-execution' error rather than a tool error. Mirrors POST /api/v1/preview/validate.

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": {
      "dsl": "<dsl>"
    },
    "name": "validate_dsl"
  }
}

Input Schema

NameRequiredDescriptionDefault
dslYesThe builder DSL script to validate. Must assign `const template = doc(...)`.
dataNoOptional binding data. Falls back to the script's sampleData when omitted.

Output Schema

NameRequiredDescriptionDefault
validYesFalse when any issue has severity 'error'; warnings alone leave it true.
issuesYesEvery problem found, errors and warnings together.
summaryYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / dsl / description
      Previous value: -"The builder DSL script to validate. Must define a template (see skills/pdf-template-author.md)."New value: +"The builder DSL script to validate. Must assign `const template = doc(...)`."
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "issues": {
      +      "description": "Every problem found, errors and warnings together.",
      +      "items": {
      +        "properties": {
      +          "message": {
      +            "description": "What is wrong and, usually, how to fix it.",
      +            "type": "string"
      +          },
      +          "path": {
      +            "description": "Location in the document tree (e.g. 'kids[0].kids[2]'); empty when it applies to the whole document.",
      +            "type": "string"
      +          },
      +          "rule": {
      +            "description": "Identifier of the check that raised the issue.",
      +            "type": "string"
      +          },
      +          "severity": {
      +            "enum": [
      +              "error",
      +              "warning"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "severity",
      +          "message",
      +          "path",
      +          "rule"
      +        ],
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "summary": {
      +      "properties": {
      +        "errors": {
      +          "description": "Number of issues with severity 'error'.",
      +          "type": "integer"
      +        },
      +        "warnings": {
      +          "description": "Number of issues with severity 'warning'.",
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "errors",
      +        "warnings"
      +      ],
      +      "type": "object"
      +    },
      +    "valid": {
      +      "description": "False when any issue has severity 'error'; warnings alone leave it true.",
      +      "type": "boolean"
      +    }
      +  },
      +  "required": [
      +    "valid",
      +    "issues",
      +    "summary"
      +  ],
      +  "type": "object"
      +}
  3. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, closed-world, non-destructive, so the safety profile is covered. The description goes beyond them usefully: it discloses cost ('no rendering'), the return shape, the rule that `valid` is false only when an 'error'-severity issue exists, and that a script that fails to execute returns a 'dsl-execution' error rather than a tool error — a genuinely important behavioral detail.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then cost, then return contract — a sensible order with no filler. It is dense but every clause carries information; only the trailing 'Mirrors POST /api/v1/preview/validate' is of marginal value to an agent choosing a tool.

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 exists, yet the description still summarizes the response contract and the error-vs-issue distinction, which is the main ambiguity for a validator. Combined with annotations covering safety and a fully described 2-param schema, an agent has everything needed to call it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so both parameters (dsl, data) are already documented, including the `const template = doc(...)` requirement and the sampleData fallback. The description adds no new parameter meaning, so the baseline 3 applies.

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?

States a specific verb (validate) plus the resource (PDF template DSL script) and enumerates the checked dimensions: structure, tag/style correctness, accessibility. 'Cheap — no rendering' implicitly separates it from render_dsl_preview, so an agent can pick it without opening a schema.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: 'no rendering' hints this is the cheap pre-check before rendering, but the description never says 'call this before render_dsl_preview' or names any alternative. The agent must infer from the cost remark that this is the pre-flight option.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources