passwerk
v0.1.1Offline EU Battery Passport compiler: ingest documents, map, validate (IDTA 02035), emit AASX.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
ingest_documents Ingest supplier documents
Reads PDF, XLSX, CSV, DOCX and TXT documents into a DocumentBundle with page, line, table and cell provenance, deterministically and without OCR or a model. Returns a per-document summary and a bundleId to pass to extract_facts; ask for detail "full" to see the pages. Unsupported or unreadable files are reported, not dropped.
| Parameter | Type | Description |
|---|---|---|
detail | string | summary (default): per-document counts and the bundleId; full: the whole DocumentBundle |
inline | array | Document bytes as base64, for hosts that cannot pass paths |
lang | string | Language of the text summary (default en) |
limits | object | Partial IngestLimits override (maxInputBytes, maxCells, ...) |
paths | array | Files or directories on the server’s file system (a directory contributes its PDF, XLSX, CSV, DOCX and TXT files, non-recursive). Preferred for local installs |
extract_facts Extract facts
Turns a DocumentBundle into a FactSet: labelled values with normalised numbers, units and dates, each with file, page, line or cell provenance. Pure heuristics, no model. Returns the FactSet and a factSetId to pass to suggest_mappings.
| Parameter | Type | Description |
|---|---|---|
bundle * | A DocumentBundle object, or { bundleId } as returned by ingest_documents | |
lang | string | Language of the text summary (default en) |
suggest_mappings Suggest attribute mappings
Scores every fact against the knowledge-base synonym index (DE/EN), unit and type checks and the attribute range, and returns candidate mappings sorted by confidence with a DE/EN explanation and provenance. Review proposals under 0.7 with the user or the source page, then pass the accepted ones to apply_mappings. Ask for detail "full", or pass attributeIds, to see every candidate with its file, page and cell in the text.
| Parameter | Type | Description |
|---|---|---|
category * | string | Passport category; decides applicability |
facts * | A FactSet object, or { factSetId } as returned by extract_facts | |
attributeIds | array | Keep only proposals for these attribute ids; unknown ids are reported, not an error. When given, the text lists every match, not just the first 10, with provenance, even in summary mode |
detail | string | summary (default): header line plus the first 10 proposals, no provenance. full: every proposal after the filters, one line each, with provenance (file, page, cell); no cap |
lang | string | Language of the text summary (default en) |
minConfidence | number | Drop proposals below this confidence (default 0). 0.7 is the review threshold |
apply_mappings Apply mapping decisions
Folds accepted mapping decisions (or manual values) into a PassportDraft. Idempotent: the same decision twice is a no-op; a different value for an attribute that already has one is reported as a conflict and not applied unless override is true. Pass meta instead of draft to start a new draft.
| Parameter | Type | Description |
|---|---|---|
mappings * | array | Accepted proposals from suggest_mappings, or manual values |
draft | The draft to extend. Omit and pass meta to start a new one | |
lang | string | Language of the text summary (default en) |
meta | object | Starts a new draft. Exactly one of draft or meta |
validate_passport Validate a passport draft
Runs all four validation layers on a PassportDraft: L1 schema, L2 AAS meta-model (aas-core), L3 IDTA 02035 template conformance, L4 domain plausibility. Returns the verdict (valid, valid_with_warnings, invalid) and every finding with layer, rule id, path, DE/EN message, legal reference and fix hint. The only source of a validity claim.
| Parameter | Type | Description |
|---|---|---|
draft * | A PassportDraft object, or { draftId } as returned by an earlier call | |
asOf | string | ISO date-time treated as "now" by the plausibility layer; default: draft.meta.createdAt |
lang | string | Language of the text summary (default en) |
skipPlausibility | boolean | Skip L4 (domain plausibility). Default false |
gap_report Gap report
The to-do list for a PassportDraft: every attribute bucketed as required, conditional, deferred or optional with status, legal references, who typically has the data and a suggested action; completeness for mandatory and overall data points, grouped by submodel and by data owner. Runs validate_passport first so invalid values count as gaps. Ask for detail "full" and a status/bucket filter to see every open attribute with its legal reference and next action, unabridged, for use without the structured content. Not legal advice.
| Parameter | Type | Description |
|---|---|---|
draft * | A PassportDraft object, or { draftId } as returned by an earlier call | |
asOf | string | ISO date-time treated as "now" for applicability; default: draft.meta.createdAt |
bucket | array | Keep only items in one of these buckets; completeness stays unfiltered |
detail | string | summary (default): open mandatory items, capped at 10. full: every item after the status/bucket filters, grouped by data owner, one line each with status, bucket, legal refs and the suggested next act… |
lang | string | Language of the text summary (default en) |
status | array | Keep only items with one of these statuses; completeness stays unfiltered |
review_passport Review a passport in the workbench
Opens the interactive passwerk workbench in hosts that render MCP Apps (Claude Desktop, Claude web): upload documents, accept or edit mapping proposals, read the gap report and export, all on the user’s machine. Pass the current draft so the user reviews it visually; the workbench keeps the draft id in sync so gap_report and emit_passport can continue on it. Hosts without a UI receive the same draft, validation report and gap report as text.
| Parameter | Type | Description |
|---|---|---|
draft | The draft to review; omit to open an empty workbench | |
facts | Extracted facts to review alongside the draft | |
lang | string | Language of the text summary (default en) |
emit_passport Emit the passport files
Emits a PassportDraft as AAS JSON (IDTA 02035 submodels), an AASX package, the draft JSON and/or the HTML sheet, and re-validates the emitted output. Fail-honest: files are returned even when the verdict is invalid, and the verdict is never better than validate_passport’s. Bytes come back base64 inline unless outDir is given.
| Parameter | Type | Description |
|---|---|---|
draft * | A PassportDraft object, or { draftId } as returned by an earlier call | |
targets * | array | aas-json: AAS v3 JSON environment (IDTA 02035); aasx: AASX package; draft-json: the neutral PassportDraft; html: self-contained HTML passport sheet (DE and EN inside) |
asOf | string | ISO date-time treated as "now" by the re-validation |
htmlLang | string | Language the html sheet opens in (both are in the file; default en) |
lang | string | Language of the text summary (default en) |
outDir | string | Directory to write into (needs a file system). Omit to receive base64 bytes inline |
generate_carrier Generate the data carrier (QR code)
Builds the data carrier for a passport: the unique identifier (the draft’s passportId, an absolute https URI), an optional GS1 Digital Link (/01/{gtin}/21/{serial} or /8004/{giai}) and the QR code as SVG or PNG. The QR encodes the Digital Link when GS1 data is given, else the identifier. Says nothing about validity; validate_passport does.
| Parameter | Type | Description |
|---|---|---|
draft | The draft whose meta.passportId is the identifier | |
format | string | Image format (default svg) |
gs1 | GS1 key: GTIN (8, 12, 13 or 14 digits) plus serial, or a GIAI | |
lang | string | Language of the text summary (default en) |
outDir | string | Directory to write the image into (needs a file system). Omit to receive base64 bytes inline |
resolverBase | string | https base of the GS1 Digital Link resolver; required with gs1 |
uid | string | The passport identifier (absolute https URI) when no draft is given |
check_obligations Check battery passport obligations
Whether a battery passport is required for a battery type, role, energy and market date under Regulation (EU) 2023/1542 Article 77(1); returns the category, the mandatory, conditional and deferred attribute sets and the legal timeline. Answers required, not_required or insufficient_input. Not legal advice.
| Parameter | Type | Description |
|---|---|---|
batteryType * | string | Battery type as placed on the market |
role * | string | Economic operator role of the asker |
asOf | string | ISO date treated as "now"; default: the server clock |
energyKwh | string | Battery energy in kWh as a decimal string, e.g. "2.5". Decides the industrial 2 kWh threshold |
lang | string | Language of the text summary (default en) |
placedOnMarketDate | string | ISO date the battery is or was placed on the market or put into service |
explain_attribute Explain an attribute or rule
Everything the knowledge base holds about one passport attribute (official DIN definition, DE/EN explanation, synonyms, who typically has the data, unit, range, applicability per category, legal references, IDTA template elements) or one plausibility rule (message, fix hint, legal reference). Nothing is composed; unknown ids are an error.
| Parameter | Type | Description |
|---|---|---|
id * | string | A knowledge-base attribute id (e.g. "batteryChemistry") or a rule id (e.g. "PW-PLAUS-001") |
lang | string | Language of the text summary (default en) |
list_capabilities List capabilities
Versions of the bundled IDTA 02035 templates and AAS schemas, knowledge-base statistics, when the artefacts were retrieved, the sovereignty statement, and this server’s tools and session-store usage. Call first to learn what this server can do.
| Parameter | Type | Description |
|---|---|---|
lang | string | Language of the text summary (default en) |