show_prices
Retrieve cached price data for all synced tickers: current price, previous close, change percent, 52-week high/low, dividend yield, sector, country, and last sync time. Use when you need price metadata not exposed in portfolio view.
Instructions
Raw cached price rows for all synced tickers — current_price, prev_close, change_percent, 52w high/low, dividend yield, sector, country, last sync time. Useful for tool-level inspection or when you need price metadata not exposed by show_portfolio (e.g. sector classification, sync freshness).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- apps/mcp/src/tools/portfolio.ts:202-210 (handler)The tool 'show_prices' handler: queries all rows from the 'prices' table and returns them as JSON via the ok() helper.
server.tool( 'show_prices', 'Raw cached price rows for all synced tickers — current_price, prev_close, change_percent, 52w high/low, dividend yield, sector, country, last sync time. Useful for tool-level inspection or when you need price metadata not exposed by show_portfolio (e.g. sector classification, sync freshness).', {}, async () => { const db = getDb(); return ok(db.select().from(prices).all()); }, ); - packages/db/src/schema.ts:80-98 (schema)Drizzle ORM schema definition for the 'prices' table, which is the data source queried by show_prices.
export const prices = sqliteTable('prices', { ticker: text('ticker').primaryKey(), name: text('name').notNull(), exchange: text('exchange').notNull().default(''), currency: text('currency').notNull().default('USD'), current_price: real('current_price').notNull(), prev_close: real('prev_close').notNull().default(0), change_percent: real('change_percent').notNull().default(0), high_52w: real('high_52w').notNull().default(0), low_52w: real('low_52w').notNull().default(0), pe: real('pe'), eps: real('eps'), market_cap: real('market_cap').notNull().default(0), sector: text('sector'), country: text('country'), dividend_per_share: real('dividend_per_share'), dividend_yield: real('dividend_yield'), synced_at: text('synced_at').notNull(), }); - apps/mcp/src/tools/portfolio.ts:202-210 (registration)Tool registration via server.tool() inside registerPortfolioTools(), which is called from index.ts line 19.
server.tool( 'show_prices', 'Raw cached price rows for all synced tickers — current_price, prev_close, change_percent, 52w high/low, dividend yield, sector, country, last sync time. Useful for tool-level inspection or when you need price metadata not exposed by show_portfolio (e.g. sector classification, sync freshness).', {}, async () => { const db = getDb(); return ok(db.select().from(prices).all()); }, ); - apps/mcp/src/index.ts:8-22 (registration)Top-level registration entry point that calls registerPortfolioTools to register show_prices on the MCP server.
import { registerPortfolioTools } from './tools/portfolio.ts'; import { registerReportTools } from './tools/report.ts'; import { registerSnapshotTools } from './tools/snapshot.ts'; import { registerStockTools } from './tools/stock.ts'; import { registerPrompts } from './prompts.ts'; const server = new McpServer( { name: 'firma', version: FIRMA_VERSION }, { instructions: SERVER_INSTRUCTIONS }, ); registerPortfolioTools(server); registerReportTools(server); registerMutateTools(server); registerSnapshotTools(server); - apps/mcp/src/helpers.ts:67-69 (helper)The ok() helper wraps results in the MCP content response format used by show_prices.
export const ok = (data: unknown) => ({ content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], });