Metric Lineage
get_metric_lineageThe DERIVATION of one COMPUTED metric — its human formula + immediate inputs (each value + source), one level at a time. The audit / verify affordance for derived figures (margins, ratios, ROIC, FCF, adj-EBITDA): call it ONLY when the query asks how a metric is computed, which definition MetricDuck used, or to verify / audit the derivation — NOT to get the value itself (use get_metric_history / get_company_overview for that).
Drillable (lazy, one level per call):
a
derivedinput points to its OWN derivation — call get_metric_lineage(ticker, that_symbol) to go deeper.a
baseinput is an as-filed XBRL fact — open its filing handle, or get_xbrl_facts(ticker, search="") to land on the exact fact.
Use Cases:
"How is AAPL's net_margin calculated?" -> get_metric_lineage("AAPL", "net_margin")
"Which ROIC definition does this use?" -> get_metric_lineage("AAPL", "roic")
"Audit / verify gross_margin for Q2 FY2025" -> get_metric_lineage("AAPL", "gross_margin", fiscal_year=2025, fiscal_period="Q2")
Computed metrics only — a base as-filed figure has no derivation (the tool says so and points to get_xbrl_facts).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metric | Yes | Metric id of a COMPUTED metric (e.g. 'net_margin', 'roic', 'fcf', 'ev_ebitda'). | |
| ticker | Yes | Company ticker symbol (e.g., 'AAPL'). Must be exact. | |
| segment | No | Reporting segment id. Omit for the consolidated figure. | |
| fiscal_year | No | Pin the fiscal year (e.g. 2025). Omit for the latest period. | |
| period_type | No | Q = quarterly, FY = fiscal year, TTM = trailing 12 months. | Q |
| fiscal_period | No | Pin the fiscal period. Omit for the latest. |