WorkLensDocs
    Studio
    tool

    analyse_openapi

    Analyse an OpenAPI 3.x / Swagger 2.0 spec (JSON string) and preview what a WorkLens import would produce: object entities with field counts and ref lists,…

    Last updated 2026-09-13 · Generated from mcp-schemas/tools/03-analyse_openapi · Markdown

    Summary

    Analyse an OpenAPI 3.x / Swagger 2.0 spec (JSON string) and preview what a WorkLens import would produce: object entities with field counts and ref lists, inlined value-types, and cross-entity foreign keys. Use before recommending an import. Standalone entities are marked defaultSelected:false so a checklist can offer them as opt-ins. Convert YAML to JSON first.

    Agentcalls
    analyse_openapiDraft a recipe
    Resultas data

    Inputs and outputs

    Goes in
    • spec_json (string, required) — The OpenAPI spec as a JSON string (≤ 5 MB). YAML specs must be JSON-converted first.

    When to call it

    A preview, not an import. It tells you which schemas would become entities, which get inlined as value types, and how they connect.

    defaultSelected: false marks standalone schemas - nothing references them and they reference nothing - so a checklist UI or an agent prompt can offer them as opt-ins rather than importing noise.

    The spec must be JSON (5 MB max). Convert YAML first.

    Example request

    {
      "_comment": "Two schemas and one reference.",
      "name": "analyse_openapi",
      "arguments": {
        "spec_json": {
          "openapi": "3.0.0",
          "info": {
            "title": "shop",
            "version": "1"
          },
          "paths": {},
          "components": {
            "schemas": {
              "Customer": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              "Order": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "customer": {
                    "$ref": "#/components/schemas/Customer"
                  },
                  "total": {
                    "type": "number"
                  }
                }
              }
            }
          }
        }
      }
    }

    A string argument that holds JSON is shown unescaped here; send it as a string.

    Example response

    {
      "contract_version": 3,
      "entities": [
        {
          "name": "Customer",
          "fieldCount": 2,
          "referencesOut": [],
          "referencedBy": [
            "Order"
          ],
          "standalone": false,
          "defaultSelected": true
        },
        {
          "name": "Order",
          "fieldCount": 3,
          "referencesOut": [
            "Customer"
          ],
          "referencedBy": [],
          "standalone": false,
          "defaultSelected": true
        }
      ],
      "inlinedTypes": [],
      "relationships": [
        {
          "from": "Order",
          "fromField": "customer",
          "to": "Customer",
          "cardinality": "one"
        }
      ],
      "warnings": []
    }

    Same step