{
  "openapi": "3.1.1",
  "info": {
    "title": "Slide Deck Accessibility Checker API",
    "version": "1.0.0",
    "summary": "Check a Markdown slide deck: contrast, slide titles, alt text, reading order and text size.",
    "description": "Every endpoint performs the same calculation as the human page and returns inputs, result, units, assumptions, sources, warnings and computedAt. MCP endpoint: /mcp."
  },
  "servers": [
    {
      "url": "https://deckwrightdecka11ycheck.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Check a Markdown slide deck: contrast, slide titles, alt text, reading order and text size.",
        "description": "Lays out a Markdown deck exactly like the Deckwright exports and checks it: WCAG 2.2 contrast of every colour pair of the theme, a unique title on every slide, alternative text for images, charts and diagrams, the reading order of each slide, link texts, the deck language, text that had to shrink or does not fit, small chart and diagram labels, empty and very dense slides. Every finding names the slide and the WCAG success criterion.\n\nMethodology:\n- Contrast: WCAG 2.2 relative luminance of the sRGB colours and (L1 + 0.05) / (L2 + 0.05) for every pair the theme draws; body text, links, code and subtitles need 4.5:1, titles (30 pt and larger) and graphical marks 3:1 (SC 1.4.3, 1.4.11).\n- Structure: every slide needs a title and titles should be unique (SC 2.4.6; screen readers list PowerPoint and PDF slides by title); images need alternative text that is not a file name (SC 1.1.1); charts and diagrams without their own alt text are reported as using their generated description.\n- Reading order (SC 1.3.2): the exports keep the Markdown order on every slide (title, then text and visuals as written); the report lists it per slide. Link texts such as “here” or “click here” are flagged (SC 2.4.4), a missing deck language too (SC 3.1.1).\n- Layout checks run on the real layout: text that had to shrink, text that does not fit even at 14 pt, chart or diagram labels below 10 pt (warning) or 12 pt (note), slides without content and slides with more than 90 words.\n\nAn automatic check finds structural problems; it cannot judge whether alternative text is accurate or whether the slides make sense. Ask a screen reader user to try important decks.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "deckwright_deck_a11y_check",
        "x-owner-app": "deckwright",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeckwrightDeckA11yCheckInput"
              },
              "examples": {
                "example1": {
                  "summary": "A lesson deck",
                  "value": {
                    "markdown": "---\ntitle: How plants make food\nlang: en\ntheme: harbor\nfooter: Biology · lesson 4\n---\n\n# How plants make food\n\nPhotosynthesis in five slides\n\n---\n\n## The idea in one sentence\n\n\u003e Plants use the energy of light to turn carbon dioxide and water into sugar and oxygen.\n\n---\n\n## What goes in, what comes out\n\n| In | Out |\n|---|---|\n| Carbon dioxide from the air | Sugar (glucose) |\n| Water from the roots | Oxygen |\n| Light energy | |\n\n6 CO₂ + 6 H₂O + light gives C₆H₁₂O₆ + 6 O₂\n\n---\n\n## Where it happens\n\n```mermaid\n%% alt: Photosynthesis happens in the leaf (chloroplasts, stomata) in two stages: light reactions split water and release oxygen; the Calvin cycle fixes carbon dioxide into sugar.\nmindmap\n  Photosynthesis\n    Leaf\n      Chloroplasts\n      Stomata\n    Light reactions\n      Split water\n      Release oxygen\n    Calvin cycle\n      Fix CO₂\n      Build sugar\n```\n\n---\n\n## Try it yourself\n\n- Put a water plant under a lamp\n- Count the oxygen bubbles per minute\n- Move the lamp closer and count again\n\nNotes:\nAsk the class to predict the result before moving the lamp.\n\n---\n\n## Bubbles and light\n\n```chart\ntype: line\ntitle: Bubbles per minute (example class data)\nx: Distance (cm)\ny: Bubbles\nalt: The closer the lamp, the more bubbles: from 4 per minute at 50 cm to 31 per minute at 10 cm.\n\nDistance (cm),Bubbles\n10,31\n20,19\n30,11\n40,7\n50,4\n```\n"
                  }
                },
                "example2": {
                  "summary": "Deck with typical problems",
                  "value": {
                    "markdown": "# Results\n\n---\n\n![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==)\n\nRead more [here](https://example.com/report).\n\n---\n\n## Results\n\n- Same title as before\n\n---\n\nA slide without a title."
                  }
                },
                "example3": {
                  "summary": "Quarterly review in the Midnight theme",
                  "value": {
                    "markdown": "---\ntitle: Quarterly review\nauthor: Example Co\nlang: en\ntheme: paper\nfooter: Example Co · internal\n---\n\n# Quarterly review\n\nWhere we stand after the fourth quarter and what comes next\n\n---\n\n## Agenda\n\n- Results in numbers\n- What **worked** and what did not\n  - Pricing test\n  - New onboarding\n- Plan for the next quarter\n\nNotes:\nThank the team first. Keep this slide under one minute.\n\n---\n\n## Revenue by month\n\n```chart\ntype: bar\ntitle: Revenue in k€ (example data)\nx: Month\ny: Revenue\nalt: Revenue rose every month, from 120 k€ in October to 168 k€ in December.\n\nMonth,Revenue\nOct,120\nNov,141\nDec,168\n```\n\n- December was the best month so far\n- The bundle offer drove a third of the growth\n\nNotes:\nPoint at the December bar. The bundle started on 1 December.\n\n---\n\n## How a support request flows\n\n```diagram\n%% alt: A request is answered with a help article when the issue is known; otherwise a ticket is opened, fixed and answered.\nflowchart LR\n  A[Customer request] --\u003e B{Known issue?}\n  B -- yes --\u003e C[Send help article]\n  B -- no --\u003e D[Open ticket]\n  D --\u003e E[Fix and reply]\n```\n\n---\n\n## Key figures\n\n| Figure | Q3 | Q4 |\n|---|--:|--:|\n| Customers | 1,204 | 1,388 |\n| Churn | 3.1 % | 2.4 % |\n| Replies within a day | 81 % | 92 % |\n\nThe figures are example data.\n\n---\n\n## Next quarter\n\n1. Roll out the new onboarding to everyone\n2. Test yearly prices\n3. Hire a second support person\n",
                    "theme": "midnight",
                    "lang": "en"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeckwrightDeckA11yCheckResult"
                }
              }
            }
          },
          "400": {
            "description": "Malformed JSON body.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input (see errors[]).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded (see Retry-After).",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tool": {
      "get": {
        "operationId": "getToolDefinition",
        "summary": "Inputs, output schema and examples for this tool",
        "responses": {
          "200": {
            "description": "Tool definition.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. 422 responses include per-field `errors`.",
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "DeckwrightDeckA11yCheckInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "markdown": {
            "title": "Deck in Markdown",
            "description": "Slides are separated by a line ---; without separators every # or ## heading starts a slide.",
            "type": "string",
            "maxLength": 400000,
            "default": "---\ntitle: How plants make food\nlang: en\ntheme: harbor\nfooter: Biology · lesson 4\n---\n\n# How plants make food\n\nPhotosynthesis in five slides\n\n---\n\n## The idea in one sentence\n\n\u003e Plants use the energy of light to turn carbon dioxide and water into sugar and oxygen.\n\n---\n\n## What goes in, what comes out\n\n| In | Out |\n|---|---|\n| Carbon dioxide from the air | Sugar (glucose) |\n| Water from the roots | Oxygen |\n| Light energy | |\n\n6 CO₂ + 6 H₂O + light gives C₆H₁₂O₆ + 6 O₂\n\n---\n\n## Where it happens\n\n```mermaid\n%% alt: Photosynthesis happens in the leaf (chloroplasts, stomata) in two stages: light reactions split water and release oxygen; the Calvin cycle fixes carbon dioxide into sugar.\nmindmap\n  Photosynthesis\n    Leaf\n      Chloroplasts\n      Stomata\n    Light reactions\n      Split water\n      Release oxygen\n    Calvin cycle\n      Fix CO₂\n      Build sugar\n```\n\n---\n\n## Try it yourself\n\n- Put a water plant under a lamp\n- Count the oxygen bubbles per minute\n- Move the lamp closer and count again\n\nNotes:\nAsk the class to predict the result before moving the lamp.\n\n---\n\n## Bubbles and light\n\n```chart\ntype: line\ntitle: Bubbles per minute (example class data)\nx: Distance (cm)\ny: Bubbles\nalt: The closer the lamp, the more bubbles: from 4 per minute at 50 cm to 31 per minute at 10 cm.\n\nDistance (cm),Bubbles\n10,31\n20,19\n30,11\n40,7\n50,4\n```\n"
          },
          "theme": {
            "title": "Theme",
            "type": "string",
            "enum": [
              "deck",
              "paper",
              "midnight",
              "harbor",
              "ember",
              "slate",
              "contrast"
            ],
            "default": "deck"
          },
          "lang": {
            "title": "Deck language (BCP 47, e.g. en, de, ar)",
            "description": "Leave empty to use “lang:” from the front matter (English if not set).",
            "type": "string",
            "maxLength": 20,
            "default": ""
          }
        },
        "required": []
      },
      "DeckwrightDeckA11yCheckResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "schemaVersion",
          "tool",
          "computedAt",
          "inputs",
          "summary",
          "result",
          "units",
          "assumptions",
          "sources",
          "warnings",
          "presentation",
          "links"
        ],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "1.0"
          },
          "tool": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "id",
              "name",
              "version"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "inputs": {
            "type": "object",
            "description": "Normalised inputs actually used, including applied defaults."
          },
          "summary": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "passed",
              "errors",
              "warnings",
              "infos",
              "findings",
              "contrast",
              "slides",
              "theme",
              "openInApp"
            ],
            "properties": {
              "passed": {
                "type": "boolean"
              },
              "errors": {
                "type": "integer"
              },
              "warnings": {
                "type": "integer"
              },
              "infos": {
                "type": "integer"
              },
              "theme": {
                "type": "string"
              },
              "findings": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "id",
                    "severity",
                    "slide",
                    "message",
                    "wcag"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "severity": {
                      "enum": [
                        "error",
                        "warning",
                        "info"
                      ]
                    },
                    "slide": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "wcag": {
                      "type": "string"
                    }
                  }
                }
              },
              "contrast": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "name",
                    "fg",
                    "bg",
                    "ratio",
                    "required",
                    "pass"
                  ],
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "fg": {
                      "type": "string"
                    },
                    "bg": {
                      "type": "string"
                    },
                    "ratio": {
                      "type": "number"
                    },
                    "required": {
                      "type": "number"
                    },
                    "pass": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "slides": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "n",
                    "title",
                    "readingOrder",
                    "minTextPt",
                    "words",
                    "images",
                    "visuals",
                    "notes"
                  ],
                  "properties": {
                    "n": {
                      "type": "integer"
                    },
                    "title": {
                      "type": "string"
                    },
                    "readingOrder": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "minTextPt": {
                      "type": "number"
                    },
                    "words": {
                      "type": "integer"
                    },
                    "images": {
                      "type": "integer"
                    },
                    "visuals": {
                      "type": "integer"
                    },
                    "notes": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "openInApp": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "units": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          },
          "assumptions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "title"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "publisher": {
                  "type": "string"
                },
                "retrievedAt": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                }
              }
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "presentation": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Display blocks used by the human page (same data)."
          },
          "links": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "human",
              "api",
              "openapi",
              "methodology"
            ],
            "properties": {
              "human": {
                "type": "string",
                "format": "uri"
              },
              "api": {
                "type": "string",
                "format": "uri"
              },
              "openapi": {
                "type": "string",
                "format": "uri"
              },
              "methodology": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  }
}