What Are the Primary Financial Tools Available in Dexter? A Complete Guide to the Finance Package

Dexter provides 15+ primary financial tools organized into two high-level agents—financial_search and financial_metrics—that expose real-time prices, historical data, SEC filings, and fundamental analysis through a unified LangChain-compatible interface.

The virattt/dexter repository implements a comprehensive finance package located in src/tools/finance/ that transforms raw market data into LLM-actionable intelligence. All primary financial tools are exported from src/tools/finance/index.ts and implement LangChain's DynamicStructuredTool interface with Zod-validated input schemas.

High-Level Agents: financial_search and financial_metrics

Dexter's architecture separates concerns into two intelligent routing agents that determine which low-level tools to execute based on natural-language queries.

financial_search Agent

The financial_search agent, implemented in src/tools/finance/financial-search.ts, handles general financial queries by parsing intent, selecting relevant tools, executing them in parallel, and merging results. It has access to the full suite of 15+ tools including price data, crypto, fundamentals, news, and insider trades.

financial_metrics Agent

The financial_metrics agent, defined in src/tools/finance/financial-metrics.ts, specializes in fundamental analysis queries. It routes requests specifically to financial statement and ratio tools, optimizing for deep-dive equity research workflows.

Primary Financial Tools by Category

All low-level tools conform to the DynamicStructuredTool pattern, return results wrapped by formatToolResult, and expose source URLs for data provenance.

Market Price Data

Located in src/tools/finance/prices.ts:

  • get_price_snapshot – Retrieves the latest OHLCV and metadata for a ticker
  • get_prices – Fetches historical price series with customizable date ranges

Cryptocurrency Data

Implemented in src/tools/finance/crypto.ts:

  • get_crypto_price_snapshot – Real-time crypto prices
  • get_crypto_prices – Historical crypto OHLCV data
  • get_crypto_tickers – Available cryptocurrency symbols and metadata

Fundamental Statements

Defined in src/tools/finance/fundamentals.ts:

  • get_income_statements – Quarterly and annual income data
  • get_balance_sheets – Asset, liability, and equity breakdowns
  • get_cash_flow_statements – Operating, investing, and financing cash flows
  • get_all_financial_statements – Consolidated retrieval of all three statements

Key Ratios and Metrics

Located in src/tools/finance/key-ratios.ts:

  • get_key_ratios_snapshot – Latest valuation and efficiency ratios (P/E, ROE, etc.)
  • get_key_ratios – Historical ratio trends for comparative analysis

Analyst and Market Intelligence

Company Structure and Segments

SEC Filings

Using Dexter's Financial Tools in Practice

The typical workflow involves instantiating the high-level agents and passing natural-language queries. The LLM handles tool selection and parallel execution automatically.

import { createFinancialSearch, createFinancialMetrics } from './src/tools/finance/index.js';
import { callLlm } from './src/model/llm.js';

// Generic financial search across all data types
const searchTool = createFinancialSearch('gpt-5.2');
const result1 = await searchTool.invoke({
  query: 'Show me AAPL price history from Jan 2023 to Jan 2024 and its P/E ratio.'
});
// Returns merged data from get_prices and get_key_ratios_snapshot

For fundamental analysis specifically, use the metrics agent:

// Focused fundamental analysis
const metricsTool = createFinancialMetrics('gpt-5.2');
const result2 = await metricsTool.invoke({
  query: 'Give me the last four quarters of Microsoft’s revenue and operating cash flow.'
});
// Returns structured data from get_income_statements and get_cash_flow_statements

Both agents return results wrapped by formatToolResult, ensuring consistent data fields and source URL attribution for auditability.

Key Implementation Files

File Role
src/tools/finance/index.ts Central export barrel for all financial tools
src/tools/finance/financial-search.ts Generic query router (financial_search agent)
src/tools/finance/financial-metrics.ts Fundamental analysis router (financial_metrics agent)
src/tools/finance/prices.ts Equity price snapshots and historical data
src/tools/finance/crypto.ts Cryptocurrency market data
src/tools/finance/fundamentals.ts Income, balance sheet, and cash flow statements
src/tools/finance/key-ratios.ts Valuation and efficiency ratios
src/tools/finance/estimates.ts Analyst EPS and revenue estimates
src/tools/finance/news.ts Market news retrieval
src/tools/finance/insider_trades.ts Insider transaction data
src/tools/finance/segments.ts Business segment revenues
src/tools/finance/company_facts.ts Static company metadata
src/tools/finance/read-filings.ts SEC filing parser wrapper

Summary

  • Dexter's primary financial tools are organized under src/tools/finance/ and exposed through src/tools/finance/index.ts.
  • Two intelligent agentsfinancial_search and financial_metrics—handle natural-language query routing and parallel tool execution.
  • The toolkit includes 15+ specialized tools covering prices, crypto, fundamentals, ratios, estimates, news, insider trades, segments, and SEC filings.
  • All tools implement LangChain's DynamicStructuredTool interface with Zod validation and return standardized results via formatToolResult.

Frequently Asked Questions

What is the difference between financial_search and financial_metrics agents?

The financial_search agent is a general-purpose router that can access all 15+ financial tools, making it suitable for broad queries that mix price data, news, and fundamentals. The financial_metrics agent is specialized for fundamental analysis, routing queries exclusively to financial statements and key ratio tools for deep-dive equity research.

How do Dexter's financial tools validate input parameters?

All primary financial tools in Dexter use Zod schemas to validate inputs before execution. As DynamicStructuredTool instances, they enforce type safety on parameters such as ticker symbols, date ranges, and statement periods, ensuring that invalid queries are caught before reaching the data provider.

Can I use individual financial tools without the high-level agents?

Yes. While the financial_search and financial_metrics agents provide convenient natural-language routing, you can import and invoke individual tools directly from src/tools/finance/index.ts. Each tool is a standalone DynamicStructuredTool that can be called programmatically with structured arguments.

What data sources back Dexter's financial tools?

According to the source code in virattt/dexter, the financial tools aggregate data from multiple providers including real-time price feeds, SEC EDGAR filings (via createReadFilings), and fundamental data APIs. Each tool result includes source URLs via formatToolResult for full data provenance and auditability.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →