WorkLensDocs
    Studio
    tool

    get_recipe_schema

    The recipe (GraphModel) authoring guide: JSON shape, every engine field type, FK conventions, rules and a working example. Call this FIRST, WITH A plan of…

    Last updated 2026-09-13 · Generated from mcp-schemas/tools/01-get_recipe_schema · Markdown

    Summary

    The recipe (GraphModel) authoring guide: JSON shape, every engine field type, FK conventions, rules and a working example. Call this FIRST, WITH A plan of what you are about to build (output csv or fixed, the constructs you expect, region, whether you are reading a repository): the reply then carries exactly what that build needs before your first draft, and says where the recipe JSON Schema is (sections ["json_schema"]). Then validate_recipe, then generate_from_graph. Without a plan you get the drafting core, with heavier chapters as stubs naming the call that fetches them.

    Agentcalls
    get_recipe_schemaDraft a recipe
    Resultas data

    Inputs and outputs

    Goes in
    • plan (object) — What you are about to build. The reply is the drafting core plus exactly the sections and syntax this plan needs, and the JSON Schema; a section or schema that would take the reply past its size limit comes back as a pointer, listed in held_back_for_size, with the call that fetches it. plan_applied…
    • sections (array) — Deferred sections to fetch in full. Omit for the drafting core with stubs; named sections return just those (a top-up, nothing re-sent); 'all' returns the whole guide except the JSON Schema and the repository starter, which are fetched by name; it is larger than one reply may carry, so its largest…

    When to call it

    Call this first whenever you intend to draft a recipe yourself from any source - OpenAPI, SQL, dbt, Pentaho/Hop jobs, or plain-English requirements. You are the translator into this one format; this is the format.

    The default response is the drafting core (~37 KB): shape, field types, rules, capabilities, and a minimal example. Three heavier sections arrive as stubs that say when each is required and how to fetch it - sections: ['task_discovery'] (the repo-reading procedure plus cannot_derive[], REQUIRED before drafting from an existing codebase), ['scenario_playbook'], ['pack_authoring'], or ['all'] for the full ~96 KB guide in one call. Reading cannot_derive before drafting saves you inventing syntax for something that does not exist.

    Example request

    {
      "_comment": "The first call an agent makes. The drafting core (~37 KB); task_discovery, scenario_playbook and pack_authoring arrive as stubs naming when each is required and how to fetch it.",
      "name": "get_recipe_schema",
      "arguments": {}
    }

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

    Example response

    {
      "contract_version": 3,
      "what_this_is": "Called without a plan? Call again with one (output, constructs, region, from_repository) to get exactly what your build needs and the JSON Schema. The WorkLens recipe (GraphModel) format. Translate ANY source — OpenAPI, SQL DDL, Pentaho/Hop jobs, dbt models, prose requirements — into this one JSON shape, validate it with the validate_recipe tool, then run it with generate_from_graph. The engine is deterministic: same recipe + same seed = byte-identical output.",
      "workflow": [
        "0. FIRST-TIME CHECK: if you have file access to the user’s repository, look for a WORKLENS.md (repo root or worklens/). Missing = this repo has never been set up for WorkLens → offer to create it from `repo_context_file_starter` (fetch it with sections: [\"repo_context_file_starter\"]), filling the conventions from what you see in the codebase. File present = read it and follow its conventions. AUTONOMOUS MODE (CI, cron, headless — no human to ask): never create WORKLENS.md silently and never draft fresh recipes; regenerate deterministically from the committed recipe + worklens.lock instead. If drafting is genuinely required (e.g. schema drift detected), write the proposal to a branch and open a PR — the offer becomes a review, the human gate stays.",
        "1. Read the source. If you have the repository, run the `task_discovery.procedure` sweep below rather than skimming: structure → links → rules → behaviour → journeys → totals → output → failure appetite. Match what you see against `task_discovery.evidence` (a FK constraint, a checksum routine, a status column, byte-position slicing each map to specific keys) and compose every match into ONE recipe. Cite the evidence for each decision so a reviewer can veto it; anything inferred rather than read goes in manifest.assumptions[].",
        "2. Draft a recipe JSON in the shape below — you are the translator.",
        "3. Call validate_recipe with your draft; fix every error it reports and surface missing_packs to the user.",
        "4. Call generate_from_graph(graph_json, n_rows, seed) to produce data.",
        "5. Call prove_recipe: `passed` false lists the rules that did not hold. With a real sample, score_realism compares its shape."
      ],
      "shape": {
        "$schema": "https://theworklens.com/schema/recipe/v1.json",
        "version": 1,
        "project": "string (required) — kebab-case project name",
        

    Truncated for the page; the full response sits beside the tool’s schema in the repository.

    Same step