Build fact grid
build-fact-gridConstruct multidimensional fact grid from graph data. Retrieves facts based on elements, periods, and optional dimensions. Returns structured data with element names, values, and periods. Use include_summary=true to add per-element statistics: count, min, max for every element, plus total and average for duration elements only — a balance summed or averaged across periods is not a balance, so instants (e.g. total_assets) omit both.
WHEN TO USE:
When the user asks to compare specific financial metrics across periods or companies
To build custom cross-company comparisons (e.g., "compare NVDA and AAPL total assets")
When you need precise control over which elements, periods, and entities to include
For ad-hoc financial analysis that doesn't fit a standard statement format
HOW IT DIFFERS FROM financial-statement-analysis / live-financial-statement:
financial-statement-analysis returns ALL line items for a standard statement from the graph-backed XBRL hypercube (SEC or materialized tenant)
live-financial-statement returns ALL line items for a standard statement from the tenant's live OLTP ledger
build-fact-grid returns SPECIFIC elements you choose, across any combination of periods and entities
PARAMETERS:
elements: XBRL qnames (e.g., 'us-gaap:Assets'). Use resolve-element to find qnames.
canonical_concepts: Cross-filer concept ids (e.g., 'revenue'), set on standard us-gaap and ifrs-full elements only. A filer that reports the line under its own extension is missing, and a filer can report two of a concept's elements (a total and a line), so return the qname with each value.
periods: End dates in YYYY-MM-DD format
entity/entities: Filter by ticker, CIK, or name. Use 'entities' array for multi-company.
period_type: 'annual', 'quarterly', or 'instant'. Important for duration elements (revenue, net income).
form: SEC filing type ('10-K', '10-Q')
fiscal_year/fiscal_period: Filter by report fiscal context
RETURNS:
Deduplicated facts with element qnames, names, values, periods, units, and entity ticker/name — one record per fact, not a pivot table
Only consolidated totals (dimensional breakdowns excluded)
truncated: truewhen more facts matched thanlimitallowed; the ones returned are the most recent by periodA figure a filer reports in two units (its own currency and a US-dollar translation) comes back once per unit, and
units_notesays so — never put two units in one seriesOn a tenant graph, a value a period's close stamped carries
presentation: 'as_closed'andstamped_at: the month as it closed, which a live read of the books (live-financial-statement) can differ from once a mapping was reclassified after the close
NOTES:
On shared repositories (e.g. SEC) entity or entities is REQUIRED — those graphs host thousands of filers, so an unscoped query returns an arbitrary slice of arbitrary companies. On a tenant graph the filter is optional: without it a ledger returns its own entities' facts, the group parent and its subsidiaries, each row naming its entity. A company whose report the graph received (an issuer, or the sender of a shared report) is returned only when named in entity or entities.
On a tenant graph select by elements with periods or period_type: canonical_concepts, form, fiscal_year and fiscal_period exist only on shared repositories and are refused there rather than answered with nothing.
For income statement items (revenue, net income), always specify period_type='annual' or 'quarterly' to avoid mixing duration types. Companies may tag the same concept differently: for a cross-company comparison, run resolve-element per company (with its ticker), check the labels, and pass each company's qnames as elements.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "build-fact-grid"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| form | No | Filter by SEC filing form type (e.g., '10-K', '10-Q') | |
| rows | No | Optional aspect scoping, e.g. [{'type': 'period', 'selected_members': ['2024-12-31']}] | |
| limit | No | Maximum facts to return (default 250, max 5000). Applied after dedup and sort, so truncation keeps the most recent periods. | |
| entity | No | Filter by entity ticker (e.g., 'NVDA'), CIK, or name. Matches against Entity ticker, cik, and name properties; on a tenant graph an entity id matches too. | |
| columns | No | Optional aspect scoping; same shape as 'rows'. Rows/columns are naming conventions only — both filter. | |
| periods | No | Period end dates (YYYY-MM-DD format) or quarters (YYYY-QN) | |
| elements | No | Element qnames to include in the grid (e.g., 'us-gaap:Assets', 'us-gaap:Revenues'). Can be combined with canonical_concepts. | |
| entities | No | Filter by multiple entity tickers (e.g., ['NVDA', 'AAPL']). Use instead of 'entity' for multi-company comparisons. | |
| fiscal_year | No | Filter by fiscal year (e.g., 2024). Uses Report.fiscal_year_focus. | |
| period_type | No | Filter by period type: 'annual' (duration facts only), 'quarterly' (duration facts only), 'instant' (point-in-time facts). Default depends on statement type. | |
| fiscal_period | No | Filter by fiscal period (e.g., 'FY', 'Q1', 'Q2', 'Q3'). Uses Report.fiscal_period_focus. | |
| include_summary | No | Include per-element statistics: count, min, max for every element; total and average for duration elements only (instants omit them — a balance summed across periods is not a balance). An element reported in more than one unit has no summary. | |
| canonical_concepts | No | Canonical concept names (e.g., 'revenue', 'net_income', 'total_assets'). Set on standard us-gaap and ifrs-full elements only, so a filer that reports the line under its own extension is missing. Can be combined with elements. |