# 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…

Section: MCP · Type: tool · Last updated: 2026-09-13

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.

## The picture

Agent (calls) → register_pack (Packs) → Result (as data)

## Inputs

- 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

```json
{
  "_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

```json
{
  "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

- [plan_packs](https://theworklens.com/docs/mcp/tools/plan-packs): Turn a recipe into a pack requirement plan — and read the shelf off it: which packs are needed, which of those a pack on this machine already resolves (name, version, who reviewed it, expiry, SHA-256), which fields each satisfies, how many distinct values each must supply, and the fields that need no pack because the…
- [Tool directory](https://theworklens.com/docs/mcp/tools): All 13 tools, grouped by step.

## Related

- [Tool directory](https://theworklens.com/docs/mcp/tools): All 13 tools the WorkLens MCP server exposes, grouped by the step they belong to, generated from the published contracts.
- [plan_packs](https://theworklens.com/docs/mcp/tools/plan-packs): Turn a recipe into a pack requirement plan — and read the shelf off it: which packs are needed, which of those a pack on this machine already resolves (name,…

_← Previous: [plan_packs](https://theworklens.com/docs/mcp/tools/plan-packs) · Next: [generate_from_graph](https://theworklens.com/docs/mcp/tools/generate-from-graph) →_

_README, input schema and the primary worked request and response for this tool, published with the server. Source: mcp-schemas/tools/06-register_pack._

_Canonical: https://theworklens.com/docs/mcp/tools/register-pack · This copy: https://theworklens.com/docs/mcp/tools/register-pack.md_
