Expand description
The curated workbook tool handlers (WBSV-01/02/03/04): calculate,
explain, get_manifest, diff_version.
All are native pmcp::ToolHandler impls registered via tool_arc and
pmcp::types::ToolInfo::with_ui (so the returned Value lands in
structuredContent). Each attaches the provenance stamp and advertises a
non-empty outputSchema (WBSV-07). Domain failures return the isError:true
envelope via to_iserror_result — NEVER a protocol-level error (T-92-10).
The per-Table WorkbookToolHandlers (WBV2-04) + explain re-run the
SERVE-time pmcp_workbook_runtime::run_executor over the pre-built
bundle.dag (no compiler, no second evaluator), seeding the CellEnv via the
embedded cell_map. Each per-Table handler projects ONLY its own Table’s
outputs via [project_tool_outputs] — one named MCP tool per output Table.
Structs§
- Diff
Version Handler - The
diff_versionhandler (WBSV-04): serve the RECORDED prev→currentpmcp_workbook_runtime::VersionChangelogthe offline promote step folded into the bundle (hash-verified at boot — NOT a runtime computation), stamped. - Explain
Handler - The
explainhandler (WBSV-02): a stateless re-run that renders the derivation trace as ordered business-language steps, plus a GENERIC manifest-declaredannotationsobject (S-2 — any domain-specific keystone is generalized into manifest-declared annotations; the engine reads onlymanifest.annotationsnames, nothing domain-specific). - GetManifest
Handler - The
get_manifesthandler (WBSV-03): a CURATED agent-facing projection — inputs (tier+default+unit), outputs (unit/meaning), governed-data summary, versions/hashes, changelog — NOT the raw internal manifest. - Render
Workbook Handler - The
render_workbookhandler (WBSV-05): validate the inputs, then return a provenance-boundworkbook://URI POINTER — NOT the.xlsxbytes. The bytes are recomputed perresources/readbysuper::render_resourcefrom the decoded URI (stateless regen-on-read, Lambda-safe, V3). - Workbook
Tool Handler - One served MCP tool per output Table (WBV2-04): validate → seed via cell_map → re-run the embedded IR → project ONLY this tool’s outputs (finite) → stamp.
Functions§
- sanitize_
tool_ name - Sanitize a raw output-Table name into an MCP tool name matching
^[a-zA-Z0-9_-]{1,64}$(T-100-10), wrapping the SINGLE shared runtime sanitizer (pmcp_workbook_runtime::sanitize_tool_name) so the served registration and the offline compiler’s collision lint cannot drift on the locked five-rule semantics (lowercase, illegal-run → single_, trim edges, truncate 64, reject empty/all-illegal). A reject becomes the fail-closedinvalid_tool_namedomain error.