Generate DCF Workbook (xlsx)
generate_dcf_xlsxRender a forward DCF result into a professional Excel workbook (Summary + 5×5 Sensitivity heatmap + Inputs sheet). Native conditional formatting — no chart images needed. Returns a 15-minute presigned R2 download URL.
SERVER-TRUST: the DCF is re-derived in-Worker from the supplied inputs_echo (the math is pure + deterministic) and the workbook renders Valuein's recomputed figures — never the caller's claimed values. If the claimed figures disagree, the workbook is still produced but stamped with a visible correction banner and the response verification.status is 'corrected'. A fabricated per-share value can never appear as Valuein-authoritative.
Pair with compute_dcf for a typical analyst flow: agent calls compute_dcf({ticker, ...}), then passes the structured result straight to generate_dcf_xlsx({ticker, dcf_result, ...}) to materialise a shareable file.
Tier: pro+.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ticker | Yes | Stock ticker symbol of the company the DCF workbook is built for, e.g. AAPL. | |
| dcf_result | Yes | Structured DCF result — typically the `result` field returned by `compute_dcf`. | |
| company_name | No | Optional — surfaces on the cover row. Falls back to ticker only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| _meta | Yes | Provenance envelope — data lineage for every MCP response | |
| r2_key | Yes | ||
| filename | Yes | ||
| expires_at | Yes | ||
| size_bytes | Yes | ||
| content_type | Yes | ||
| verification | Yes | Server-trust record. status='verified' when the caller's figures matched the server re-derivation; 'corrected' when they did not (the workbook shows the SERVER figures + a banner). `mismatches` lists every field that disagreed. | |
| expires_in_seconds | Yes |