{
  "openapi": "3.1.1",
  "info": {
    "title": "Browser Compatibility Checker API",
    "version": "1.0.0",
    "summary": "Which browsers support a CSS property, JS API or HTML element? MDN data + Baseline status.",
    "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://browsercompatibilitychecker.usefulweb.site"
    }
  ],
  "paths": {
    "/api/v1/calculate": {
      "post": {
        "operationId": "calculate",
        "summary": "Which browsers support a CSS property, JS API or HTML element? MDN data + Baseline status.",
        "description": "Look up a web platform feature by its MDN browser-compat-data key (css.properties.container, api.Navigator.share) or by free text (container queries, dialog, structuredClone) and get the first supporting version per browser, flags/prefix/partial notes, the current browser versions and the Baseline status from web-features.\n\nMethodology:\n- Data: the published @mdn/browser-compat-data package (data.json from unpkg), pruned to one record per feature and cached for 7 days. Baseline status comes from the web-features package (status.by_compat_key). If the download fails, a bundled subset of the same data is used and the result says so.\n- An exact BCD key is looked up directly; otherwise every word must appear in the key, the description or the Baseline feature name. Shallower keys and whole-segment matches rank first.\n- Each cell is BCD's first (main) support statement: the version that added the feature, \"No\", or notes for partial support, prefixes, alternative names, flags and removal. Other statements (e.g. older prefixed versions) are summarised in BCD itself, linked via MDN.\n- Baseline: \"widely available\" = supported in Chrome, Edge, Firefox and Safari (desktop and mobile) for 30 months; \"newly available\" = supported in all of them; otherwise \"limited availability\".",
        "tags": [
          "developer"
        ],
        "x-mcp-tool": "browser_compatibility_checker",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrowserCompatibilityCheckerInput"
              },
              "examples": {
                "example1": {
                  "summary": "CSS container property",
                  "value": {
                    "query": "css.properties.container",
                    "source": "bundled"
                  }
                },
                "example2": {
                  "summary": "Web Share API (navigator.share)",
                  "value": {
                    "query": "api.Navigator.share",
                    "source": "bundled"
                  }
                },
                "example3": {
                  "summary": "Search \"dialog\"",
                  "value": {
                    "query": "dialog",
                    "source": "bundled",
                    "maxResults": 8
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Calculation result envelope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserCompatibilityCheckerResult"
                }
              }
            }
          },
          "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"
                }
              }
            }
          }
        }
      },
      "BrowserCompatibilityCheckerInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "query": {
            "title": "Feature",
            "description": "A BCD key (dot path) or search words.",
            "type": "string",
            "maxLength": 200,
            "default": "css.properties.container"
          },
          "source": {
            "title": "Data",
            "type": "string",
            "enum": [
              "live",
              "bundled"
            ],
            "default": "live"
          },
          "maxResults": {
            "title": "Maximum search results",
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 10
          }
        },
        "required": [
          "query"
        ]
      },
      "BrowserCompatibilityCheckerResult": {
        "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",
            "required": [
              "query",
              "matches",
              "data"
            ],
            "properties": {
              "query": {
                "type": "string"
              },
              "matches": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "feature": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "mdnUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "specUrl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "description": {
                    "type": "string"
                  },
                  "experimental": {
                    "type": "boolean"
                  },
                  "standardTrack": {
                    "type": "boolean"
                  },
                  "deprecated": {
                    "type": "boolean"
                  },
                  "baseline": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": [
                          "high",
                          "low",
                          "limited"
                        ]
                      },
                      "lowDate": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "highDate": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "feature": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    }
                  },
                  "support": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "browser",
                        "versionAdded",
                        "text",
                        "supported"
                      ],
                      "properties": {
                        "browser": {
                          "type": "string"
                        },
                        "versionAdded": {
                          "type": [
                            "string",
                            "boolean",
                            "null"
                          ]
                        },
                        "versionRemoved": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "text": {
                          "type": "string"
                        },
                        "supported": {
                          "type": "boolean"
                        },
                        "currentVersion": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              },
              "data": {
                "type": "object",
                "required": [
                  "origin",
                  "bcdVersion",
                  "bcdTimestamp"
                ],
                "properties": {
                  "origin": {
                    "type": "string",
                    "enum": [
                      "live",
                      "cache",
                      "bundled"
                    ]
                  },
                  "bcdVersion": {
                    "type": "string"
                  },
                  "bcdTimestamp": {
                    "type": "string"
                  },
                  "webFeaturesVersion": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "fetchedAt": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "featureCount": {
                    "type": "integer"
                  }
                }
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}