diff --git a/packages/core/src/agent/run-log.error-detection.test.ts b/packages/core/src/agent/run-log.error-detection.test.ts index 653f1f0d..53253e78 100644 --- a/packages/core/src/agent/run-log.error-detection.test.ts +++ b/packages/core/src/agent/run-log.error-detection.test.ts @@ -29,8 +29,8 @@ describe("inferRunLogToolIsError", () => { expect( inferRunLogToolIsError( false, - "{\"domain\":\"finance\",\"action\":\"get_price_snapshot\"}", - { domain: "finance", action: "get_price_snapshot" }, + "{\"domain\":\"finance\",\"action\":\"get_financial_metrics\"}", + { domain: "finance", action: "get_financial_metrics" }, ), ).toBe(false); }); diff --git a/packages/core/src/agent/run-log.ts b/packages/core/src/agent/run-log.ts index 3890ea92..03706a25 100644 --- a/packages/core/src/agent/run-log.ts +++ b/packages/core/src/agent/run-log.ts @@ -27,7 +27,7 @@ * - `tool_end` — Tool execution completes. * Fields: tool (name), duration_ms, is_error, result_chars, result_summary?, error_type? * result_chars: total character count of result content (survives session compaction) - * result_summary: short tool-specific summary (e.g. "10 results", "12.5KB", "finance/get_price_snapshot") + * result_summary: short tool-specific summary (e.g. "10 results", "12.5KB", "finance/get_financial_metrics") * error_type: error category when tool returned an error (e.g. "fetch_failed", "ssrf_blocked") * * ### Context Management — Preflight (before LLM call) diff --git a/packages/core/src/agent/tools/data/data-tool.ts b/packages/core/src/agent/tools/data/data-tool.ts index 5f3aaf24..3f5ebabb 100644 --- a/packages/core/src/agent/tools/data/data-tool.ts +++ b/packages/core/src/agent/tools/data/data-tool.ts @@ -21,8 +21,6 @@ const DataToolSchema = Type.Object({ "Action to perform within the domain.\n\n" + "FINANCE DOMAIN ACTIONS:\n" + "Prices:\n" + - " get_price_snapshot — params: { ticker }\n" + - " get_prices — params: { ticker, start_date, end_date, interval?, interval_multiplier? }\n" + " get_crypto_price_snapshot — params: { ticker } (e.g. BTC-USD)\n" + " get_crypto_prices — params: { ticker, start_date, end_date, interval?, interval_multiplier? }\n" + " get_available_crypto_tickers — params: {}\n" + @@ -32,7 +30,6 @@ const DataToolSchema = Type.Object({ " get_cash_flow_statements — same params\n" + " get_all_financial_statements — same params (returns all three)\n" + "Metrics:\n" + - " get_financial_metrics_snapshot — params: { ticker }\n" + " get_financial_metrics — params: { ticker, period?, limit?, report_period*? }\n" + " get_analyst_estimates — params: { ticker, period? }\n" + "Company:\n" + diff --git a/packages/core/src/agent/tools/data/finance/actions.ts b/packages/core/src/agent/tools/data/finance/actions.ts index 557b9fcf..e5671796 100644 --- a/packages/core/src/agent/tools/data/finance/actions.ts +++ b/packages/core/src/agent/tools/data/finance/actions.ts @@ -66,30 +66,6 @@ type ActionHandler = (params: Params, signal?: AbortSignal) => Promise = { // ── Prices ────────────────────────────────────────────────────────────── - get_price_snapshot: async (params, signal) => { - const ticker = requireParam(params, "ticker"); - const { data, url } = await financeFetch("/prices/snapshot", { ticker }, signal); - return { data: (data as Record).snapshot ?? data, sourceUrl: url }; - }, - - get_prices: async (params, signal) => { - const ticker = requireParam(params, "ticker"); - const start_date = requireParam(params, "start_date"); - const end_date = requireParam(params, "end_date"); - const { data, url } = await financeFetch( - "/prices", - { - ticker, - start_date, - end_date, - interval: optionalString(params, "interval") ?? "day", - interval_multiplier: optionalNumber(params, "interval_multiplier"), - }, - signal, - ); - return { data: (data as Record).prices ?? data, sourceUrl: url }; - }, - get_crypto_price_snapshot: async (params, signal) => { const ticker = requireParam(params, "ticker"); const { data, url } = await financeFetch("/crypto/prices/snapshot", { ticker }, signal); @@ -147,12 +123,6 @@ const handlers: Record = { // ── Metrics & estimates ───────────────────────────────────────────────── - get_financial_metrics_snapshot: async (params, signal) => { - const ticker = requireParam(params, "ticker"); - const { data, url } = await financeFetch("/financial-metrics/snapshot", { ticker }, signal); - return { data: (data as Record).snapshot ?? data, sourceUrl: url }; - }, - get_financial_metrics: async (params, signal) => { const ticker = requireParam(params, "ticker"); const { data, url } = await financeFetch( diff --git a/packages/core/src/agent/tools/data/finance/types.ts b/packages/core/src/agent/tools/data/finance/types.ts index 82fa4342..6ef1981e 100644 --- a/packages/core/src/agent/tools/data/finance/types.ts +++ b/packages/core/src/agent/tools/data/finance/types.ts @@ -5,8 +5,6 @@ /** All supported finance actions */ export const FINANCE_ACTIONS = [ // Price data - "get_price_snapshot", - "get_prices", "get_crypto_price_snapshot", "get_crypto_prices", "get_available_crypto_tickers", @@ -16,7 +14,6 @@ export const FINANCE_ACTIONS = [ "get_cash_flow_statements", "get_all_financial_statements", // Metrics & estimates - "get_financial_metrics_snapshot", "get_financial_metrics", "get_analyst_estimates", // Company info diff --git a/skills/dcf-valuation/SKILL.md b/skills/dcf-valuation/SKILL.md index 31f9ff50..89845694 100644 --- a/skills/dcf-valuation/SKILL.md +++ b/skills/dcf-valuation/SKILL.md @@ -58,8 +58,8 @@ Use `data` tool with `domain="finance"` for all calls: 4. **Financial Metrics** (current): ``` - action: "get_financial_metrics_snapshot" - params: { ticker: "[TICKER]" } + action: "get_financial_metrics" + params: { ticker: "[TICKER]", period: "quarterly", limit: 1 } ``` Extract: `market_cap`, `enterprise_value`, `return_on_invested_capital`, `debt_to_equity`, `free_cash_flow_per_share` @@ -70,19 +70,18 @@ Use `data` tool with `domain="finance"` for all calls: ``` Extract: Forward EPS estimates for growth validation -6. **Current Price**: - ``` - action: "get_price_snapshot" - params: { ticker: "[TICKER]" } - ``` - -7. **Company Facts**: +6. **Company Facts**: ``` action: "get_company_facts" params: { ticker: "[TICKER]" } ``` Extract: `sector` — use to determine WACC range from [sector-wacc.md](references/sector-wacc.md) +7. **Current Price** (use web search): + ``` + web_search("[TICKER] stock price today") + ``` + 8. **Recent Event Context**: - Pull company-specific headlines with: ``` diff --git a/skills/earnings-analysis/SKILL.md b/skills/earnings-analysis/SKILL.md index 450e1f06..6957e108 100644 --- a/skills/earnings-analysis/SKILL.md +++ b/skills/earnings-analysis/SKILL.md @@ -64,8 +64,8 @@ Use `data` tool with `domain="finance"` for all structured data calls. 3. **Current financial metrics**: ``` - action: "get_financial_metrics_snapshot" - params: { ticker: "[TICKER]" } + action: "get_financial_metrics" + params: { ticker: "[TICKER]", period: "quarterly", limit: 1 } ``` 4. **Company facts**: @@ -75,13 +75,7 @@ Use `data` tool with `domain="finance"` for all structured data calls. ``` Extract: `sector`, `industry` — needed for benchmark comparisons in later steps. -5. **Current stock price**: - ``` - action: "get_price_snapshot" - params: { ticker: "[TICKER]" } - ``` - -6. **Recent news**: +5. **Recent news**: ``` action: "get_news" params: { ticker: "[TICKER]", limit: 10 } @@ -349,8 +343,8 @@ Pull and analyze the most recent annual or quarterly filing: 2. **Pull peer data** (for each peer): ``` - action: "get_financial_metrics_snapshot" - params: { ticker: "[PEER_TICKER]" } + action: "get_financial_metrics" + params: { ticker: "[PEER_TICKER]", period: "quarterly", limit: 1 } ``` ``` action: "get_income_statements" diff --git a/skills/finance-research/SKILL.md b/skills/finance-research/SKILL.md index 1aae38dc..7322eddc 100644 --- a/skills/finance-research/SKILL.md +++ b/skills/finance-research/SKILL.md @@ -22,11 +22,8 @@ You are conducting financial research with an analyst-grade standard. Tool usage ### Available Data Actions #### Price Data -- `get_price_snapshot` — Current stock price. Params: `{ ticker }` -- `get_prices` — Historical OHLCV prices. Params: `{ ticker, start_date, end_date, interval?, interval_multiplier? }` - - interval: "day" (default), "week", "month", "year" - `get_crypto_price_snapshot` — Current crypto price. Params: `{ ticker }` (e.g. "BTC-USD") -- `get_crypto_prices` — Historical crypto prices. Same params as get_prices. +- `get_crypto_prices` — Historical crypto prices. Params: `{ ticker, start_date, end_date, interval?, interval_multiplier? }` - `get_available_crypto_tickers` — List available crypto tickers. Params: `{}` #### Financial Statements @@ -41,7 +38,6 @@ Actions: - `get_all_financial_statements` — All three at once (more efficient when you need multiple) #### Metrics & Estimates -- `get_financial_metrics_snapshot` — Current key ratios (P/E, market cap, margins, etc.). Params: `{ ticker }` - `get_financial_metrics` — Historical metrics. Params: `{ ticker, period?, limit?, report_period*? }` - `get_analyst_estimates` — EPS and revenue estimates. Params: `{ ticker, period? }` @@ -75,7 +71,7 @@ Decision policy: - State region and analysis horizon (event-driven, 3-6 months, 1-3 years). 2. **Core Company Data (Structured)** -- Start with: `get_price_snapshot`, `get_company_facts`, `get_financial_metrics_snapshot`. +- Start with: `get_company_facts`, `get_financial_metrics`. - Pull statements (`get_all_financial_statements`) and estimates as needed. 3. **Macro & Policy Context (Conditional)** @@ -121,7 +117,7 @@ Primary-market capability boundary: When asked about listed equities: 1. **Trend & Positioning** -- Pull 1y price history (`get_prices`) and identify regime (uptrend/range/downtrend) with volatility context. +- Pull 1y price history (`get_crypto_prices` for crypto, or use `web_search` for stock prices) and identify regime (uptrend/range/downtrend) with volatility context. 2. **Fundamentals** - Analyze growth quality (revenue vs FCF), margin durability, leverage, and capital allocation. @@ -159,8 +155,7 @@ Always include: For "Analyze Apple's investment outlook": -1. `data(domain="finance", action="get_price_snapshot", params={ticker: "AAPL"})` -2. `data(domain="finance", action="get_company_facts", params={ticker: "AAPL"})` +1. `data(domain="finance", action="get_company_facts", params={ticker: "AAPL"})` 3. `data(domain="finance", action="get_all_financial_statements", params={ticker: "AAPL", period: "annual", limit: 3})` 4. `data(domain="finance", action="get_financial_metrics", params={ticker: "AAPL", period: "quarterly", limit: 8})` 5. `data(domain="finance", action="get_analyst_estimates", params={ticker: "AAPL", period: "annual"})`