Paradoc
MCPTools

validate

Last updated on

Validate an Paradoc artifact against the schema and logic rules

Validates an Paradoc artifact (form, document, bundle, or checklist) against the Paradoc schema and optionally checks logic expressions.

Parameters

ParameterTypeRequiredDescription
artifactobjectYesThe Paradoc artifact object to validate
options.schemabooleanNoValidate schema structure (default: true)
options.logicbooleanNoValidate logic expressions (default: true)

Response

FieldTypeDescription
validbooleanWhether the artifact passed validation
detectedKindstringDetected artifact kind: form, document, bundle, or checklist
issuesarrayList of validation issues, each with message and optional path
errorstringError message if validation could not be performed (returned instead of detectedKind and issues)

Example

// Request
{
  "artifact": {
    "kind": "form",
    "title": "My Form",
    "schema": "2026-01-01",
    "fields": []
  }
}

// Response
{
  "valid": true,
  "detectedKind": "form"
}

When validation fails, the response includes the list of issues:

{
  "valid": false,
  "detectedKind": "form",
  "issues": [
    {
      "message": "Required property 'title' is missing",
      "path": ["title"]
    }
  ]
}

Disabling checks

You can disable schema or logic validation independently using the options parameter:

{
  "artifact": { "kind": "form", "..." : "..." },
  "options": {
    "schema": true,
    "logic": false
  }
}

This is useful when you want to validate only the structure without checking logic expressions, or vice versa.

Logic checking

When options.logic is on, every visible / required / def / rule expression is run through the typed @paradoc/expr checker. Each issue names the offending expression and its path in the artifact, and the checker catches:

  • unknown references (for example fields.hasVehicle.value — fields are addressed as fields.<id>, with no .value) and unknown functions
  • type mismatches (comparing a string field to a number)
  • gates that don't evaluate to a boolean

Because the checker shares its type system with runtime evaluation, an expression that passes here will not fail differently when the form is filled.

On this page