{
  "openapi": "3.1.1",
  "info": {
    "title": "Font File Inspector & Glyph Coverage API",
    "version": "1.0.0",
    "summary": "Read TTF and OTF family names, styles, metrics and Unicode character coverage.",
    "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://luminafontinspector.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Read TTF and OTF family names, styles, metrics and Unicode character coverage.",
        "description": "Upload a single TrueType or OpenType font to inspect its names, weight, width, italic flag, variable-font presence, units, glyph count and license text when present. Check which non-whitespace characters in your sample map to nonzero glyphs. This file tool uploads to the server; Type Lab inspects fonts locally.\n\nMethodology:\n- Read one sfnt TrueType or CFF OpenType file, validate bounded table ranges, and prefer English Windows Unicode name records, then Unicode and ASCII Macintosh records. Names and license fields are limited to 1024 characters. No font is installed or executed by this tool.\n- Read OS/2 weight and width, italic selection, head units, maxp glyph count and the presence of fvar. Font checksums, outlines, shaping and font safety are not validated.\n- Coverage uses the preferred Unicode cmap format 12 or 4. A nonzero glyph index counts as covered; whitespace is excluded. Without a supported cmap, coverageKnown is false and per-character coverage is unknown. This does not test shaping, ligatures, emoji sequences or visual quality.\n- License text is read from available name records and normalized for display. Missing metadata does not establish usage rights. WOFF, WOFF2, collections and compressed fonts are not supported.",
        "tags": [
          "apps"
        ],
        "x-mcp-tool": "lumina_font_inspector",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LuminaFontInspectorInput"
              },
              "examples": {
                "example1": {
                  "summary": "Inspect an original metadata-only demonstration font",
                  "value": {
                    "font": {
                      "filename": "usefulweb-demo.ttf",
                      "contentType": "font/ttf",
                      "contentBase64": "AAEAAAAFAAAAAAAAaGVhZAAAAAAAAABcAAAANm1heHAAAAAAAAAAlAAAAAZuYW1lAAAAAAAAAJwAAADYY21hcAAAAAAAAAF0AAAALE9TLzIAAAAAAAABoAAAAEAAAQAAAAAAAAAAAABfDzz1AAAD6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAgAAAAAABQBCAAMAAQQJAAEAHAAAAAMAAQQJAAIADgAcAAMAAQQJAAQALAAqAAMAAQQJAAUAFgBWAAMAAQQJAAYAKgBsAFUAcwBlAGYAdQBsAHcAZQBiACAARABlAG0AbwBSAGUAZwB1AGwAYQByAFUAcwBlAGYAdQBsAHcAZQBiACAARABlAG0AbwAgAFIAZQBnAHUAbABhAHIAVgBlAHIAcwBpAG8AbgAgADEALgAwAFUAcwBlAGYAdQBsAHcAZQBiAEQAZQBtAG8ALQBSAGUAZwB1AGwAYQByAAAAAQADAAEAAAAMAAQAIAAAAAQABAABAAAAQf//AAAAQf///8AAAQAAAAAAAAAAAZAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
                    },
                    "text": "A B"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LuminaFontInspectorResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "LuminaFontInspectorInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "font": {
            "title": "Font (TTF or OTF; up to 2 MB; uploaded to the server)",
            "type": "object",
            "description": "Upload as {filename, contentType?, contentBase64}. Max 1953 KiB. Accepts .ttf,.otf.",
            "additionalProperties": false,
            "required": [
              "filename",
              "contentBase64"
            ],
            "properties": {
              "filename": {
                "type": "string"
              },
              "contentType": {
                "type": "string"
              },
              "contentBase64": {
                "type": "string"
              }
            }
          },
          "text": {
            "title": "Text to check (whitespace excluded)",
            "type": "string",
            "maxLength": 2000,
            "default": "Hello ÄÖÜ äöü ß 0123456789"
          }
        },
        "required": [
          "font"
        ]
      },
      "LuminaFontInspectorResult": {
        "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": [
              "family",
              "style",
              "fullName",
              "postscript",
              "version",
              "copyright",
              "license",
              "licenseUrl",
              "format",
              "weight",
              "widthClass",
              "italic",
              "variable",
              "unitsPerEm",
              "glyphs",
              "tables",
              "coverageKnown",
              "characters"
            ],
            "properties": {
              "family": {
                "type": "string"
              },
              "style": {
                "type": "string"
              },
              "fullName": {
                "type": "string"
              },
              "postscript": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "copyright": {
                "type": "string"
              },
              "license": {
                "type": "string"
              },
              "licenseUrl": {
                "type": "string"
              },
              "format": {
                "enum": [
                  "TrueType",
                  "OpenType CFF"
                ]
              },
              "weight": {
                "type": "integer"
              },
              "widthClass": {
                "type": "integer"
              },
              "italic": {
                "type": "boolean"
              },
              "variable": {
                "type": "boolean"
              },
              "unitsPerEm": {
                "type": "integer"
              },
              "glyphs": {
                "type": "integer"
              },
              "tables": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "coverageKnown": {
                "type": "boolean"
              },
              "characters": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "character",
                    "codepoint",
                    "glyph",
                    "covered"
                  ],
                  "properties": {
                    "character": {
                      "type": "string"
                    },
                    "codepoint": {
                      "type": "integer"
                    },
                    "glyph": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "covered": {
                      "type": [
                        "boolean",
                        "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"
              }
            }
          }
        }
      }
    }
  }
}