import_ledger
Convert older-schema or hand-built ledgers into a new JSON Lines ledger, upgrading schema versions and preserving IDs, dates, and quote hashes; invalid records are still written for repair.
Instructions
Import a ledger of any older schema version, or a pre-schema hand-built list, as a new JSON
Lines ledger at path, which must not exist. The source is YAML, JSON ({"ledger": header, "records": [...]} or a plain list of records) or JSON Lines (header on the first line, one
record per line). A plain list needs work (title and type); a source with a header must
not be given work. The header's schema_version is upgraded step by step to this server's
(a newer or unknown version is refused); records keep their ids, claim ids, provenance dates
and quote hashes (an older sha256-n1 hash stays valid), and the server assigns missing ids
and claim ids and the hash of a quote lacking one. Records that fail validation are still
written so that they can be fixed; the result holds path, records, from_version (null
for a pre-schema list), steps (such as "0.2.0→0.3.0") and problems (all found at once,
as validate_ledger reports them, empty if valid).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"source": "<source>",
"path": "<path>"
},
"name": "import_ledger"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| work | No | ||
| source | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |