{"tools":[{"name":"qc.get_chart","description":"Get full chart series (income / cashflow / balance / key-metrics) for a US-listed ticker, or an Ecuadorian issuer with country=EC. Returns periods + per-metric MetricSeries arrays sourced from SEC EDGAR XBRL (US) or the SuperCias / SB / SEPS filings (EC).","inputSchema":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","description":"Upper-case ticker symbol (e.g. NVDA, AAPL, BRK.B), or an Ecuadorian registry id (e.g. EC0190115798) with country=EC.","minLength":1,"maxLength":16},"country":{"type":"string","enum":["US","EC"],"default":"US","description":"US (default) = SEC EDGAR. EC = Ecuador; pass the registry id as `ticker` (SuperCias companies, SB banks, SEPS cooperatives and mutualistas)."},"statement":{"type":"string","enum":["income","cashflow","balance","key-metrics"],"default":"income"},"period":{"type":"string","enum":["quarterly","annual"],"default":"quarterly"},"range":{"type":"string","enum":["1y","3y","5y","10y","max"],"default":"max","description":"Window hint (currently passes through; future-compat slot)."},"provenance":{"type":"boolean","default":false,"description":"When true, every MetricSeries carries a parallel `provenance` array (filing_url, xbrl_tag, accession_number, period_end, filed_at, form) so the agent can cite the SEC filing for every value it grounds an answer in."}}}},{"name":"qc.get_metric","description":"Get a single named metric series (e.g. ROIC, P/E, dividend yield) for a ticker. Lighter payload than get_chart when the agent only needs one number-line. XBRL-served results carry a 'basis' field naming the split convention applied: 'split-adjusted' for per-share/EPS + price metrics, 'as-filed' for share counts, 'split-invariant' for totals/ratios a split doesn't move.","inputSchema":{"type":"object","required":["ticker","metric_key"],"properties":{"ticker":{"type":"string","minLength":1,"maxLength":10},"metric_key":{"type":"string","description":"Stable kebab-case key, e.g. 'revenue', 'roic', 'pe-ratio', 'free-cash-flow', 'dividend-yield'."},"period_mode":{"type":"string","enum":["quarterly","annual"],"default":"annual"}}}},{"name":"qc.get_explanation","description":"Return the chart_explanations payload for a metric_key at the highest tier the caller's plan permits. Tier blob keys: free / pro / premium / quant. Customer-visible only: 404 if the row is pending qc/legalqc review.","inputSchema":{"type":"object","required":["metric_key"],"properties":{"metric_key":{"type":"string"},"tier":{"type":"string","enum":["free","pro","premium","quant"],"default":"free","description":"Desired content tier. Server clamps to caller's entitled max."}}}},{"name":"qc.compare_tickers","description":"Side-by-side comparison of a single metric across up to 10 tickers. Per-ticker tier-gate enforced — inaccessible tickers are listed but not fetched.","inputSchema":{"type":"object","required":["tickers","metric_key"],"properties":{"tickers":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":10},"metric_key":{"type":"string"},"period_mode":{"type":"string","enum":["quarterly","annual"],"default":"annual"}}}},{"name":"qc.search_tickers","description":"Substring search over the SEC EDGAR ticker directory (symbol + company name). v1 covers US-listed filers; non-US country scopes return [] for now.","inputSchema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1},"country":{"type":"string","description":"ISO 3166-1 alpha-2 (default US).","minLength":2,"maxLength":2},"limit":{"type":"integer","minimum":1,"maximum":100,"default":20}}}},{"name":"qc.list_metrics","description":"All metric_keys that have legal-reviewed tier_content. The subset agents can safely call get_explanation on.","inputSchema":{"type":"object","properties":{}}},{"name":"qc.list_tickers","description":"The caller's accessible ticker universe. Anon / Free → per-country free-tier allow-list. Pro+ → full SEC EDGAR directory.","inputSchema":{"type":"object","properties":{"country":{"type":"string","minLength":2,"maxLength":2,"description":"ISO 3166-1 alpha-2 (default US)."},"limit":{"type":"integer","minimum":1,"maximum":10000,"default":500},"tier":{"type":"string","description":"Forward-compat: per-tier subset slicing."}}}},{"name":"qc.get_segments","description":"Per-segment revenue + segment profit + margin from SEC EDGAR XBRL dimensional facts. Wraps the same data backing the SegmentScorecard on /charts/<ticker> and the GeographicSection. Sample query: \"What share of AAPL's FY24 revenue came from Services?\"","inputSchema":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","minLength":1,"maxLength":10,"description":"US-listed ticker (e.g. AAPL, JPM, BRK.B)."},"axis":{"type":"string","enum":["product","geography","both"],"default":"product","description":"Which dimensional axis to fetch. 'product' = operating segments (us-gaap:StatementBusinessSegmentsAxis); 'geography' = country / region (srt:StatementGeographicalAxis); 'both' = single response containing both."},"period":{"type":"string","enum":["quarterly","annual"],"default":"annual"}}}},{"name":"qc.get_pension_disclosures","description":"Per-plan-type pension + OPEB disclosures from SEC EDGAR dimensional XBRL (us-gaap:RetirementPlanTypeAxis). Returns funded status, discount rate, expected return, service + interest costs. Sample query: \"What's GE's pension discount rate?\" Best coverage on DB-plan filers (60% of S&P 500); DC-only modern tech returns empty.","inputSchema":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","minLength":1,"maxLength":10,"description":"US-listed ticker (e.g. GE, F, CAT, BA)."},"plan_type":{"type":"string","enum":["all","defined_benefit","opeb","postretirement"],"default":"all","description":"Filter by plan type. 'all' returns every plan the issuer discloses; 'defined_benefit' / 'opeb' / 'postretirement' narrow to a single category."}}}},{"name":"qc.get_debt_schedule","description":"Long-term debt schedule from SEC EDGAR XBRL — per-instrument detail (DebtInstrumentAxis, 87% S&P 500 coverage) plus per-category aggregation (LongtermDebtTypeAxis, 93% coverage). Sample query: \"What's AAPL's debt maturity wall?\" Returns face amounts, carrying amounts, stated rates, and weighted-average effective rates.","inputSchema":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","minLength":1,"maxLength":10,"description":"US-listed ticker (e.g. AAPL, JPM, XOM)."},"period":{"type":"string","enum":["quarterly","annual"],"default":"annual","description":"Forward-compat — SEC ships debt as instant facts so this currently passes through."}}}},{"name":"qc.get_share_count_history","description":"Split-adjusted diluted-shares-outstanding history per fiscal year. Closes Task #37 (AAPL 10Y +140.6% phantom dilution bug) — applies data-driven split-restatement detection from Yahoo split history so deep pre-split periods (e.g. AAPL pre-2020 4-for-1 split) are normalised to the post-split basis. Sample query: \"How much has AAPL bought back over the last 10 years?\"","inputSchema":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","minLength":1,"maxLength":10},"adjust_for_splits":{"type":"boolean","default":true,"description":"When true (default), values are split-adjusted via the data-driven detector. When false, returns SEC raw values plus the splits array so the caller can normalise themselves."},"start_year":{"type":"integer","description":"Inclusive fiscal-year lower bound."},"end_year":{"type":"integer","description":"Inclusive fiscal-year upper bound."}}}},{"name":"qc.get_etr_reconciliation","description":"Effective-tax-rate reconciliation per fiscal year — the statutory→effective bridge from SEC EDGAR tax-note XBRL (EffectiveIncomeTaxRateReconciliation* concepts, ~80% S&P 500 coverage). Returns per-line percentage series (federal statutory rate, state/local, foreign rate differential, R&D credits, FDII, valuation-allowance swings, …) plus USD context (IncomeTaxExpenseBenefit accrual vs IncomeTaxesPaidNet cash). Sample query: \"Why is NVDA's effective tax rate below 21%?\" Honest abstain: issuers disclosing no ETR concepts return available=false + empty lines (no fabricated bridge).","inputSchema":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","minLength":1,"maxLength":10,"description":"US-listed ticker (e.g. NVDA, AAPL, JPM, XOM)."}}}},{"name":"qc.resolve_entity","description":"RESOLVE a company identifier to the canonical SEC registrant BEFORE fetching data — the recommended first call. Accepts a ticker (any variant: AAPL / BRK.B / BRK-B / AAPL.US / dual-class GOOG vs GOOGL), a company name (exact, fuzzy, AND former names — 'Facebook' resolves to META, 'Google' to GOOGL), a CIK, or a CUSIP/ISIN. DISAMBIGUATES rather than guessing: when multiple registrants match it returns outcome='ambiguous' with candidates + distinguishing fields (former names, exchange, SIC). Returns a fact-store availability summary for a single confident match. Branch on the 'outcome' field (resolved / ambiguous / not_found).","inputSchema":{"type":"object","required":["query"],"properties":{"query":{"type":"string","minLength":1,"description":"Identifier to resolve: ticker, company name, former name, CIK, or CUSIP/ISIN."},"include_availability":{"type":"boolean","default":true,"description":"When true (default), a single confident match also returns which statements + how many fiscal periods are held. Set false to skip the data round-trip."}}}},{"name":"qc.resolve_period","description":"RESOLVE a period spec to exactly ONE fully-qualified dated fiscal period — removes the #1 source of agent errors (fiscal-vs-calendar confusion, 63% of failures). Accepts many input forms so you can't mis-specify: 'latest', a fiscal label ('FY2026 Q4' / 'Q4-2026'), a fiscal year ('2026' with basis=annual), a calendar date ('2026-01-26'), or a calendar range ('2024-01-01:2024-03-31'). Returns the single dated period with BOTH fiscal_label (FY2026 Q4) and calendar_label (quarter ended 2026-01-26) plus period_start/period_end so you can verify. FAILS LOUD on an ambiguous / out-of-range period — the error lists the available fiscal labels, never a silent wrong year. QuarterCharts follows the SEC fiscal-year convention: a fiscal year is named by the CALENDAR YEAR OF ITS FISCAL-YEAR-END date. Example: a company whose fiscal year ends in January 2026 calls that FY2026, and its quarter ending 2025-10-31 is FY2026 Q3 (NOT FY2025). For non-December year-ends the fiscal label and the calendar quarter DIFFER — e.g. Apple's quarter ending 2022-12-31 is FY2023 Q1, because Apple's fiscal year ends in late September. Always read period_start / period_end (ground-truth dates) to confirm you got the intended period; the fiscal_label and calendar_label are both returned so you can cross-check.","inputSchema":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","minLength":1,"maxLength":10,"description":"US-listed ticker (e.g. AAPL, NVDA, BRK.B)."},"period":{"type":"string","default":"latest","description":"Period spec — 'latest', a fiscal label ('FY2026 Q4'), a fiscal year ('2026'), a calendar date ('2026-01-26'), or a range ('2024-01-01:2024-03-31')."},"basis":{"type":"string","enum":["quarterly","annual"],"default":"quarterly","description":"Resolve against quarterly period-ends or annual fiscal-year-ends. Use 'annual' when resolving a bare fiscal year."}}}},{"name":"qc.compute","description":"COMPUTE a multi-fact financial expression over served SEC data and get back a single value WITH the provenance of every fact it consumed — or a TYPED failure naming exactly why no honest answer exists (unresolvable fact, divide-by-zero, domain error). Every leaf is a real served fact (ticker + concept + period); the engine never fabricates or alters a value. Use this instead of fetching several metrics and doing the arithmetic yourself: ratios (net-income / revenue), YoY growth, CAGR, sums/differences across facts. The response is a ComputeEnvelope: {data, units, period, provenance[], verification.tier, recommended_next_call, error?}. verification.tier is 'provenanced' when every consumed fact carries a source-filing-backed reported provenance entry. Pro+ tool. Submit the expression as a small JSON AST — see inputSchema.","inputSchema":{"type":"object","description":"Provide EITHER an 'expression' tree, OR a top-level {op, operands:[...]} single-op form. A node is a LEAF ({fact:{ticker,concept,period,period_mode?,dimensions?}} or {const:<number>,label?}) or an OPERATOR ({op:'add|sub|mul|div|ratio|yoy', left:<node>, right:<node>} or the same with operands:[<node>,<node>]; {op:'cagr', begin:<node>, end:<node>, years:<number>}). Example — Apple FY2023 net margin: {\"expression\":{\"op\":\"ratio\",\"operands\":[{\"fact\":{\"ticker\":\"AAPL\",\"concept\":\"net-income\",\"period\":\"2023-09-30\"}},{\"fact\":{\"ticker\":\"AAPL\",\"concept\":\"revenue\",\"period\":\"2023-09-30\"}}]}}.","properties":{"expression":{"type":"object","description":"The computation AST. A leaf ('fact'/'const') or an operator node ('op' + children). Recursive — operator children may themselves be operators or leaves."},"op":{"type":"string","enum":["add","sub","mul","div","ratio","yoy","cagr"],"description":"Top-level operator for the flat {op, operands} form (alternative to nesting under 'expression')."},"operands":{"type":"array","items":{"type":"object"},"description":"Exactly two child nodes for a top-level binary 'op'."}}}},{"name":"qc.get_ec_account_tree","description":"W3-GCAR: the FULL granular NIIF account tree an Ecuadorian company filed with SuperCías — every populated cuenta as a walkable hierarchy (code prefix-tree, catalogo labels verbatim, parent/depth/family pre-computed) with the company's filed value per year (latest-filed wins; no aggregation). Sample query: \"Show me TUTI's full 2024 balance-sheet account detail.\"","inputSchema":{"type":"object","required":["ticker"],"properties":{"ticker":{"type":"string","minLength":1,"maxLength":16,"description":"EC registry symbol (e.g. FAV), the synthetic EC<RUC> form (e.g. EC0190005070001), or a bare 13-digit RUC."}}}}]}