Protocol Schema

The Diagram Scene Protocol (DSP) is formally defined by two JSON Schema files. These are the canonical, machine-readable specification for scene documents and operation envelopes.

Schema files

SchemaURLDescription
Scene Schemascene.schema.jsonDefines the structure of DSP scene documents - elements, styles, assets, constraints, computed data
Operations Schemaops.schema.jsonDefines the structure of operation envelopes and all 17 operation types

Both schemas use JSON Schema Draft 2020-12.

Scene schema

The scene schema (scene.schema.json) defines:

Operations schema

The operations schema (ops.schema.json) defines:

Using the schemas

Validation

Use any JSON Schema validator to check scene documents or operation payloads against the schemas:

# Using ajv-cli
npx ajv validate -s https://zindex.ai/schemas/scene.schema.json -d my-scene.json

# Using Python jsonschema
python3 -c "
import json, jsonschema, urllib.request
schema = json.loads(urllib.request.urlopen('https://zindex.ai/schemas/scene.schema.json').read())
scene = json.load(open('my-scene.json'))
jsonschema.validate(scene, schema)
print('Valid')
"

Code generation

Generate TypeScript, Python, or other language types from the schemas:

# Using json-schema-to-typescript
npx json-schema-to-typescript https://zindex.ai/schemas/scene.schema.json > dsp-types.ts

Agent discovery

Agents can fetch the schemas programmatically to understand the protocol structure:

GET https://zindex.ai/schemas/scene.schema.json
GET https://zindex.ai/schemas/ops.schema.json

These URLs are stable and can be referenced in agent instructions, MCP tool descriptions, or system prompts.