WorkLensDocs
    Studio
    tool

    derive_graph

    Infer a data-free recipe (entity types, relationships) from a real sample file. Pass the file as base64. Use before generating relationship-preserving…

    Last updated 2026-09-13 · Generated from mcp-schemas/tools/02-derive_graph · Markdown

    Summary

    Infer a data-free recipe (entity types, relationships) from a real sample file. Pass the file as base64. Use before generating relationship-preserving synthetic data.

    Agentcalls
    derive_graphDraft a recipe
    Resultas data

    Inputs and outputs

    Goes in
    • file_base64 (string, required) — see the input schema
    • format (string) — see the input schema

    When to call it

    Infers structure from a real file and returns a recipe carrying no values. That is the point: you can hand the result to someone who is not allowed to see the original data.

    Pass the file base64-encoded. Supported formats: csv, xlsx, json, xml.

    Example request

    {
      "_comment": "A two-row CSV, base64-encoded.",
      "name": "derive_graph",
      "arguments": {
        "file_base64": "Y3VzdG9tZXJfaWQsbmFtZSxlbWFpbCxhbW91bnQKMSxBZGEgTG92ZWxhY2UsYWRhQGV4YW1wbGUudGVzdCwxMjAuNTAKMixBbGFuIFR1cmluZyxhbGFuQGV4YW1wbGUudGVzdCw5OS4wMAo=",
        "format": "csv"
      }
    }

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

    Example response

    {
      "contract_version": 3,
      "$schema": "https://theworklens.com/schema/recipe/v1.json",
      "version": 1,
      "project": "derived",
      "entities": [
        {
          "name": "Record",
          "rows": 2,
          "fields": [
            {
              "name": "customer_id",
              "type": "id",
              "sensitivity": "linked",
              "generate": "fake",
              "unique": true
            },
            {
              "name": "name",
              "type": "person.fullName",
              "sensitivity": "pii",
              "generate": "fake"
            },
            {
              "name": "email",
              "type": "internet.email",
              "sensitivity": "pii",
              "generate": "fake"
            },
            {
              "name": "amount",
              "type": "float",
              "sensitivity": "safe",
              "generate": "keep"
            }
          ]
        }
      ],
      "relationships": [],
      "output": {
        "format": "csv"
      },
      "scenarios": [
        {
          "name": "happy"
        },
        {
          "name": "nulls",
          "null_rate": 0.15
        },
        {
          "name": "boundary",
          "mode": "boundary"
        }
      ]
    }

    Same step