Side-by-side snapshot of a stock and a crypto asset: live quotes, 1-year history, and a date-stamped comparison.
An agent or analyst wants to compare a traditional equity with a crypto asset โ e.g. 'How has AAPL performed versus BTC over the last year?' Running stock-quote and crypto-price individually gives two disconnected numbers; adding historical data from both sides plus a date-format timestamp turns it into a dated comparison card the caller can track over time or feed into a report. Useful for portfolio dashboards, market-update bots, newsletter generators, and any agent that needs a quick cross-asset health check.
claude mcp add agent402 -s user -- npx -y agent402-mcp@latest
Then paste this prompt into Claude:
Build a cross-asset price comparison for ticker=AAPL vs coin=bitcoin using Agent402.
(1) date-format with datetime=new Date().toISOString() โ returns {iso, date, dayOfWeek, unix}. Save as snapshot timestamp.
(2) stock-quote with symbol=AAPL โ returns {price, change, changePercent, volume, marketCap}.
(3) stock-history with symbol=AAPL, range='1y' โ returns {history: [{date, close}]}. Compute stockYearReturn = ((history[last].close - history[0].close) / history[0].close * 100).toFixed(2).
(4) crypto-price with coins=bitcoin, currency='usd' โ returns [{price, market_cap, change_24h}].
(5) crypto-history with coin=bitcoin, days='365', currency='usd' โ returns {prices: [[timestamp, price]]}. Compute cryptoYearReturn = ((prices[last][1] - prices[0][1]) / prices[0][1] * 100).toFixed(2).
Final return: {timestamp: {iso: <step 1 iso>, date: <step 1 date>, dayOfWeek: <step 1 dayOfWeek>}, stock: {symbol: 'AAPL', price: <step 2 price>, change: <step 2 change>, changePercent: <step 2 changePercent>, yearReturn: stockYearReturn}, crypto: {coin: 'bitcoin', price: <step 4 price>, change24h: <step 4 change_24h>, yearReturn: cryptoYearReturn}, comparison: {stockOutperforms: parseFloat(stockYearReturn) > parseFloat(cryptoYearReturn), spreadPct: Math.abs(parseFloat(stockYearReturn) - parseFloat(cryptoYearReturn)).toFixed(2)}}. Budget ~$0.005 paid; all 5 tools are wallet-only (external API calls).