WorkLensDocs
    Studio
    tool

    register_pack

    Hand a pack you drafted back to the engine so generation can use it — a locale pack (datasets for a region) or a rule fragment (one type_def or one…

    Last updated 2026-09-13 · Generated from mcp-schemas/tools/06-register_pack · Markdown

    Summary

    Hand a pack you drafted back to the engine so generation can use it — a locale pack (datasets for a region) or a rule fragment (one type_def or one skeleton_def, then referenced from recipes as "sha256:<hash>"); the engine reads the kind from the shape. This CLOSES the loop validate_recipe opens: when it reports missing_packs, draft the pack using the pack_authoring shape from get_recipe_schema, call this, then generate_from_graph — the user should never create, edit or upload a pack file. Returns the SHA-256 and the pin (name@sha256) to write into manifest.pack in the recipe, so every run uses exactly this pack. A pack declares data and never carries code: one that does is refused. DO NOT invent data you do not know: an unsure checksum rule or byte layout should be asked for, not guessed. Declare honestly in pack_provenance — it is carried onto every receipt.

    Agentcalls
    register_packPacks
    Resultas data

    Inputs and outputs

    Goes in
    • pack_json (string, required) — The drafted pack as a JSON string.
    • persist (boolean) — Keep it on this machine's pack shelf so later runs and other sessions reuse it (default true).

    When to call it

    Closes the loop validate_recipe opens. When it reports missing_packs, draft the pack yourself using the pack_authoring shape from get_recipe_schema, call this, then generate. The user should never create, edit or upload a pack file, and never be asked to "add a country".

    Do not invent data you do not know. A checksum rule or a byte layout you are unsure of should be asked for, not guessed.

    Declare honestly in pack_provenance how you produced it - it is carried onto every receipt, so a reader knows which parts of the data rest on a published register and which rest on a model's general knowledge.

    Example request

    {
      "_comment": "A drafted locale pack, persist:false so nothing is written.",
      "name": "register_pack",
      "arguments": {
        "pack_json": {
          "schema_version": 2,
          "pack_manifest": {
            "name": "demo-locale",
            "version": "1.0.0",
            "provides": [
              "locale:zz.names"
            ],
            "owner": "worklens-reference"
          },
          "pack_provenance": {
            "method": "drafted",
            "drafted_by": "worklens-reference",
            "drafted_at": "2026-01-01",
            "reviewed_by": null,
            "basis": "Illustrative pack written to document the register_pack contract. Not real data.",
            "caveats": [
              "Three names. Never use this for anything but reading the schema."
            ]
          },
          "scope": {
            "region": "ZZ"
          },
          "datasets": {
            "given_names": {
              "columns": [
                {
                  "name": "given",
                  "role": "person.givenName"
                }
              ],
              "rows": [
                [
                  "Ada"
                ],
                [
                  "Alan"
                ],
                [
                  "Grace"
                ]
              ]
            }
          }
        },
        "persist": false
      }
    }

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

    Example response

    {
      "ok": true,
      "contract_version": 3,
      "kind": "locale",
      "name": "demo-locale",
      "version": "1.0.0",
      "pin": "demo-locale@3dbee5e615f54d6911e66c6566b5cc9274a794e794380a6ceb67fbaec3a89058",
      "region": "ZZ",
      "review": [
        "given_names: only 3 distinct value(s); a table of any size will repeat them often"
      ],
      "provides": [
        "locale:zz.names"
      ],
      "sha256": "3dbee5e615f54d6911e66c6566b5cc9274a794e794380a6ceb67fbaec3a89058",
      "persisted_to": null,
      "provenance_declared": true,
      "next_step": "Show the person `review` first: values in this pack look wrong in the ways it names. Fix them and register again, or go on if they are deliberate. Pack registered. PIN it: set manifest.pack to 'demo-locale@3dbee5e615f54d6911e66c6566b5cc9274a794e794380a6ceb67fbaec3a89058' in the recipe, so every run uses exactly this pack and is refused without it. Then call generate_from_graph. Show the user what you drafted and where it came from — the receipt will carry your pack_provenance onto every run."
    }

    Same step