| name | verify-dolt-db-financials |
| version | 0.1 |
| description | Fetch financial statements from SEC 10-K filings and Yahoo Finance for a BusMgmtBenchmarks retail company, compare all sources side by side, detect anomalies (especially SGA composite line items, restatements, and balance sheet mismatches), and produce reconciled values ready for the Dolt database. Use when validating or adding financial data for any company tracked in the BusMgmtBenchmarks project. Triggered by commands like "/verify-dolt-db-financials TICKER YEAR" or "/verify-dolt-db-financials TICKER" (all years) or requests to fetch, check, or validate financials for a company in the project. |
verify-dolt-db-financials
Fetch, compare, and reconcile financial data for a BusMgmtBenchmarks retail company across multiple sources, then produce DB-ready reconciled values.
Inputs
/verify-dolt-db-financials TICKER [YEAR]
TICKER — stock ticker (e.g. TRR, WMT, M)
YEAR — fiscal year (e.g. 2024). Optional. If omitted, analyze all available years for the company (see Step 0).
Step 0 — Determine years to analyze (only when YEAR is omitted)
If no YEAR was provided, discover all available years before proceeding:
0a. Query the Dolt DB for years already on record for this company:
SELECT DISTINCT year FROM financials WHERE company_name = '{company}' ORDER BY year
0b. Fetch Yahoo Finance data (one call covers ~4–5 years):
mcp__mcp-yfinance-10ks__process_financial_data_from_yahoo(company_name, ticker)
Inspect the column headers of the returned income statement to identify all available fiscal year periods.
0c. Take the union of years found in Dolt and years found in Yahoo. These are the years to analyze.
0d. Display a summary to the user:
Analyzing all available years for {display_name} ({TICKER}): {year1}, {year2}, …
Then run Steps 1–8 once for each year, in ascending order (oldest first). Each year is a fully independent analysis producing its own report file.
Step 1 — Look up company metadata
Query the Dolt database to get company metadata by ticker symbol:
SELECT company, CIK, display_name, ticker_symbol
FROM company_info
WHERE ticker_symbol = '{TICKER}'
Use db_string: calvinw/BusMgmtBenchmarks/main.
From the result, use:
company — the exact company_name as stored in the DB (needed for financials query)
CIK — needed for the SEC fetch
display_name — for display in the report header
If no row is returned, ask the user to confirm the ticker. If CIK is NULL, the company has no SEC filing (non-US company) — skip the SEC fetch and use Yahoo only.
Step 2 — Fetch all sources in parallel
Run these three fetches simultaneously:
| Source | Tool |
|---|
| SEC 10-K | mcp__mcp-sec-10ks__process_financial_data_from_sec(company_name, YEAR, cik) |
| Yahoo Finance | mcp__mcp-yfinance-10ks__process_financial_data_from_yahoo(company_name, ticker) |
| Dolt DB (existing row) | mcp__claude_ai_Dolt_Database_MCP__read_query → SELECT * FROM financials WHERE company_name = '...' AND year = YEAR on calvinw/BusMgmtBenchmarks/main |
Step 3 — Extract the 13 standard fields
All values in thousands of dollars. Extract from each source:
| Field | Notes |
|---|
| Net Revenue | |
| Cost of Goods | Positive value |
| Gross Margin | Revenue − COGS |
| SGA | Most error-prone — see anomaly rules |
| Operating Profit | Can be negative |
| Net Profit | Can be negative |
| Inventory | NULL for pure marketplace companies |
| Current Assets | |
| Total Assets | |
| Current Liabilities | |
| Liabilities | Total Assets − Total SE |
| Total Shareholder Equity | Can be negative |
| Total Liabilities and Shareholder Equity | Must equal Total Assets |
Also extract reportDate (fiscal year-end date, e.g. 2024-12-31).
Step 4 — Run anomaly detection
Read references/anomaly-rules.md now. Apply all rules.
Read references/company-notes.md and check for any entry matching this company.
Flag every issue as [WARNING] (investigate) or [ERROR] (must resolve before inserting).
Step 5 — Side-by-side comparison table
Present a table with columns: SEC | Yahoo | Dolt (current) | Recommended.
Mark cells where sources disagree with *.
Step 6 — Reconciled recommendation
For each field state:
- Recommended value and which source it comes from
- Any adjustment made (especially SGA composite construction)
- Whether the current Dolt value differs and would be overwritten
Step 7 — Signal readiness
End with the appropriate message based on mode:
Single-year mode:
Analysis complete. Run /create-verified-dolt-db-financials-sql {TICKER} {YEAR} to write these values to the database.
Multi-year mode (after all years have been analyzed): emit a single combined message — do NOT repeat this per year:
Analysis complete. Run /create-verified-dolt-db-financials-sql {TICKER} to write all changed years to the database.
List any unresolved flags for the user to review before inserting.
Step 8 — Save report to file
Single-year mode: write reports/{TICKER}-{YEAR}.md containing all content from Steps 4–7 for that year.
Multi-year mode: after all years have been analyzed, write a single combined file reports/{TICKER}-all-years.md. This file is what /create-verified-dolt-db-financials-sql reads when run later in a separate session, so it must include:
- A per-year summary table near the top with columns: Year | reportDate | Action (values: "No change", "New insert", "Correction: [field]", etc.)
- The full per-year analysis sections (Steps 4–7 content) for every year, in ascending order.
The file must start with:
# {Company Name} ({TICKER}) — FY{YEAR_RANGE} Financial Analysis
**Generated:** {today's date}
**Source:** /verify-dolt-db-financials skill
---
After writing the file(s), tell the user:
Report saved to reports/{TICKER}-{YEAR}.md. (single-year)
Report saved to reports/{TICKER}-all-years.md. (multi-year)
References
references/anomaly-rules.md — SGA composite rules, balance sheet checks, gross margin benchmarks, restatement logic. Read in Step 4.
references/company-notes.md — Per-company quirks. Check in Step 4 for the company being analyzed.